简体   繁体   English

如何注册一个独特的页面视图以及如何使用自定义维度Google Analytics

[英]How to register a uniquePageview and how to use custom dimensions google analytics

I am working with custom dimensions to track my website. 我正在使用自定义维度来跟踪我的网站。 I have a content based website. 我有一个基于内容的网站。 I want to track from which publisher my tracking is coming so I have developed something which uses parameters in my url for eg. 我想跟踪我的跟踪来自哪个发布者,所以我开发了一些东西,例如使用URL中的参数。 www.xyz.com?code=UNIQUECODE www.xyz.com?code=UNIQUECODE

this unique code Tells me which publishers link redirected to my page. 这个唯一的代码告诉我哪个发布者链接已重定向到我的页面。 I run this UNIQUECODE through my database and send the id of the publisher associated with it using tag manager to my custom dimension ie PUBLISHER. 我通过数据库运行此UNIQUECODE,并使用标签管理器将与之关联的发布者的ID发送到我的自定义维度(即PUBLISHER)。

now I dont want to register another pageview for that particular publisher if the user refreshes or after a session ends. 现在,如果用户刷新或会话结束后,我不想为该特定发布者注册另一个综合浏览量。

what should be the scope of my custom dimension which persists the ID and not record another uniquePageview even if session ends. 我的自定义维度的范围应该是什么,它可以保留ID并且即使会话结束也不记录另一个uniquePageview。

If I understand your aim correctly I don't think any of the available scopes will provide exactly what you are after. 如果我正确理解了您的目标,那么我认为任何可用的范围都无法提供您所追求的目标。 Essentially the scope options process the last value in the session but you want to process the first value in the session. 本质上,作用域选项处理会话中的最后一个值,但您要处理会话中的第一个值。

I think you would have to use hit-level scope because that is the only way to ensure the first value persists in reporting. 我认为您将必须使用命中级别范围,因为这是确保第一个值持续存在于报告中的唯一方法。

Im not sure why not just use UTMs but if you like it you way i recommend you to use a custom dimension at session level and use a trigger a little more specific that just checking for the 'code' parameter. 我不确定为什么不只使用UTM,但如果您喜欢,我建议您在会话级别使用自定义维度,并使用比检查“ code”参数更具体的触发器。

Build a custom JS that saves in the browser sessionStorage a flag that indicates if that person came with a 'code' in this session. 构建一个自定义JS,该JS保存在浏览器sessionStorage中,该标志指示该人员在此会话中是否带有“代码”。 This way the tag will fire only the first time a user enter the site with a 'code'. 这样,只有当用户首次使用“代码”进入网站时,代码才会触发。 All the pageviews the user navigate after even if the 'code' parameter appear there will be a variable 'X' on the sessionStorage that avoids the tag to fire. 即使出现“ code”参数,用户浏览后的所有综合浏览量也会在sessionStorage上出现一个变量“ X”,从而避免触发代码。

Finally, i strongly suggest you to avoid using debug mode to test this since it tends to break a lot with JS. 最后,我强烈建议您避免使用调试模式进行测试,因为JS往往会破坏很多模式。 Create a environment for Stage (Yes, tag manager has environments) and use the preview without debug. 为舞台创建一个环境(是的,标签管理器具有环境),并使用预览而不进行调试。

If you need more info just ask. 如果您需要更多信息,请询问。 Good Luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Google Analytics(分析)中取得具有自订维度的clientId - How to get clientId with custom dimensions in google analytics 如何在Google Analytics(分析)中设置自定义维度 - How to set custom dimensions in Google Analytics Google Analytics(分析)自定义维度 - Google analytics custom dimensions 如何在Google Analytics的自定义变量中使用变量 - How to use a variable in Google Analytics' Custom Variable 如何为与之前进行的相同调用/匹配的Google Analytics(分析)自定义维度添加代码,并添加一些自定义维度(需要花费一些时间来计算) - How to add code for Google Analytics custom dimensions for the same call/hit made prior, with some custom dimensions ( which take time to calculate ) ionic应用程序中的Google Analytics(分析)自定义维度 - Google Analytics custom dimensions within ionic app 随时修改Google Analytics自定义维度 - Modify Google Analytics custom dimensions on the go Google Analytics 不发送带有网页浏览点击的自定义维度 - Google analytics not sending custom dimensions with pageview hits Google Analytics(分析)使用gtag发送两个自定义维度 - Google Analytics send two custom dimensions with gtag 在Google AnalyticsAPI中使用和查询自定义维度 - Using and querying Custom Dimensions in Google Analytics API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM