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

1

0

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%>"
   });
Pliable answered 22/5, 2014 at 19:55 Comment(0)
S
2

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.

Sauerkraut answered 22/5, 2014 at 21:28 Comment(4)
Thanks! My boss suspected as much, but I needed verification. It seems like ghost data is being logged. I'm not so much concerned about the extra data being stored in this old account as about the possibility that I missed something in my code, and that the new account wouldn't be tracking properly. I appreciate your attention to this.Pliable
So, should I then change this to a session-level variable going forward, if I want to track daily log-ins rather than lifetime log-ins?Pliable
Not sure how that will behave. I'd just deactivate this one and create a brand new one session level to track going forward. After all you should have plenty of slots, Why reuse?Sauerkraut
I have decided to change it to "Registered", and only send that data when a Registered user logs in. For Sessions, I'm going to create a new dimension called Member / Guest that will track log-ins at the session level. Thanks for your help, Eduardo!!Pliable

© 2022 - 2024 — McMap. All rights reserved.