Skip to main content

How to Optimize Google Analytics for WordPress

 Editor’s update: 

 Analytics goals on steroids … here’s how we optimize Google Analytics for WordPress at CodeinWP: 

Those Google Analytics goals can be really powerful at times. For instance, and from our personal experience, we’ve been using them to track things like: all outbound clicks on the blog, clicks on the subscribe button in our newsletter forms, and clicks on certain outbound affiliate links.

Let’s get a bit more in-depth here, starting with:

Step 4: Tracking outbound clicks

In case you’re not familiar, measuring/tracking clicks on outbound links is a tough thing to do in Google Analytics. Unfortunately, there isn’t just a simple “track outbound clicks” button in the interface anywhere. And Google itself isn’t that helpful in that matter either.

I mean, if you google anything along the lines of “how to track outbound clicks with Google Analytics” you’ll come across countless GA docs entries, plus independent tutorials. Out of which none are helpful, nor easy to grasp.

However, we’ve found a way to get this done with little to no setup … but it does involve using an outdated plugin. So if you want to emulate the method, you know the risks. The plugin is this:

Just like the name suggests, it tracks everything. Or, more specifically:

Optimize Google Analytics for WordPress: tracking everything

The mode of operation of this plugin is simple. After you install and activate it, it will set up some Events that will then be reported in your Analytics panel.

For example, here’s what it looks like for us:

events in GA

The above is what we see in Google Analytics’s Behavior / Events / Overview and then the “Event Action” section. Most of these events have been created by the plugin. Their sole presence already gives you some insight into how people use your site, but you can go further.

The Event Actions column that you can see on the right are actual names of specific Event Actions. Sounds redundant but please bear with me. Basically, what this means is that you can take those names and then build specific analytics goals using them.

So, for example, you can see that there’s an action called “Outbound” there. This event gets triggered whenever someone clicks on an outbound link.

Now, let’s go to Google Analytics’s Admin tab / Goals and add a simple new goal using that specific event. The only thing you need to do in order to turn that event into a goal is pick “Event” as the goal type and then put “Outbound” in the “Action” field. Like so:

goal setting in GA

This will take that Event Action called “Outbound” and tie it together with a new site goal. You can call that goal whatever you like, we just named it “Click outbound” for clarity.

With that, you can now go to basically any Google Analytics report and add a goal column to it. The way we’re using it, for example, is to track outbound clicks on our theme list posts. Those posts are an important part of our affiliate revenue, so we want to know how effective they are at getting people to click on the listings.

Here’s a screenshot:

goals on landing pages

We can sort this list by anything … conversion value, conversion rate, etc.

This gives us massive value. For example, we can compare the conversion rates on one theme list vs the other, and then reverse engineer why one of them performs better… Maybe the themes are better, maybe the descriptions are better, maybe the screenshots are better. Whatever it might be, it gives us solid grounds for performing further split tests.

This sort of thinking is basically what got us to the point where our best post – for Dec 2016 – converts at 43.52% (you can see it in the screenshot above). In comparison, the AdSense-friendly themes list isn’t as effective … a lot of room for improvement there:

adsense themes list

But without that outbound click tracking, we wouldn’t even know what needs to be worked on. I really encourage you to enable this on your site too. It really is a great step to take if you want to optimize Google Analytics for WordPress!

Step 5: Tracking subscriptions

Okay, while you can (and should!) track subscriptions through your email delivery service (MailChimp, SendinBlue, etc.), it’s also a good practice to track things internally within your own site.

But the problem, again, is that Google Analytics doesn’t let you do that easily … probably since it’s another kind of an outbound click.

So this we’ve set up using events and goals again, but this time without a plugin to handle the part automatically. I mean, I’m sure there’s some cool plugin that can do that, but since the solution is relatively simple – just a piece of code – we’ve decided to implement this manually.

Without further ado, we have this in the footer.php file of our blog theme:

	_gaq.push(['_trackEvent', 'Subscribe', 'Subscribed', '<?php the_permalink();?>']);
	window._tfa = window._tfa || [];
	_tfa.push({notify:"action", name: 'conversion'});

jQuery(".mc-field-group .button").click(function(){
	_gaq.push(['_trackEvent', 'Subscribe', 'Subscribed', '<?php the_permalink();?>']);
	window._tfa = window._tfa || [];
	_tfa.push({notify:"action", name: 'conversion'});

What it basically does is it just triggers a new action in Google Analytics whenever someone submits our email subscription form. We’re using jQuery for simplicity of calling the function, but it can be done with raw JS as well.

Simply speaking, the code above just sets an event: the category “Subscribe” and the action “Subscribed”.

You can then take this action and use it when creating a new goal – just like we did for the outbound clicks. So we have:

goal settings

Having this goal in place, gives us the possibility to, again, include it in Google Analytics report pages.

For example, if I sort the landing pages report by the conversion rate of that subscription goal, I see that this is basically the most effective post we have (for Dec 2016):

stats on subscription

In the end, I have a feeling that we’re only scratching the surface here, and that a lot more cool stuff can be found when doing experiments like these.

Personally, I have a love/hate relationship with Google Analytics. On the one hand, I hate the UI. But on the other, the possibilities never cease to amaze me.

This article was first published here

WordPress Design, WordPress Development, cPanel Hosting, Web Design, Web Development, Graphic Design, Mobile Development, Search Engine Optimization (SEO) and more.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.