Your variables don’t get filled with the information you want to track? With Relative Click Variables you will be able to pull in information relative to the interaction you tracked. n this video, let’s go through the steps setting up a Relative Click Variables
Step by Step:
1. Enable your generic click trigger + Built-In Variables
2. Click on the element
3. Retrieve the latest value of the gtm.element in the Dev Tools with google_tag_manager[“GTM-XXXX”].dataLayer.get(‘gtm.element’)
4. Use the command .parentElement and querySelector to get to your desired output
5. Transfer all that into a Custom JavaScript variable
OUTLINE:
0:00 - Introduction
1:43 - What I Mean by Data "Relative to the Click Element"
3:18 - Prerequisites
4:35 - Pulling Data Elements Using Google Developer Tools
9:27 - Set Up a Custom JavaScript Variable
10:02 - Testing
10:50 - Debugging
13:54 - Summary
🔗 Links
The google_Tag_manager object • 3 ways to use the google_tag_manager ...
🎓 Measure Masters Membership: https://measureschool.com/measure-mas...
❓ Take Our GA4 Quiz: https://measureschool.com/google-anal...
FREE Tag Manager Course: https://measureschool.com/products/fr...
FREE Analytics Course: https://measureschool.com/products/fr...
🔀 GTM Copy Paste - Our Chrome extension https://chrome.google.com/webstore/de...
🚀 Hire us: https://measureschool.com/services/?u...
📚 Recommended Measure Books: https://kit.co/Measureschool/recommen...
📷 Gear we used to produce this video: https://kit.co/Measureschool/measures...
📡 Our Live Streaming Software: https://restream.io/join/YXLM2
👍 FOLLOW US
Facebook: / measureschool
Twitter: / measureschool
LinkedIn: / measureschool