How to Easily Use Event Tracking in WordPress with Google Analytics?
Many users got asked for an easy method for event tracking in WordPress. If you are looking for the same, this guide will help you!
MonsterInsights is considered the best Google Analytics WordPress plugin available in the market. You are doing something wrong if you are not using Google Analytics or any tracking system on your website or blog.
For checking how a user behaves on your website, Google Analytics can help you. It’s a free service offered by Google for tracking websites, mobile applications, etc. And also, the GA comes with a lot of features.
And in this article, we will show you how you can enable event tracking in WordPress with some simple steps.
MonsterInsights
As I mentioned earlier, MonsterInsights is far better than the rest of WordPress Google Analytics plugins. The Awesome Motive team created the plugin and developed tools like OptinMonster, WPForms, SeedProd, RafflePress, etc. Plus, MonsterInsights is a freemium product.
You will get a free version of MonsterInsights Lite in the WordPress plugins repository.
As you can see in the above image, the plugin is used on more than 2 million WordPress blogs worldwide. Also, note that the free version plugin only has basic tracking features. You might want to get the premium version if you need to use more advanced tracking features.
You can read our MonsterInsights review to learn more about the plugin and its pricing.
Recommended Read: How To Integrate WPForms With Brevo And Improve Lead Generation?
How To Enable Event Tracking In WordPress?
However, we know what’s MonsterInsights from above. Now, let’s see how we can enable event tracking in WordPress.
Plugin Method
First of all, you need to purchase the premium version of MonsterInsights. With the free version plugin, this method is not going to work. If you plan to do it manually, scroll down to the bottom of this article, and we will share something there.
Thankfully, MonsterInsights comes with a feature called Enhanced Link Attribution. This is what we need for tracking the events on our blog.
You might want to modify your link a little bit in this case.
Usually, a link will look like this:
<a href="https://www.domain.com/">BUY NOW!</a>
In the HTML format.
We need to make some changes to the format. We will add category, action, and label data-variable tags to the HTML format.
Here’s an example.
Example
We have set the Custom Category, Custom Action as Action, and Custom label as the label. And you can change everything according to your liking.
Once you have done editing, save it.
From now on, MonsterInsights will track the link correctly and show everything in your MonsterInsights reports section. You can see it from Insights > Reports > Publisher.
Plus, most of us are using affiliate marketing as one of the monetization methods. It is one of the finest and super-easy ways to make money from a blog. If you would like to track your affiliate links similarly, that’s possible.
You don’t need to track every affiliate link on your blog. For example, let’s say you have a particular landing page on your website promoting an affiliate product.
You could use this feature to check how your page performs and how many link clicks are being generated. Once you have modified the link, you can see the result from your MonsterInsights reports.
As you can see, everything is simple with the MonsterInsights WordPress plugin.
Manual Method
This might not be a beginner-friendly method. We will be using a little JavaScript here. Generally, while you need to add event tracking manually, an onclick parameter will be added to each link.
An example is below.
onclick="__gaTracker('send', 'event', 'category', 'action', 'label', 'value');"
All we need to do is, modify the Category, Action, and Value.
So, the HTML code will look something like this:
<a href="http://domain.com/go" onclick="__gaTracker('send', 'event', 'cta', 'Click', 'Buy button', '0');" >Buy Now</a>
As you can see above, we have changed the Category, Action, and Value to something else. And this can be saved.
Also, while you add a link through the Visual Editor, you won’t be able to add the onclick parameter from there. In that case, you might want to shift it to the Text Editor, where you can see everything in the HTML format.
Then, edit the link you need, and add the onclick parameter.
Once you have done everything, save the post/ page or custom post type. It will be good to go.
And when someone clicks on the link or your CTA button, you can track it from your Google Analytics account.
This is how you can enable event tracking in WordPress using the MonsterInsights WordPress plugin or manually. We will always pick the plugin method to make everything easy. Also, no matter whether you are using Google AMP. MonsterInsights will track those pages, too, correctly without any errors.
Get Started With MonsterInsights
You can get the premium version of the MonsterInsights WordPress plugin below.
$This is an affiliate link
I am sure it will help you take your tracking system to the next level.
We hope you found out how you can enable event tracking in WordPress and enjoyed the read. Please consider sharing this article with your friends and fellow bloggers on social media if you do. This will probably help them with the Google Analytics tracking enhancement.
For more WordPress tutorials, plugin reviews, and theme reviews, feel free to check out our WordPress archive page.
About the Author
Did you find the article useful?
Then pin me to your Pinterest Board, so that more people will find me
(Remember: The more you give to the Universe, the more you will get from the Universe)
So, Pin meEnter your Email Address below and be the FIRST to receive our Blogging Tips.
Reader Interactions
Comments
Leave a Reply
You must be logged in to post a comment.
Dev Patel says
For checking how a user behaves on your website, Google Analytics can help you. It’s a free service offered by Google for tracking websites, mobile applications, etc. And also, the GA comes with a lot of features that could help you in tracking your event in a better way. Thanks for the blog!
BlogHeist says
Hey Dev!
Thanks a lot for appreciating.
We are glad to know that our article was helpful.
Reach us at: https://blogheist.com/contact-us/ for any further queries.