Universal Analytics Custom Dimensions with Multiple Trackers - Old tracker recording User-Level Scope Dimension

时光毁灭记忆、已成空白 提交于 2020-01-17 04:18:02

问题


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%>"
   });

回答1:


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.



来源:https://stackoverflow.com/questions/23815965/universal-analytics-custom-dimensions-with-multiple-trackers-old-tracker-recor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!