Creativa
Contributor III

0101703-HowToSetUpGoogleAnalyticsEventTracking-BlogGraphic-600x300.jpg

If you're interested in keeping tabs on and recording data that Google Analytics
doesn't usually track, you'll want to learn how to set up Google Analytics event tracking.
It's a great way to get more insights!

 

So you've got your website set up, your content calendar is ready to roll, and you've even got Google Analytics tracking those crucial metrics for your business. Great job!

But here comes the million-dollar question: "What's next?"

Now that you've laid the groundwork for your website and business, it's the perfect moment to dive into Google Analytics event tracking. Why? Well, it lets you track and record data that Google Analytics wouldn't usually catch—giving you access to data you wouldn’t be able to measure otherwise. 

There are two ways to set it up:

  1. Manually. This takes a little bit of extra coding know-how.
  2. Google Tag Manager (recommended). This requires little to no coding knowledge.

For this article, we'll use the recommended Google Tag Manager instructions. 

But first...

 

What is Google Analytics event tracking used for?

It helps you keep track of different things visitors do on your website, like clicking buttons, watching videos, or downloading files. These actions are called "Events" by Google.

Think of Events as interactions with special elements on your site, like buttons, videos, images, and more. Google Analytics keeps a record of these interactions so you can see how engaged your visitors are.

For example, let's say you have a video on your website that people can view. With event tracking, Google Analytics can count and show how long people watched your video. 

You can also use event tracking to see things like:

  • How many times have people clicked a button
  • How often users clicked links that take them outside your website
  • How many times have users shared a blog post
  • How users moved their mouse around on a page
  • When people filled out a form but didn't submit it

You get the idea! With event tracking and Google Analytics goals, you can see how well your marketing campaigns are doing. So now that we know what Google Analytics event tracking does, let's check out how it keeps track of all these events.

 

How does it work?

It’s simple. Just add a special code snippet (don’t worry, we’ll help you with this step) to the elements (on your website) that you want to track. This code tells Google Analytics to keep an eye on those elements and record whenever users interact with them.

The event tracking code has four main parts:

  • Category: This is like a name you give to the elements you want to track. For example, you might have categories for videos, buttons, or PDFs.
  • Action: It's the type of interaction you want to record. Think of actions like downloads, video plays, or button clicks.
  • Label (optional): If you want to add extra info about the event you're tracking, you can use a label. For instance, you might use it to note which button users clicked; the video users played, or the title of an ebook they downloaded.
  • Value (optional): This is a number you can give to the tracking element if you want to assign a numerical value.

For example, if you want to track clicks on a "Download PDF" button, you can set up an event with the following parameters:

Category: "Downloads"
Action: "Click"
Label: "PDF"
Value: (Optional, numeric value associated with the event)

All the info collected by the event tracking code is returned to your Google Analytics account. That means it shows up in your GA account as an event report, giving you all the details about how users interacted with those elements.

And there you have it! Now that you know what event tracking is and how it works, let's dive into how to set it up.

 

How to set up event tracking with Google Tag Manager (recommended):

As promised, here’s the more straightforward method to set up event tracking. GTM (Google Tag Manager) is a free tag management system provided by Google.

With GTM, you can send data from your website to other platforms like Facebook Analytics and Google Analytics without needing much backend coding.

It allows you to update and add tags to your Google Analytics code without manually writing backend code, saving you a lot of time in the long run.

For instance, if you want to track the number of PDF downloads, using traditional methods would require changing all download links on your website. But with GTM, you can simply add a new tag to track the downloads.

Let's dive in and learn how to set up GTM to make event tracking simple.

 

Step 1: Set up Google Tag Manager

Create an account on the Google Tag Manager dashboard:

1 GTM - add new account.PNG

 

 

 

 

 

 

 

  1. Type your business name in the Account Name field. 
  2. Select your country
  3. Choose whether or not you want to share data with Google, and click continue.

Next: set up a container:

2 Container - set up.png

 

 

 

 

 

 

 

 

A container is a bucket that contains all of the “macros, rules, and tags” for your website.

  1. Give your container a descriptive name and select the type of content it’ll be associated with (Web, iOS, Android, or AMP).
  2. Click “Create”
  3. Review the Terms of Service, and agree to those terms. 

You’ll then be given the container’s installation code snippet. This is the only piece of code you’ll be pasting into your website’s backend in order to manage your tags.

3 Code snippet.png

 

 

 

 

 

 

 

  1. Copy and paste the two snippets of code onto every page of your website (note: as the instructions say, you’ll need the first one in the header and the second after the opening of the body).

This process is easier by installing and activating the Insert Headers and Footers plugin. This will allow you to add any script to the Header and Footer throughout your entire website.

 

Step 2: Turn on built-in variables

Now, you have to check that GTM's built-in variables are turned on so you can create your tags.

  1. Go to your main GTM dashboard
  2. Click on "Variables" on the sidebar
  3. Click "Configure" on the next page.

4 Configure variables.png

 

 

 

 

 

Next: place a checkmark in the box next to the variables you want to track. 

5 Variables.PNG

 

 

 

 

 

 

 

After selecting all your variables, you can then create your tag.

 

Step 3: Create a tag

Go to your Google Tag Manager dashboard and click the “Add a new tag” button.

6 Create tag - updated.png

 

 

 

 

 

You will be prompted to create your new website tag after clicking the “Add a new tag” button.

Next, you’ll see two options to customize as follows:

  • Configuration: Where the data collected by the tag will go.
  • Triggering: What type of data you want to collect.

7 Tag Configuration.png

 

 

 

 

 

  1. To choose the type of tag you want to create, click the “Tag Configuration button.” 
  2. Choose “Universal Analytics” to create a tag for Google Analytics.

 

8 Universal analytics.png

 

 

 

 

By clicking that option, you can pick what kind of info you want to keep an eye on. Afterward, head to "Google Analytics Settings" and select "New Variable..." from the drop-down menu.

9 New variable.png

 

 

 

 

 

Afterward, you'll be directed to a fresh window where you can type in your Google Analytics tracking ID. This sends your website's info directly to Google Analytics for you to see later.

10 Tracking ID - updated.png

 

 

 

 

Once you've completed this step, navigate to the "Triggering" section to pick the data you intend to share with Google Analytics.

11 Tag Triggering.png

 

 

 

 

 

Similar to the "Configuration" step, click the Triggering button to reach the "Choose a trigger" page. From here, hit "All pages" to send data from every single one of your web pages.

Choose a trigger.png

 

 

 

Your tag will look something like this.

12 Save tag.png

 

 

 

 

 

Lastly, click on the “Save” button, and presto! You've got a fresh Google Tag in action, diligently delivering data to your Google Analytics page, all about your website!

 

Conclusion

Congratulations! on setting up your Google Analytics event tracking! You’ll better understand your website, business, and target audience. This lets you track a campaign's ROI (return on investment). Knowing what your viewers click on helps you meet their needs.

 

Please click the Kudos button if you liked this tutorial and/or found it helpful 💻

Cheers!

 

If you have any questions, please don't hesitate to contact support. Submit a Support Ticket

 

 

Version history
Last update:
‎01-10-2024 06:19 AM
Updated by:
Contributors