How to Optimize Google Analytics for WordPress

Google Analytics is an immensely powerful tool that enables its users to gain invaluable insights into the behavior of their website’s visitors. Learning how to optimize Google Analytics for WordPress will let you know how users interact with your site and which goals you are failing to meet, and ultimately enable you to shape a unique marketing strategy for your whole online business.

Despite there not being a single official tool for integrating Google Analytics with WordPress, there are plenty of unofficial plugins which get the job done fantastically well.

This time around we’ll be taking a look at several of these plugins, and an extended peek under the hood of one in particular. Then we’ll guide you through the process of setting goals for your site. Are you ready to unleash the full potential of Google Analytics for WordPress? Let’s find out!

Step 1: Optimizing the Google Analytics by MonsterInsights plugin

Formerly known as Google Analytics for WordPress, this plugin was re-branded as Google Analytics by MonsterInsights after being acquired in 2016 by a team with ties to OptinMonster.

This plugin enables you to track your stats easily with a metrics dashboard, activate demographics and interest reports, track your search result pages, and pretty much everything you’ve come to expect from Google Analytics – right from your WordPress dashboard.

We won’t bore you with installation details or by guiding you through the process of syncing it with Google Analytics – instead, let’s jump right into the optimization process.

Enabling demographic and interest reports

Demographic reports provide you with insights as to who your users are by segmenting them into specific categories according to their age, gender, and parental status.

A screenshot of a demographics report on Google Analytics.

Interest reports, on the other hand, enable you to categorize your audience according to their affinities for specific products, services, or – in our case – keywords.

A screenshot of an interests report by Google Analytics.

To get started gathering this data, head over to your Google Analytics account, find the Reporting tab, then go to Audience >> Demographics >> Overview. There, you’ll see the following screen:

A screenshot showing the option to enable demographic and interest reports on Google Analytics.

Hit the Enable button and we’re all set on this end – now it’s time to turn the feature on within the plugin as well.

Open your WordPress dashboard and locate the Insights tab, then go into its Settings screen. Check the Enable Demographics and Interests Reports for Remarketing and Advertising option as seen below:

A screenshot showing the option to enable reports on MonsterInsights.

Having done that, we’re all set! Do remember that it might take up to 24 hours before there is any data available for you to peruse within these reports, though.

Step 2: Installing complementary plugins

The Google Analytics for MonsterInsights plugin is not all that’s out there as far as third-party improvements for the platform are concerned – in fact, when it comes to learning to optimize Google Analytics for WordPress we’ve got two more suggestions for you right here:

1. Reduce Bounce Rate

The aptly named Reduce Bounce Rate plugin introduces a simple tweak that modifies the method Google Analytics uses to track your bounce rate. By default, Google Analytics will count visitors who fail to engage with your site as ‘bounced’ – and set their time spent inside as zero – even if they spend half an hour reading a sales page and then decide to send you an email.

What Reduce Bounce Rate does is send Google Analytics a bit of data every few seconds which enables it to count those slow-reading individuals as real visitors.

2. Better Google Analytics

Better Google Analytics isn’t so much a complementary plugin as an alternative to Google Analytics by MonsterInsights. It includes many of the same features as the latter while adding a few more to the mix, such as:

  • Adjusting the Google Analytics bounce rate.
  • Tracking user registration and new comments.
  • Forcing your analytics information to transfer over Secure Sockets Layer (SSL).
  • Tracking social media engagement (e.g. Facebook likes and Twitter follows).

If for some reason Google Analytics by MonsterInsights isn’t your cup of tea, give this plugin a chance!

Step 3: Setting goals in Google Analytics

Every website has a goal – be it to sell products, amass users, or promote other services (among many others). Google Analytics enables you to track your goals through its aptly named Goals system, which determines whether the conditions for each goal have been met using parameters set by you.

To find the Goals screen, you need to go to your Admin tab on Google Analytics, then click on the Goals item under the View column:

A screenshot of the Goals option under the Views column.

Once there, you can create new goals by choosing from a template of predetermined ones or creating a custom one. Despite the many templates available, there are only four types of goals:

  1. Reaching a specific URL.
  2. Spending at least X time on a page.
  3. Visiting at least X pages.
  4. Completing a particular action/event (e.g. watching a video).

For each new goal, you must set a specific set of requirements out of the four above. This enables you to create highly specific goals using Google Analytics for WordPress, such as tracking WooCommerce conversions using a destination goal (i.e. reaching a specific URL).

To do this, first, we must click on +New Goal, then set the goal as Custom, specify an informative name and select Destination as its type:

Screenshot showing the process of setting a custom goal.

All that’s left to do now is select the destination itself, and the Thank you page that WooCommerce displays post-checkout is the perfect setting for ours.

Screenshot showing the process of setting a custom URL as a goal.

Insert your post-purchase URL, click Save, and that’s it for your first goal! You could do something very similar with say your email signup confirmation screen (for tracking signups), to track the efficacy of calls to action and landing pages, and so on.


 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:

jQuery("#mc-embedded-subscribe").click(function(){
	_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.

Optimize Google Analytics for WordPress: Conclusion

As is plain to see, if you want to optimize Google Analytics for WordPress, this can be a difficult goal to achieve. Putting Google Analytics to work to its full potential alongside WordPress requires a lot of tweaks and the occasional third-party tool, but the efforts are well worth the reward. If you’ve followed our advice, you’re well on your way to unlocking the full potential of this powerful combination.

Before we part ways, let’s briefly recap the steps we’ve outlined here today on how to optimize Google Analytics for WordPress:

Having trouble integrating Google Analytics for WordPress and making it work exactly like you need it? Feel free to submit any questions in the comments section below!

Original text by Tom Ewer and Karol K.

  • waw

  • Hey Tom,

    No doubt that Google analytics is one of the best tools to track the growth of your website. The plugins mentioned above can really help.
    I like the plugin to check the outbound links and the bounce rate.
    Thanks for sharing the info.
    ~Ravi

    • I think adding the analytics through the plugins is the best way, you will never loose the code when you update the theme. 🙂

  • Your blog post caught my attention actually I using this for almost three years and I’m fully satisfied with this tool and I’m trust this one when it comes to my wordpress.

  • Google Analytics has always been a Great Tool for Website Owns. I use Analytics for all my sites & love it. You can get so much information from the Analytics.

  • Wow… Never know that there are so many Analytics tools that can help improve blogging.

  • very good information for my wordpress.