具有多个跟踪器的Universal Analytics自定义维度 - 旧跟踪器记录用户级范围维度 [英] Universal Analytics Custom Dimensions with Multiple Trackers - Old tracker recording User-Level Scope Dimension

查看:124
本文介绍了具有多个跟踪器的Universal Analytics自定义维度 - 旧跟踪器记录用户级范围维度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个旧帐户,我升级了到Universal Analytics,并设置了几个自定义维度。其中一个是用户级范围的会员/访客变量



我们决定创建一个新帐户,但是,将我们的网站从其他网站中移出的另一个帐户移出。长话短说,但由于我们不能只移动一个账户,所以我们让它们都运行到2015年1月1日。



I移动自定义维度到新帐户(​​创建与旧帐户相匹配的新自定义维度),并且页面级范围变量似乎工作正常:没有更多数据记录到旧帐户,新帐户正在接收准确的数据。

以下是它变得奇怪的地方:尽管我已将代码更改为,但我们仍将会员/访客数据记录到我们的旧帐户将数据发送到旧帐户。



UA是否有可能记住用户,并使用a设置成员/访客数据cookie?



如果您将Chrome与Google Analytics调试附加组件( https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna?hl=en ),然后访问 www.boatlocal.com 。您将看到我在名为NewTracker的跟踪器中设置了Dimensions,并且未在名为OldTracker的跟踪器中设置任何Dimensions。



t匹配。 NewTracker获得的数据看起来像是准确的数据(Members + Guests = Total Sessions),但OldTracker获得的数字要少得多。



这里是代码(ASP.net是什么说明<%= Tags%>):

 (function(i,s,o,g,r ,a,m){
i ['GoogleAnalyticsObject'] = r; i [r] = i [r] || function(){
(i [r] .q = i [r]。 (),$ b $ = s.getElementsByTagName(o) )[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics .com / analytics.js','ga');

/ *这是旧的跟踪代码。没有尺寸发送。 * /
ga('create','UA-1800676-1','boatlocal.com',{'name':'OldTracker'});
ga('OldTracker.send','pageview');
//旧的跟踪器结束

//这是新的跟踪代码,所有维度均设置为
ga('create','UA-49699169-1',' boatlocal.com',{'name':'NewTracker'});
/ *
向Google发送页面视图和所有维度和指标:
dimension2:用户是会员还是来宾? (用户级别)
dimension3:组件 - 哪个通用组件? (照片/场所/文章/论坛)
* /

if('<%= myPage.analyticsComponent%>'!=''){
ga(' NewTracker.set','dimension3','<%= myPage.analyticsComponent%>');
}

('NewTracker.send','pageview',{
dimension2:<%= analyticsMemberOrGuest%>,
dimension4: <%= myPage.currentBranch.market%>,
dimension5:<%= myPage.currentBranch.branchName%>
});


解决方案

是的,这是用户级自定义维度的工作原理。对于已经设置了它们的用户,他们会被记住。他们将永远被记住,除非他们的cookie过期(默认情况下2年不活动)。

它们被记住使用GA随机生成的clientId并存储在cookie _ga 中。该值本身存储在GA后端而不是cookie中。



您拥有的一个选项是停用旧帐户中不再使用的自定义维度。只需进入自定义维度并取消选中活动复选框即可。或者,您可以忽略它们。


So, I have a very specific scenario that I hope you can help me with.

I had an older account that I upgraded to Universal Analytics, and set up several Custom Dimensions. One of these is a Member/Guest variable at user-level scope.

We decided to make a new account, however, to move our site out of another account that had many sites in it. Long story, but since we can't just move an account, we have them both running until Jan. 1, 2015.

I "moved" the Custom Dimensions to the new account (created new custom dimensions that match the old account's), and the page-level scope variables seem to work fine: no more data being logged to the old account, the new account is receiving accurate data.

Here's where it gets weird: We are still getting Member/Guest data logged to our old account, despite the fact that I changed the code to no longer send that data to the old account.

Is there a possibility UA is "remembering" Users, and setting the Member/Guest data using a cookie?

You can see what I mean if you use Chrome with the Analytics debug add-on (https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna?hl=en), and visit www.boatlocal.com. You'll see that I'm setting Dimensions in the tracker named "NewTracker", and not setting any Dimensions in the tracker named "OldTracker".

The data doesn't match. The NewTracker gets what looks like accurate data (Members + Guests = Total Sessions), but the OldTracker gets much lower numbers.

Here is the code in question (ASP.net is what accounts for the <%= Tags %>):

(function (i, s, o, g, r, a, m) {
        i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
            (i[r].q = i[r].q || []).push(arguments)
        }, i[r].l = 1 * new Date(); a = s.createElement(o),
        m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
    })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

    /*  This is the OLD tracking code.  No Dimensions are sent.  */
    ga('create', 'UA-1800676-1', 'boatlocal.com', { 'name': 'OldTracker' });
    ga('OldTracker.send', 'pageview');
    //end of old tracker

    //This is the NEW Tracking code, with all dimensions set
    ga('create', 'UA-49699169-1', 'boatlocal.com', { 'name': 'NewTracker' });
    /*
    Send page view and all Dimensions and Metrics to Google:
    dimension2 : is the user a Member or a Guest?  (user level)
    dimension3 : Component - Which generic component?  (Photos/Places/Articles/Forums)
    */

    if ('<%= myPage.analyticsComponent %>' != '') {
        ga('NewTracker.set', 'dimension3', '<%= myPage.analyticsComponent %>');
    }

   ga('NewTracker.send', 'pageview', {
        dimension2: "<%= analyticsMemberOrGuest %>",
        dimension4: "<%=myPage.currentBranch.market%>",
        dimension5: "<%=myPage.currentBranch.branchName%>"
   });

解决方案

Yes, this is how user-level custom dimensions work. They are remembered for users that already had them set. They will be forever remembered, unless their cookie expires (2 years of inactivity by default).

They are remembered using the clientId that GA generates randomly and store in the cookie _ga. The value itself is stored in the GA backend not the cookie.

One option you have is to deactivate the custom dimension you don't use anymore in the old account. Just go into custom dimensions and uncheck the "Active" checkbox. Alternatively you can just ignore them.

这篇关于具有多个跟踪器的Universal Analytics自定义维度 - 旧跟踪器记录用户级范围维度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆