Kynetx 插件与站点标签——如何区分?

发布于 2024-10-09 14:25:18 字数 258 浏览 0 评论 0原文

我的应用程序有一个主页,您可以在其中下载和安装插件。它还使用站点标签来调用相同的规则集,以向潜在用户展示该应用程序的功能。

我想隐藏插件并将该 div 替换为“感谢安装插件”。如何区分从网站标签调用的 KRL 和从插件调用的 KRL?

这是我的想法,但也许有更好的方法?

选项1:使用页面参数,可能插件看不到它。 选项 2:使用调用我的主规则集的第二个规则集。插件规则集将隐藏插件 div 并取消隐藏“谢谢”div。我只需要让主要规则集支持显式事件即可。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦在深巷 2024-10-16 14:25:18

正如您所说,我认为您最好的选择是使用页面参数。这只会从您的网站标签发送到规则集,而不是从浏览器扩展发送到规则集,因此这应该可以解决您的问题。您的网站标签将如下所示:

<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>

然后在您的应用程序中,您只需检查 page:param 并对其执行任何您想要的操作:

is_site_tags = page:param("called_from_site_tags");

请参阅 文档中了解更多信息。希望有帮助!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文