Google Analytics Custom Dimension Not Being Set

Jason Miller picture Jason Miller · May 7, 2014 · Viewed 11.7k times · Source

I've recently upgraded our site to use Universal Analytics and am trying to get some custom dimensions to work. However, no custom dimension data appears to be logged. Below is an example of my code.

ga('create', 'UA-XXXXX', 'test.com');
ga('send', 'pageview');
ga('set', 'dimension1', '149377');

Do I need to set custom dimensions before sending pageview?

Answer

haimlit picture haimlit · May 7, 2014

A dimension is sent along with the either a page view or an event. It won't get sent by itself. So you should switch the order of the 'send' and 'set', then look in the network to see the page view call and you should see the dimension as one of the parameters.

Note that you will see the dimension data in google analytics with a delay of a day or so.