Last time I wrote short summary about how to start with Google Tag Manager (GTM). Now it’s time to add our first tag to make GTM works for us. Let’s start with Google Analytics tag.
Google Tag Manager allows you to deploy Google Analytics using the Universal Analytics tag or the Classic version of the tag.
What do we need to start?
- Google Tag Manager with new account created (that’s how to do it)
- Google Analytics account with tracking ID (start with Universal Analytics)
- Access to your webpages source code? – not this time – do you remember why we use GTM? – to be independent of the IT department!
Tags, triggers, variables and data layer
It is important to understand the difference between these concepts:
- tags – snippets of code that executes on a page
- triggers – you attach triggers to tags to specify when they should fire
- variables – help define triggers and what data they send
Adding Google Analytics Tag
- choose proper account in GTM and click “Add new tag”
- choose “Google Analytics” >> Continue
- choose “Universal Analytics” >> Continue
- add your Google Analytics tracking ID, and choose Page View track type >> Continue
- now we have to define when Google Analytics tag should be fired – in that case it should be “All pages” – that’s trigger for tag >> Create tag
- choose name for our new tag (it’s up to you – choose Google Analytics or whatever you want) >> Save
- we are almost done here – our first tag is ready for publication with rule (trigger) when it should be fired
- so let’s publish it!
I highly recommend testing new tags before publishing (debug option) but that is subject for new post.
Success – our first tag is online and data in Google Analytics begin to be collected.