Reputation: 1
In Universal Analytics
In case I need to set my custom dimension on page load with a single pageview, should I need to set it prior to send.
ga('set', 'dimension1', dimensionValue); ga('send', 'pageview');
Let me know if this works.
Thanks
Upvotes: 0
Views: 195
Reputation: 32760
Yes, that would work.
There is also an alternative syntax where you can set the dimension with the page view call:
ga('send', {
'hitType': 'pageview',
'dimension1' : 'dimensionValue'
});
The important thing is that there must be some kind of interaction event (pageview or event) to transmit the transaction value.
Upvotes: 1