Mr Neuschulz
Mr Neuschulz

Reputation: 11

How to set a custom Dimension in GTM parallel to the UA tracking preset?

i looking forward for a solution to set a custom dimension outside of the UA preset in the Google Tag Manager.

The Problem is that the Data for the dimension is not everywhere available. So i can not set dimension within the preset, i guess.

The usecase: I have a zip code query in a layer to find out if the user is suppliable or not. This information i will send to GA with a custom dimension.

Actually i listening for the div id of the two layer versions which are displayed after the query. Then i set the dimension like below but the UA Tag is then already fired on the page view:

ga('set', 'dimension6', 'Yes');

Thanks for your reply! Hope my english is good enough. ;)

Upvotes: 0

Views: 196

Answers (1)

Eike Pierstorff
Eike Pierstorff

Reputation: 32760

I assume by preset you mean the fields for custom dimensions in the GA tag template. You can use that without problems; if a GTM variable is not set it defaults to "undefined", and undefined values are ignored when you send them in custom dimensions.

Upvotes: 1

Related Questions