We all have very busy lives so I’m going to make this post nice and short, with screenshots that hopefully will make these universal analytics event set-ups pretty straight forward. But please let me know if you have any questions on any of these event settings 🙂
1- PDF Downloads
OK, let’s start with a very simple event: click on a .pdf document.
- Tag: Universal Analytics, Event Track Type
The .pdf link is used as the event label with the {{element url}} macro, which is created by default in GTM.
- Firing rule:
Tip: you can change the extension in the {{element url}} macro to whatever you need such as use {{element url}} contains .doc, as long as it’s a link.
2- Clicks on Email Addresses
We will use the {{element url}} macro again, but this time we’ll search for “mailto” in the link.
- Tag: Universal Analytics, Event Track Type
- Firing rule:
Tip: Change this to ‘tel:’ to track clicks on phone numbers – obviously you must use the tel: URL scheme to make this work, like this:
<a href= “tel:+6499201740”> Call us</a>
3- Outbound Links
I like to distinguish outbound link to Social networks from the other outbound links. To do that instead of using 2 event tags with 2 different Event Categories (Social pages / Other outbounds), I use a lookup table macro like this:
Then I use this macro as the event category in the event tag.
- Tag: Universal Analytics, Event Track Type
- Firing rule:
4- Form Submission
To track form submission as an event, you can use the Form Submit Listener tag. This tag is one of the Auto-Event Listener tags (Click Listener, Link Click Listener, History listener, etc.). You need to create them first if you want to use them in firing rules for other tags. However this is no longer needed in version 2 of Google Tag Manager. See here for more information on Event Listener and the upcoming changes to GTM.
For the folks using the old interface, here is the Form Submit tag you need to create:
You want this tag to fire only if the form submission is successful (Check Validation box) and on all pages (or at least on pages where you have a form).
- Tag: Universal Analytics, Event Track Type
Below the tag you would typically use for a enquiry/contact form:
- Firing rule:
5- YouTube Videos
This one is a courtesy of Stéphane Hamel from CardinalPath, brilliant.
I’m not going to repeat his great post here but basically his solution consists in creating:
1. a “YouTube Listener” Custom HTML tag
2. a “YouTube is present” Custom JavaScript macro
3. 2 Data Layer Variable macros for the UA event action and category
4. And of course the UA Event YouTube tag
Conclusion
Here you go: 5 event tracking tags, which will hopefully give you more insights on your user behaviour. Google Tag Manager is a very powerful and flexible tool, which can give you access to a whole set of analytics insights while minimising the development work.
What do you think? Any other ideas of user interactions you’d like to track? Please get in contact!