Create Custom dimension based on Event in GTM - google-analytics

We already set up and event for an interaction. However, I wish this event to be captured as session level in Google Analytics. I'm wondering how I can create utilise these event variables in GTM to create a custom dimension.

You have to create before the custom dimension in Google Analytics, then via GTM you can send the information value in that custom dimension index with Google Analytics tag.

Related

Custom Dimension set in GTM page view but not visible in Analytics

I've created a view in Analytics that filters based on dim1 being "true". For context, the trigger in GTM fires when the window is loaded since the dimension value is being set by a custom JS variable that needs the page to finish loading.
In tag manager assistant I receive no errors and I can see that my custom dimension is set but it doesn't show in Analytics when I filter based on the value.
I read elsewhere that sometimes custom dimensions can take a day in Analytics to show. It's been a couple of days though and I am at a loss. What else could I be doing wrong?

Push data to dataLayer and send it to Google Analytics at the same time in Google Tag Manager

I have a complicated issue with GTM, dataLayer and GA.
My setup is:
GA tag is triggered in PageView with Enhanced Ecommerce enabled by using dataLayer
A Custom HTML tag which pushes an item to dataLayer, and it's configured to run just before the GA tag (by using tag sequencing)
Problem is; GA is not including dataLayer changes made by custom Tag even if it's fired after Custom tag.
I noticed, dataLayer.push(...) creates a new GTM event named message.
How can I handle this, GA pageview tag must have the final dataLayer.
tHanks
The datalayer is not re-evaluated in a tag sequence. However you can manipulate the dataLayer directly.
First you need to make sure that the built-in "Container ID" variable is active (or you pass in the ID manually).
Then you get a reference to your GTM instance and call a dataLayer.set with a key and value:
var gtm = google_tag_manager[{{Container ID}}];
gtm.dataLayer.set('someKey',"someValue")
Unlike a dataLayer.push this will be available in the next step in the sequence.

Funnel Setup in Google Analytic through Virtual pageview tag in GTM

I need help in creating a Goal with funnel into a Google Analytics for New Registrations using virtual pageview tag on GTM.
I am not sure what trigger should be use for this tag? Tag is here:
Can anyone help/guide me to setup a trigger?
You will need to push your own custom event on the dataLayer every time a "virtual" page is shown. You could do this as follows:
dataLayer.push({'event' : 'virtualPageview', 'virtualPageName' : 'virtual/registration/complete'});
You would then create a GTM trigger of type Custom Event and the name of the event would be virtualPageview. This will cause your Google Analytics page view tracking tag to fire every time a virtual page is shown. You would also need to pass the value of the virtualName dataLayer key to the GA page view tag. You can do this using the "Fields to Set" section of the tag configuration as follows:
. The Virtual Page Name variable would be defined as follows:
Then, when defining your goal funnel in Google Analytics, you would enter some/virtual/page/name as the funnel step as follows:

Jwplayer Video tracking using GTM

First of all I am new to GTM. I am trying to implement GTM video tracking on one of our site which is using JW player.
I have followed couple of articles as follows:
https://www.thyngster.com/jwplayer-video-tracking-using-google-tag-manager/
In the above one I was clueless what to do after putting the tag code as I couldn't find how to trigger that.
I also followed this link, but it didn't work either:
http://ecommppc.com/2014/11/30/track-jw-player-videos-on-gtm/
I believe I know what is going on. The code/tag, trigger, and variable he has set up in the tutorial is only what pushes the information to the dataLayer itself. The final step would be to add another variable, a tag to capture it, and a trigger to send it.
The variable you need is the dataLayer variable (Available in GTM under Variables > User Defined Variables > New > Data Layer Variable). You then give it the name of the variable in the dataLayer you want it to capture. Specifically, any of the variables in the dataLayer.push action (i.e. video_url, duration, etc).
The trigger to use in this case is the Custom Event trigger. This trigger will specifically wait for an object to be pushed to the dataLayer with the "event" variable in it. In this case, you need a trigger to wait for an event with the name "video". You can also add filters, i.e. this trigger will only fire on specific URLs, or when other conditions are true.
Finally, you need another GA Universal Analytics tag, set up to track events i.e. Track Type: Event. In this tag, set the trigger to the Custom Event trigger you made earlier, and then click into "Configure Tag". Under "More Settings", click "Add Custom Dimension". Make sure the index you are using to send it to Google Analytics is not in use in your property already; other than that it doesn't matter what index you choose. Finally, add the variable name in the "Dimension Value" field in this format: {{video_url}}. Instead of "video_url", include the name of the dataLayer Variable you created earlier.
This should get GTM to grab the variable out of the dataLayer and push it to Google Analytics every time that "event" variable is seen in the dataLayer object.
Hope that helps!

Custom variable values not passing from Google Tag Manager to Google Analytics

I have set up Google Tag Manager and 2 data layer variables: one for tracking userid, to be passed to Google Analytics for synchronizing user sessions, and one to track visitor type.
Both variables are assigned values as expected when previewing Google Tag Manager while using Universal Analytics Tag. The UA tag is configured to fire on Window Load (gtm.load) on all pages but when checking in Analytics, no custom variables are being shown under Audience Reports nor any user id specific synch (this is for a new view) is happening. I have tried firing the UA tag on dom ready and page view as well, but no change in result.
My visitorType variable is mapped to corresponding custom dimension index in Analytics, the custom dimension is in active state in GA . The userid has been defined as Field to Set in Tag Manager and value assigned to data layer value. My Google Analytics has userid views enables and I created a new view to be able to see the analytics for user id.
http://i.stack.imgur.com/WDCo3.png
I guess you should first create a dataLayer variable in GTM to tell GTM that the dataLayer variables you are pushing should be mapped with {{uid}} and {{visitorType}} displayed in your IMG.
Example with "uid" :
in the container, go to Variables >> dataLayer Variables
In the Variable name, you should use uid (as mentionned in the IMG), and in the Data Layer Variable Name, you should use exactly the name of the variable pushed into the dataLayer.

Resources