The Compelling Case for Content Writing Services
If something gave you 67% more leads than your competition, would you do it? Of course, you would. Well, that’s…
DISCLAIMER: This article assumes you already have Google Analytics set up for your website. It is also intended for basic uses of event tracking for the everyday person. If you need additional help with advanced Google Analytics tracking implementation, send us a message and we can work with you directly.
The purpose of this event tracking “how-to” is to simplify the process and make event tracking easy and painless for anyone. Yes, anyone… even if you think the word “code” has something to do with a super-secret encryption message used in the movie National Treasurer. Anyways, this guide will explain Google Analytics event tracking in good ole’ fashioned plain English.
If you already have the basics down, skip to the next section.
For those starting from square one, here are some simple explanations of event tracking and why you should be using it.
I could write a few paragraphs explaining all the information in the Google Developer’s Guide, but this is event tracking made simple… so I will skip all the technical jargon. You can review Google’s guide here if you want to learn more.
Here is a quick reference guide for the elements of HTML code that we will be defining in the next step (bear with me, it’s actually not as bad as it seems).
Universal Analytics (analytics.js)
ga(‘send’, ‘event’, ‘category’, ‘action’, ‘label’, value);
Now that you understand the basics of what event tracking is and why you should be using it… here is where I want to make this easy for you.
What if I told you that there is a more flexible way to implement tracking on your website, that doesn’t involve hard coding every page but follows the same anatomy structure of event tracking that you just read about? To be clear, Google Tag Manager is not a replacement for Google Analytics. Google Tag Manager is simply, as the name suggests, a “tag manager”. It has no reporting capabilities because that is still handled by Google Analytics. Think of tag management as the middle man. Google Tag Manager is a tag management system that includes the same functionality as global site tags and lets you configure and instantly deploy tags on your website or mobile app from an easy-to-use web-based user interface.
Let’s start off with an example of how to set up tracking for a “Contact Us” button on your homepage. You want to track and see how many people are clicking this button.
The trigger tells the tag to fire when the specified event is detected. Every tag must have at least one trigger in order to fire. Let’s name the trigger “Button – Contact Us”.
Since we are tracking clicks, we want to use Click – All Elements.
This indicates when the trigger will fire and sends a signal to Google Analytics that an event is occurring. We are selecting “Some Clicks” because we only want to focus on the contact us button. If we did all clicks, it would track every click on the page.
This is telling the trigger exactly when to fire and send the signal. Let’s set this up as “Click Text – equals – Contact Us”. This will fire this trigger when the text on the button is equal to Contact Us. This ensures that it will not trigger any other button on your page, because it has to specifically say “Contact Us”.
Now, save the trigger.
Now that we have that setup, we must create the tag that corresponds to the trigger. The tag’s job is to send the information to Google Analytics on what event was triggered. Let’s name the tag “GA Event – Contact Us Button”.
Google Analytics: Universal Analytics. (This corresponds to the platform it’s sending information to.) The Track Type will be Event.
The next steps will be similar to the anatomy of event tracking that you previously read.
Once all of that is set up, you will connect the corresponding trigger we just created in the previous step to your tag. If you forget to do it, the tag manager will remind you because every tag needs to be connected to a trigger. Save your tag.
Once you’ve tested your tags and triggers in preview mode and published it in your Google Tag Manager account, you’re all set to set up conversion tracking in Google Analytics! Keep your goals organized by grouping similar events in Google Tag Manager into the same category. Since Google Analytics (UA) limits you to 20 goals per view, instead of creating a separate goal for every contact form event you have on your site, put them all into the same category of “contact”. The events will come through individually in your Google Analytics data because of how you set up each event in GTM, but your goals will be structured in a much more organized way.
And there you have it! That’s how you can easily set up event tracking using Google Tag Manager. Did I forget to mention that GTM is free to use? There are no monthly or yearly fees! Hopefully, you’ve learned something today that you can go forth, improve your website, and increase your goal conversions. Happy tracking!
There are currently 6 responses.
"*" indicates required fields
June 14, 2018
Hi! I have a very pesky site currently in SharePoint 2010.
I’d like to track user engagement with some of our downloadable forms, and the number of plays of our videos.
I’ve no idea where to start! We can’t use Google Tag Manager as it is incompatible with SharePoint 2010.
June 14, 2018
You came to the right place! You can track form downloads and video playbacks using event tracking, as described in this post. You would not be required to have Google tag manager if you use the method above, you will just need to make sure you add the event tracking code in the proper place and based on which version of Google Analytics you are using. If you get stuck and need some additional assistance, feel free to reach out.
November 20, 2014
I have given an example of TestSafe website. Our website also has several pages like this with lot of pdfs and word documents (which can be downloaded), so it is not feasible to do the one shown in example for each and every URL in every page. So how to track word and pdf downloads for all the pages in one go? Is it possible to do this with one script in Master page of Sharepoint? Thanks
November 24, 2014
As far as I know, it needs to be done manually for each URL because the variables could be different for each. I am not a developer though, so there could be a way to write a script that will help with some of the heavy lifting.
November 20, 2014
November 20, 2014
Hi SP, can you send me a link of an example page containing the download links that you are trying to track? I would be happy to take a look and send you specific feedback. You can also feel free to email me at [email protected] with more information if needed.
The code for tracking a Word file download event would be the same as tracking a PDF file as in the examples above. You will need to identify the category, action, label, value (optional) and non-interaction as true or false. Then structure the event tracking code as required by your version of Analytics and insert the code into the the link or image element that will be clicked on to start the download of the document.
I hope this helps!