1

I have setup custom dimensions as follows

enter image description here

My source code shows as this:

<script>
    window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
    ga('create', 'UA-XXXXXXX-1', 'auto');
    ga('send', 'pageview');

    ga('set', 'dimension1', 'Manager');
    ga('set', 'dimension2', 'Recruitment');
    ga('set', 'dimension3', 'Leave');

</script>

It's been in place for 24 hours. However when I go to my Google Analytics account > Home > Behaviour > Site Content > All Pages, and then add any of the custom dimensions I've created, no data is brought back.

Am I doing something terribly wrong or does everything look ok?

2

You need to reorder your calls. By the time you set the custom dimensions, your pageview is already sent, without those.

So your code should be:

window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-XXXXXXX-1', 'auto');

ga('set', 'dimension1', 'Manager');
ga('set', 'dimension2', 'Recruitment');
ga('set', 'dimension3', 'Leave');

ga('send', 'pageview');

(I assume, that your Analytics tracker is initialised, and your pageview is collected properly, but without custom dimensions set.)

Further reference:

Custom dimensions & metrics (see Collection)

Developer guide

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.