Call us 7am - Midnight 0207 855 2055My.tsoHostshopping_basket0 Item(s): £0.00

keyboard_backspaceBack to the Blog

How to integrate Google Analytics into WordPress

How to integrate Google Analytics into WordPress

Posted 21st January, 2021 by Sarah

So, you’ve set up a WordPress website for your business. Now, you need to know how it’s performing.

For that, you could consider Google Analytics.

This powerful tool gives you an insight into how people are using your site. You can tell where they’re coming from, which pages they’re visiting, how long they are staying for and everything you need to be able to measure the effectiveness of your online presence.

Why you need Google Analytics

There’s a myriad of ways visitors arrive at your site. They may have clicked from a social post or found your site through a simple Google search, for example.

Analytics can give you a definitive answer.

You can also see which internal links visitors follow and which pages they visit. This can give you valuable insight into how people navigate your site.

Is it easy for them to find your product pages, for example, or are they having to hunt around? If the latter is the case, then you have an issue to solve in order to ensure a smoother and shorter customer journey. You wouldn’t know that, without Analytics information.

Analytics can also give you an insight into how well your marketing efforts are working. It can help you determine which approach is bringing the most qualified visitors to your site - by qualified, we mean people who are genuinely in the market to buy from you.

Perhaps it’s your blog posts that are driving the best traffic to your site, or your social media updates, or your pay-per-click advertising – when you know what’s working best, you can do more of it.

In addition, Google Analytics can help you calculate your conversion rates – telling you how many people who arrive through a certain avenue go on to buy your products or services.

You’ll know which traffic sources are most popular and you’ll have an idea who they're popular with. You’ll even be able to tell whether people are using a phone or a computer to find your site and you can, therefore, cater for them accordingly.

Video guide

Below, we talk you through two different ways of adding Google Analytics to your website.

If you’re confident with your coding skills and with the back end of a website, you might want to add the code in, directly. Or, you can go with the simpler method of installing a plugin.

If you choose a plugin, we’d suggest MonsterInsights. It is used in more than two million websites and has excellent support.

WordPress hosting from tsoHost

If you’re thinking of going for a fully-managed WordPress hosting package, you’ll find that our offering is optimised to make your WordPress website or blog as fast, secure and reliable as possible.

If you’re going to all the trouble of driving traffic to your website, you want to ensure that your site is working at its best, when visitors arrive.

tsoHost’s WordPress hosting packages are also packed with perks like a free domain name.

What's more, we're industry favourites for optimised UK WordPress Hosting and we now support more than 600,000 installs. Hit the link below and find out about the difference tsoHost WordPress Hosting can make to your business.

Secure Word Press Hosting Cta

Video Transcript

This journey begins – as so many do – when you sign into Google. Search for ‘Google Analytics’. You’re looking for analytics.google.com. Once there, you can set up for free.

To set up your account, enter an ‘Account Name’. Check through the Data Sharing Settings. For our purposes, we’ll retain all of Google’s recommended settings. So, just click ‘next’. Now, we want to measure the user behaviour on our website, so we select ‘web’.

Your website is your property, so – enter your ‘Property Details’. Put your website name, of course, and your domain. Then, you scroll down the ‘Industry Category’ list and choose the one that’s nearest to your business. After this, you let it know what part of the world you’re in – so you can get your reports at the right time of day.

When you’re done, click ‘Create’.

Take the time to read through the terms and conditions, then accept them. All of them. Also, select your preferences for email communications.

Then, make a note of your ‘Tracking ID’ and copy ’n’ paste your ‘Global Site Tag’. These will come in useful later.

And that’s it. You’ve created your Google Analytics account and set up your website property.

Now, how do you set-up Google Analytics on your website?

The easiest way to do this is to download a plugin. We talked you through how to install a plugin in a previous ‘How To’ video. But, in a nutshell, you go to ‘Plugins’, select ‘Add New’ and then ‘Search’.

Now, the plugin we’ll be using is called ‘MonsterInsights’. When it pops up in your search results, click ‘Install now’. Then, ‘Activate’ it.

MonsterInsights is the number one Google Analytics plugin for WordPress. It’s used on over two million websites. So, it’s good enough for us.

Now, once the plugin is active, a ‘Setup Wizard’ will appear. ‘Launch’ and select the right category for your website. Ours is a ‘Business Website’.

Now, if you’ve paid for the ‘Pro’ version of MonsterInsights, you’ll put your license key in here, but the free ‘Lite’ version is plenty good enough for our purposes.

So, ‘Connect MonsterInsights’.

Then, choose the email account you want to associate with the plugin. Give it permission. Select the profile for your website and ‘Complete Connection’.

Now, check through the ‘Settings’. Again, we’re going to leave these as recommended.

Scroll down to ‘Who Can See Reports’. It’s important to fill this out carefully, if you want specific people in your team to be able to see the Analytics report.

Now, MonsterInsights will offer you some other plugins they produce. Weʼre not interested in those, so we click ‘Save and Continue’. Again, we’re not looking for ‘WPForms’ at this point, so click ‘Skip this Step’.

Awesome, you’re all set. Now, click ‘Finish Setup and Exit Wizard’.

Go to your WordPress Dashboard.

You can see an ‘Overview Report’, a summary of sessions, page views, etc. To see the full report, click ‘Insights’ on the menu to your left.

On the MonsterInsights page, you’ll see the range of results you can measure.

It can take a day to gather the information, so there won’t be any Analytics to look at until it’s had time. Leave it a day, then come back.

And that’s one way to install Google Analytics.

The other way is to do it without using a third party plugin. For this, you’ll need that ‘Global Site Tag’ we suggested you make a copy of, earlier.

Once again, you start by searching for ‘Google Analytics’. Log in to your Analytics account. Select the website youʼre working on. Then, click the ‘Admin’ tab on the left.

In the middle ‘Property’ column, click ‘Tracking Info’. From the dropdown menu, choose ‘Tracking Code’

This gives you your ‘Tracking ID’ and ‘Global Site Tag’, or ‘GTag’. Copy them. Then, switch back to your WordPress Dashboard,

Select ‘Appearance’,

Choose ‘Themes’ from the options.

Once you’re on the ‘Themes’ page, select ‘Theme Editor’ on the left.

You’ll get a ‘Heads up’ warning now, because what you’re doing directly affects the code of your website. As it says, make a copy before you edit anything.

If you’re going to use this method, best practice would be to create a ‘child theme’. Otherwise, when you update your theme, this code will be removed and you’ll have to embed it all again, or your analytics will simply stop working.

Now, go over to the right hand side of the screen and select ‘Theme Header’ from the ‘Theme Files’ menu. Paste the ‘GTag’ code you copied just above the closing tag . Then, click ‘Update’.

Google Analytics is now installed on your website.

To view your Analytics data, you will need to switch back to the Analytics website and go into your account. Again, there won’t be much to see at first, so come back tomorrow.

Categories: WordPress

You may also like:

6 tricks for customising your WordPress website for Halloween
Celebrating 10 years of WooCommerce with 10 reasons to choose the platform for your business
Sale now on: get 25% off Business Hosting
15 examples of amazing WordPress websites
9 things to look for in a WordPress hosting plan
5 key ingredients of a customer-obsessed business website