简体   繁体   中英

Kynetx plugin vs Site Tags — How can I tell the difference?

My application has a homepage where you can download and install the plugins. It also uses site tags to call the same ruleset to show potential users what the app does.

I'd like to hide the plugins and replace that div with one that says 'Thanks for installing the plugin.' How can I tell the difference between KRL called from the site tags and KRL called from the plugin?

Here's my ideas, but perhaps there is a better way?

Option 1: Use page parameter, maybe the plugin won't see it. Option 2: Use a second ruleset that calls into my primary ruleset. The plugin ruleset will hide the plugin div and unhide the 'thank you' div. I just have to have the primary ruleset support explicit events.

I think your best option is to use a page parameter, as you said. This will only be sent to the ruleset from your site tags--not from the browser extension--so that should solve your problem. Your site tags will look something like this:

<script type="text/javascript">
  var KOBJ_config = {
    "rids" : ["a999x99"]
    "called_from_site_tags" : "true"
  };
</script>
<script type="text/javascript" src="http://init.kobj.net/js/shared/kobj-static.js">
</script>

Then in your app you just have to check the page:param and do whatever you want with it:

is_site_tags = page:param("called_from_site_tags");

See here in the docs for more information. Hope that helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM