Harish Mohanan
Harish Mohanan

Reputation: 184

Custom Diamention on google analytics not working

Below is the code that I use to set and id for the 'View' and another as custom diamention in my android app. Both these are implemented at the tracker level, so that with every GA call this these values are also set.

tracker.set("&uid", userId); //for view 
tracker.set("&CustUserID", custID); //for custom dimension

Now the issue is that the tracker set for view works, but for custom dimension its not working. CustUserID is the name of the dimension I have created.

Upvotes: 1

Views: 66

Answers (1)

Matt
Matt

Reputation: 5168

You need to correct your code to properly set the custom dimension with appropriate dimension index. Detailed documentation found here.

tracker.setCustomDimension(4, custId);

Where your custom dimension you created is indexed at 4. But if you insist on using the measurement protocol syntax:

tracker.set('&cd4', custId);

CustUserID is not in the defined parameters so it will not work.

Upvotes: 1

Related Questions