GTM quirk #17: beware the ‘!’

In CSS, using the ‘!’ in Class or Id names is not recommended. Technically it’s an invalid character, and certainly in Google Tag Manager your Triggers based on any CSS element that includes a ‘!’ in its name will not work. You’ll need to escape the ! (‘\!’) to get the trigger to fire.

Read more
Using hidden fields in Google Tag Manager events

There will come a time, trust me, when you’ll need to capture the value of a hidden field to use in the label of an event. Here’s how. A pre-requisite though – the field will need to have an CSS Id to uniquely identify it. First, define a Custom Variable that’s of the type DOM […]

Read more
Tracking changes in form dropdowns using Google Tag Manager.

It’s inevitable that at some point you’ll be asked to report on form dropdown field values/changes in analytics. GTM does make the task doable. Here’s how. 1. Define a *Custom HTML tag* that’ll capture the event: Change the select# to your required dropdown ID. If you’re tracking multiple forms you might also want to change […]

Read more
Why GTM Preview Mode might not work on your site

I was trying to run a Preview of Google Tag Manager for a site I was working on, but for some reason it simply wasn’t showing. Turning to the Console as always when something unexpected happens (or doesn’t happen), I saw an error message about my ‘Content Security Policy directive’ being violated. Basically, a CSP […]

Read more