在 jquery ui 选项卡上放置联属营销跟踪标签
我在 jquery 驱动的 asp.net c# Web 应用程序的页面上使用 jquery ui 选项卡。这些选项卡很好地分隔了内容,为用户提供了跨多个页面移动的体验。
我有一家第三方附属公司,他们需要跟踪用户操作,因此希望在每个页面(“选项卡”)上放置像素标签。
如果我将标签直接添加到每个选项卡,那么它将无法正确跟踪,因为所有标签都会在页面加载时被触发。
我正在考虑当用户在选项卡中移动时使用 java 脚本动态加载图像。这是最好的方法吗?如果是,我该如何实现这一目标?任何其他建议。当用户浏览选项卡时,每个选项卡需要包含的内容示例如下:
Tab 1: <img src="https://xxxxx.com/xxxx.html?p=xxxx&d=1" width="0" height="0" />
Tab 2: <img src="https://xxxxx.com/xxxx.html?p=xxxx&d=2" width="0" height="0" />
Tab 3: <img src="https://xxxxx.com/xxxx.html?p=xxxx&d=3" width="0" height="0" />
Tab 4: <img src="https://xxxxx.com/xxxx.html?p=xxxx&d=4" width="0" height="0" />
我想放置一些结构,以便我可以轻松添加更多标签以无缝加载每个 ui 选项卡。
I am using jquery ui tabs on a page in my jquery driven asp.net c# web application. The tabs seperate out the content nicely giving the experience to the user that they are moving across multiple pages.
I have a third party affiliate company who need to track users actions and therefore want to place pixel tags on each of the pages ("tabs").
If I add the tags directly to each tab, then it wont track correctly as all will get fired on page load.
I was thinking of loading the image on the fly using the java script as the user moves through the tabs. Is this the best approach and if so how can I achieve this? Any other suggestions. Sample of what needs to be included per tab as the user moves through them is:
Tab 1: <img src="https://xxxxx.com/xxxx.html?p=xxxx&d=1" width="0" height="0" />
Tab 2: <img src="https://xxxxx.com/xxxx.html?p=xxxx&d=2" width="0" height="0" />
Tab 3: <img src="https://xxxxx.com/xxxx.html?p=xxxx&d=3" width="0" height="0" />
Tab 4: <img src="https://xxxxx.com/xxxx.html?p=xxxx&d=4" width="0" height="0" />
I would like to put some structure in place that I could easily add further tags to be loaded per ui tab seamlessly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将图像放在各自的选项卡中,但将其 src 属性保留为空。将图像链接放入 HTML5“数据”属性中。
然后,当选择选项卡时,加载图像:
HTML:
然后,当您创建选项卡时,传入选择事件处理程序来加载这些图像。
Javascript:
You can put the images in their respective tabs, but keep their src attribute empty. Put the link to the image in the HTML5 "data" attribute.
Then, when the tab is selected, load the image:
HTML:
Then, when you create the tabs, pass in a select event handler to load those images.
Javascript: