Tue. Dec 10th, 2019

Host your Website

Read and learn

FatCow Web Hosting $1.00/mo* Trust your web hosting to the #1 web host provider, GoDaddy!

Custom JavaScript Variable within Google Tag Manager (ClientID, Document Title etc)

1 min read


Let us explore how to use the Custom JavaScript Variable in Google Tag Manager accurately. This Variable is often used to extend the functionality of GTM beyond the provided methods of creating Variables. If you know JavaScript, you can easily input an anonymous function which will be executed when the Variable is checked. This allows for a far bigger range of Variables than before.

helpful Links:

Variable JS Template: http://pastebin.com/CAfeE48Y

Course: http://measureschool.com/youtube
more Resources: http://measureschool.com .
RECOMMENDED MEASURE BOOKS: https://kit.com/Measureschool/recommended-measure-books

GEAR WE USED TO PRODUCE THIS VIDEO: https://kit.com/Measureschool/measureschool-youtube-gear

13 thoughts on “Custom JavaScript Variable within Google Tag Manager (ClientID, Document Title etc)

  1. Hi there,
    Very interesting video !
    One question: Once I got the GA user Id in GTM, how could I please export/retreive that ID to my CRM reports or mailchimp lists?
    Thanks a lot.

  2. Hi Julian, thank you very much for this, it is a great help as always.
    I think it would be a good idea if you could do one more tutorial in regards to this GTM feature with some more advanced examples.

  3. can we do some sort of tracking for dynamic outbound links? For example, if you have a landing page with third-party content from CNN News website integrated via iframe. Would this work via the Tag Manager, can the Tag Manager be configured so it captures part of the link which is the main url followed by news category?

  4. Why do I get an object-like result for clientId? Like this: '%252525252525252525252525252525252525252525252525252525252525252525252525252525

  5. Hello Julian! thanks again for course! could you please help to advise how to track which variant user added to cart? i use DuracellTomy plugin for wordpress, but it seems that i need to create a new variable to record Variant value when user clicks AddtoCart. Probably you come across examples in the past?
    Any advice will be truly appreciated! 🙂

  6. Hi Julian! very helpful series of trainings, thanks a lot!
    can you advise how i can create a trigger that would check if textfield contains anything or it is blank?
    thanks a lot!

  7. thanks for a very good tut.
    – When we need to use a custom HTML tag and custom Javascript tag. I confuse them and their purpose in order to use in right thing.
    – For example:
    + I have a case "Sign Up" form which has checkbox "subscribe newsletter"
    + So in this case, I need to use custom JS tag or custom HTML tag

Comments are closed.

Copyright © All rights reserved. | Newsphere by AF themes.