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



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.

πŸ”— LINKS:

http://www.simoahava.com/analytics/macro-magic-google-tag-manager/
http://www.codecademy.com/tracks/javascript
Variable JS Template: http://pastebin.com/CAfeE48Y
πŸŽ“ Measure Masters Subscription: https://measureschool.com/products/measuremasters/

πŸ”€ GTM Copy Paste https://chrome.google.com/webstore/detail/gtm-copy-paste/mhhidgiahbopjapanmbflpkcecpciffa

πŸš€ Hire us: https://measureschool.com/services/

πŸ“š Recommended Measure Books: https://kit.com/Measureschool/recommended-measure-books

πŸ“· Gear we used to produce this video: https://kit.com/Measureschool/measureschool-youtube-gear

πŸ‘ FOLLOW US
Facebook: http://www.facebook.com/measureschool
Twitter: http://www.twitter.com/measureschool
LinkedIn: https://www.linkedin.com/company/measureschool

Original source

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

  • September 3, 2019 at 16:22
    Permalink

    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.
    Regards
    Xavier

  • September 3, 2019 at 16:22
    Permalink

    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.

  • September 3, 2019 at 16:22
    Permalink

    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?

  • September 3, 2019 at 16:22
    Permalink

    Why do I get an object-like result for clientId? Like this: '%252525252525252525252525252525252525252525252525252525252525252525252525252525
    255Bobject%252525252525252525252525252525252525252525252525252525252525252525252
    5252525252520Object%252525252525252525252525252525252525252525252525252525252525
    252525252525252525255D'

  • September 3, 2019 at 16:22
    Permalink

    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! πŸ™‚

  • September 3, 2019 at 16:22
    Permalink

    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!

  • September 3, 2019 at 16:22
    Permalink

    thank you so much sir, have any option to put Adsense code in gtm bcoz my blog is page speed more

  • September 3, 2019 at 16:22
    Permalink

    Hi Julian,

    i'm tracking button "submit chat" on livechat ticket but that button have no class, id,… Can you help me, please

  • September 3, 2019 at 16:22
    Permalink

    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

Leave a Reply