57
Views
1
Comments
[Google Tag Manager] Tagging Screens with div ids vs css classes
Question
google-tag-manager
Web icon
Forge asset by Hanno

Hey guys,

I have been trying these last days to tag different screens (with events on tag manager) in order to create a conversion funnel in Analytics and pass data to Data Studio. Notice that URL stays the same throughout the journey

I have been noticing when creating a trigger for each specific page/screen,  divs ids are dynamic, which makes it impossible to fire the triggers / tags on gtm and thus unable to create a proper conversion funnel 


Example: 

Simulation 1 Day 1:

div id contains:Theme_wt18_block_wtMainContent_wt7_WebPatterns_wt82_block_wtTitle


Simulation 2 day 2:

div id contains:Theme_wt16_block_wtMainContent_wt5_WebPatterns_wt82_block_wtTitle


Other option would involved to use css classes, but again, due to code restrictions - the css class -CardSimple Card  is the same in every screen/step.


DOM Title (Page) also doesnt work (with copy selector)


NOTE: URL is the same throughout the journey, so my approach cannot go on that way either


Has any of you encountered such a challeging implementation? Any tips?

2020-03-23 19-26-24
Sydney Lai

For your container divs, ensure that your Input Parameters are created and matched up with your divs in the JS script. Also remember to create a container using the widget. With the Google Tag Manager are you using JS or Python? 

Can you share a screenshot of the code error you are experiencing. I'm assuming you're in Reactive Web? 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.