跟踪标签和标签GA 中的查询字符串
我有一些贴纸,其中包含我网站的 URL 二维码(如下所示:http://qrcode.kaywa.com/img.php?s=5&d=http%3A%2F%2Fissocial.net%23qr) 。我会把它贴在街上。正如您所看到的,如果有人阅读此二维码,他将转发到 http://issocial.net/#qr 页面。
现在我想跟踪通过此二维码贴纸访问我的网站的人。遗憾的是,Google Analytics 不跟踪主题标签。
也许我可以用查询字符串来做到这一点(例如: http://issocial.net/?qr=true )。但 GA 不仅仅跟踪一个查询字符串。
那么,你对此有什么想法吗?
I have a few stickers which contain my website's URL QR Code (like this : http://qrcode.kaywa.com/img.php?s=5&d=http%3A%2F%2Fissocial.net%23qr) . I will stick it to streets. As you can see if someone read this QR code, he will forward to http://issocial.net/#qr page.
Now i want to track people who reach my site via this QR Code Stickers. Sadly, Google Analytics isn't tracking hashtags.
Maybe i can do it with querystring (like : http://issocial.net/?qr=true) . But GA isn't tracking just one querystring.
So, have you any idea about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Google Analytics 的默认实现会忽略锚点,即 # 之后的所有内容,因此您需要手动传递该值。
_trackPageview
可以接受第二个参数,该参数允许您手动传递综合浏览量值。默认情况下,GA 的综合浏览量仅为
location.pathname+location.search
。因此,您所需要做的就是使用location.hash
传递它。Universal Analytics
使用较新的 UA API,命令应为:
Google Analytics's default implementation ignores the anchor, ie, everything after #, so you need to pass through the value manually.
_trackPageview
can accept a 2nd parameter that allows you to pass pageview values manually.By default, GA's pageview is just
location.pathname+location.search
. So, all you need to do is pass through that withlocation.hash
.Universal Analytics
With the newer UA API, the command should be:
您可以结合使用 _setAllowAnchor 和 _setCampMediumKey 来强制 Google Analytics(分析)(a) 使用您的哈希标签作为查询字符串,以及 (b) 使用您的“qr”代替正常的 utm _medium(或任何其他广告系列变量) 。
更多信息请参见:http://code.google.com/apis/analytics/docs/gaJS/gaJSApiCampaignTracking .html
You can use a combination of _setAllowAnchor and _setCampMediumKey to force Google Analytics to (a) use your hash tag as a query string and (b) use your 'qr' in place of the normal utm _medium (or any other of the campaign variables).
More here : http://code.google.com/apis/analytics/docs/gaJS/gaJSApiCampaignTracking.html
更新
在新的analytics.js中,它应该是
ga('create', 'UA-XXXX-Y', {'allowAnchor': true});
Update
In the new analytics.js it should be
ga('create', 'UA-XXXX-Y', {'allowAnchor': true});
没有网络服务器可以跟踪哈希标签。它们不会被发送到服务器;而是会被发送到服务器。它们仅供客户使用。
您始终可以只编码 http://.../qr 并将服务器重定向到您的主页。或者只是让它提供与主页相同的内容作为响应。或者通过缩短器。
No web server can track hash tags. They aren't sent to the server; they're only used by the client.
You could always just encode http://.../qr and have your server redirect to your home page. Or just have it serve up the same content as the home page in response. Or go through a shortener.