0
votes

I've a custom dimension (#1) that has a value of 0 or 1. I set this custom dimension to every visitor on his first page once. So if he visits page two, this custom dimension won't set again.

So I expect that in my GA overview the sum of all visitors with cd1 value of 0 and 1 should be unique visitors. But that's not happen. Sum of all visitors with cd1 value of 0 and 1 is only 1/3 of my unique visitors.

That's my GA tracking code.

(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');

ga('create', '#######', {
    'cookieDomain': '#######',
    'cookieName' : '######',
    'anonymizeIp': true,
    'allowLinker': true
});

omnidoo.tracking.checkDimension(); //sets dimension like ga('set', 'dimension' + idDimension, value);
ga('send', 'pageview');

The request looks good too, because it sends parameter cd1 (custom dimension 1) with the pageview request. Value is 0 or 1 for this custom dimension.

Here you can look into the GA request and see that cd1 with value 0 or 1 is fired once. On reload or further pages, it won't appear again - is this maybe the problem? Do I've to fire it on every page or GA removes this dimension for this visitor? (To fire it again, you've to delete your cookies for this site and reload.)

That happens on my page:

  1. Check if user is new or has already a cookie.
  2. Set cookie with value 0 or 1 for A/B testing.
  3. Set custom dimension with 0 or 1.
  4. Fire pageview event.
  5. If user registers successfully fire event registration.

At GA I have created a segment called register - just to count all registrations. It's set on eventcategory registration. Than I've two segments for the A/B testing. And I expected that the sum of those segments should be the number of all unique visitors - but it's just 1/3 - althought every user gets a custom dimension 0 or 1. And when I mixup A/B testing and custom dimensions - to see which did better convert, the sum of this mixed (A/B testing 0 or 1 and custom dimension) segment should be as high as all tracked registrations - but this number is different too.

But it seems that there must be a problem in my implementation?!

1
This is not answerable unless you tell us the scope for your custom dimension. - Eike Pierstorff
With scope you mean what I setup at google analytics? Actually it's based on visitor. - Jurik
And it's set on user at custom dimension setup page. - Jurik
developers.google.com/analytics/devguides/platform/… says that I've to fire the custom dimension only once when it's scope is user. - Jurik

1 Answers

0
votes

Jurik,

I am not sure what is the goal of your implementation, but I can see few points that might lead to the discrepancy in numbers:

  • If you set the custom dimension every visit (not sure if you are checking this by a cookie/something else), you might be overriding values.
  • Therefore, for 1 unique visitor you can have both 0 and 1 values set.
  • And keep in mind that Google Analytics is de-duplicating the totals -- if lots of visitors are returning regularly, there is no way you can control the aggregation in the reports done by GA.

From my experience, the best way to achieve "real" number of visitors (or maybe rather devices) is to pass ClientID to custom dimension (on user level).

This is both useful -- you can then use measurement protocol for offline transactions, but more importantly, you have an unique ID key for every visitor. If you then do a simple distinct count (you would have to export the data via API first to Database/Excel), you will end up with a number that should be quite precise.

Hope this helps :)