Are you looking for an easy way to set up and track Google Analytics custom events? With custom events, you can track extra information that’s not collected by default in Analytics.
Custom events help you get a deeper understanding of how people use and interact with your website. You’ll get more detailed insights into user behavior, like which forms get the most submissions, which videos users click on, and which files they download.
But setting up custom events in Google Analytics can be tricky, especially for beginners. That’s because it requires coding if you try to configure them manually, or you’ll need to complete a complicated setup through Google Tag Manager.
Google Analytics does have some automatic event tracking built in, but the reporting is difficult to configure and the list doesn’t include all the events you want to track, like button clicks.
Thankfully, for WordPress users, there’s a much simpler way to track custom events. Let’s take a look.
What Are Custom Events in Google Analytics?
To understand custom events, you should first know what events are. An event is a specific action taken by a user on your website, like clicking a link, viewing a page, or buying a product. Google Analytics tracks some of these events automatically.
Some other important events that users perform include downloading a file, clicking on a CTA button, clicking on a mobile ad, submitting a form, and playing a video.
Unfortunately, Google Analytics doesn’t track all of these interactions by default. If you want them to be tracked, you’ll need to set them up as custom events.
Simplify Google Analytics Custom Event Tracking
To simplify not only custom event tracking, but ALL event tracking on your WordPress website, just install ExactMetrics.
ExactMetrics is the best premium WordPress analytics plugin. With ExactMetrics, there’s a long list of metrics you can set up and monitor in Google Analytics and your WordPress dashboard, plus a built-in custom event tracking feature.
Our most popular features include:
- Easy ecommerce analytics setup and tracking
- Top outbound and top affiliate link clicks
- GDPR compliance
- Scroll tracking
- Form tracking
- Popular posts or products widget
- Video click tracking
- And more!
With ExactMetrics, all your most important metrics are right there in your WordPress dashboard.
ExactMetrics simplifies the process of tracking custom events by not only tracking a list of the most common events for you but also by providing an easy way to set up your own event tracking on call-to-action clicks, for instance.
To get started with all of the ExactMetrics event tracking features, you’ll want to grab a Pro license now.
How Do Google Analytics Custom Events Work?
Event tracking works by Google Analytics recording different parameters (bits of meaningful text) whenever a user interacts with your content. Those parameters help in identifying what the interaction was, how many people clicked on it, and more.
ExactMetrics tracks custom events by using parameters that you can add to your buttons yourself for easy tracking:
- Event Category – This is the category you want to give to the interaction a user makes like “cta” or “donate-button”. This will appear as the event name in Google Analytics.
- Event Action – Through Action, you can see what type of interaction was made, such as clicking a link. If you don’t indicate an event action, Google Analytics will record the URL of your page here.
- Event Label – You can summarize what the event was about using a name, like if it was a Buy Now button or Download Now button. If you don’t indicate an event label, Google Analytics will record the link text here.
Let’s take a look now at how to set up custom event tracking in WordPress and Google Analytics.
Track Custom Events Using ExactMetrics
Like we said earlier, Google Analytics won’t automatically track user-defined custom events. You need to insert special tracking codes on your website to record your custom events. You may also need to create a custom report to show your events in a usable format.
But ExactMetrics changes all that!
The plugin automatically tracks events for a number of interactions and sets up your site so that you can track your own custom events. You don’t have to manually configure them in Analytics.
Here are some of the events ExactMetrics will track on your WordPress website without any code editing or programming:
- File Downloads
- Add to Cart Clicks
- Outbound Link Clicks
- Affiliate Link Clicks
- Form Conversions
- Video Play and Pause Clicks
- Telephone Number Link Clicks
- Email Link Clicks
If those are the only events you need to track, you can stop after installing and setting up ExactMetrics. That’s all you have to do to track those!
For more on tracking each of those conversions, check out our Ultimate Guide to WordPress Conversion Tracking.
Looking to track other clicks and events? Read on.
How to Track Custom Events in Google Analytics
Now, before we start with the manual method, do note that it requires a very small amount of coding. All you’ll be doing is adding a few bits of extra text to the HTML link that you want to track as a custom click event.
Every link that you want to track can include the event category, action, and label we described earlier. However, if you want to keep it simple, just add a category. The others are optional!
Here’s what your tracked links will need to look like:
<a href=”https://www.yoursite.com/pricing” data-vars-ga-category=”sidebar_buy_now”>Buy Now</a>
See how we added data-vars-ga-category=”category-here” to our link? That’s all you have to add to your links (using the category of your choice in place of “category-here”) in order for clicks on them to be tracked as events.
If your link is on a button image, it would look like this:
<a href=”https://www.yoursite.com/pricing” data-vars-ga-category=”sidebar_buy_now”><img src=”https://www.yoursite.com/wp-content/uploads/2021/05/buy-now-button.png” alt=”buy now button”></a>
If you do want a custom action and label, that would look like this:
<a href=”https://www.yoursite.com/pricing” data-vars-ga-category=”sidebar_buy_now” data-vars-ga-action=”cta_click” data-vars-ga-label=”blue_cta”>Buy Now</a>
With the code ready, you can now insert it on your website, so Google Analytics can start to track your custom events.
How to View Event Data in Google Analytics
To see the stats on your custom events in Google Analytics, you’ll need to create a custom exploration report. If you haven’t made a custom exploration report before, you might want to take a quick look at our tutorial: How to Create Google Analytics Custom Exploration Reports
To start, head to the Explorations tab and create a Blank report:
Now, import the following four dimensions into your report, then click and drag them over to the Rows box:
- Event name
- Link Text
- Link URL
- Page location
Next, import the Event count metric and click and drag it to the Values box:
Now, if you want to filter your report so you’re just seeing the custom event you want to see (like a click), click and drag the Event Name dimension over to the Filters box:
From the dropdown, select “contains” and then type in the event name (the Category) that you chose when you added that parameter to your link in WordPress. Then click Apply.
That’s it! You’ll now have a report showing how many times your button was clicked, the URL the button leads to, and the URL of the page where your button was clicked.
Using the methods in this post, can set up advanced tracking in Analytics and better understand your audience.
We hope you liked our article on how to track Google Analytics custom events. You can also go through our Google Analytics Custom Dimensions: Complete Beginner’s Guide.
Not using ExactMetrics yet? What are you waiting for?
Don’t forget to follow us on Twitter and Facebook to get to know the latest tips and tutorials on Google Analytics.