Ahadu Melesse
Ahadu Melesse

Reputation: 67

Google Analytics Multiple Custom Dimension

I am working on Google Analytics chart on my site and in the tracking code I want two add two custom dimension (One is a User ID). I am doing it this way, am I doing it right ? ga('create', 'UA-XXXX', {'userId': spUserId}); ga('set', { 'dimension1': spUserId, 'dimension2': jobAidId }); ga('send', 'pageview');

Upvotes: 2

Views: 1736

Answers (1)

nyuen
nyuen

Reputation: 8907

Yes, that's correct:

ga('set', {'dimensionX': valueX, 'dimensionY': valueY, 'dimensionZ': valueZ});
ga('send','pageview');

You could also send them with other hits too:

ga('set', {'dimensionX': valueX, 'dimensionY': valueY, 'dimensionZ': valueZ});
ga('send','event', 'cat', 'action', 'label');

Upvotes: 1

Related Questions