This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Event Tracking is a powerful feature in Google Analytics that lets you apply custom event tracking on any elements or parts of your web page. For example, you can track the number of clicks on your logo, the number of clicks on your “buy now” button, and so on. This guide will walk you through the process of setting up and using Event Tracking on your WordPress site.
How to Install Google Analytics Tracking Code on a WordPress Site
If you have already installed the Google Analytics tracking code, you can skip this step. However, for those who haven’t, we’ll show you an easy way to do it using a WordPress plugin. Follow these steps to install the Google Analytics code:
1. Install and activate the Google Analytics plugin for WordPress.
2. Navigate to the plugin settings and paste your Google Analytics code as shown in the screenshot below:
How to Apply Custom Event Tracking for Google Analytics
Now it’s time to apply custom tracking to elements on your site. First, decide which elements you want to track. You will need to add an extra class to these elements. The class nomenclature should be as follows:
track_category_action – Here, “category” is the Event Category, and “action” is the Event Action. Take a look at the image below to understand this better:
Custom Event Tracking Examples
The following examples will help you understand how to use this plugin and its functionality. For any questions, feel free to post a reply below.
Here, Event Category is logo and Event Action is clicks.
Here, Event Category is advertisement and Event Action is clicks.
Here, Event Category is buynow and Event Action is clicks.
Here, Event Category is form and Event Action is submit.
Though you may decide on appropriate Event Category and Event Action titles as per your needs, if you’re using this plugin and don’t understand how to track an element, you may contact us and we’ll apply that for you.
Premium Plugins Bundle
Explore the latest in WordPress
Trying to stay on top of it all? Get the best tools, resources and inspiration sent to your inbox every Wednesday.