This blog post is intended as a very quick and simple guide to explain how you can add the Google Analytics tracking code to your website. It is not intended for advanced coders who might just want to add the code directly to the website files.
Step 1: Locate your Google Analytics code in your Google Analytics account.
Go into your analytics account and navigate to Admin -> properties -> Tracking code. The code to copy and paste into your website is in the website racking section and starts with <script> and ends with </script>
Step 2: Add the tracking code to your website.
Depending on how your website has been built you will need different instructions. I have placed the most common instructions below.
If you have WordPress:
There are several ways to add your tracking code to your WordPress website. A passion of mine is making sure WordPress websites run as fast as possible and that means doing as little as possible with plugins. So, I’m not going to suggest a plugin. In fact, I would stay clear of them. Bite the bullet and learn Google analytics. Some plugins charge you a premium to see the data in your dashboard, data that is free if you just know where to look in Google analytics! I offer analytics coaching so get in touch if you want to learn it in a no fluff, plain English way.
There are three ways I recommend adding the tracking code to your WordPress website – all a without a plugin.
- Use Google Tag manager. Details on how to do this are coming soon!
- Add it in the header of your child theme. You need to directly access your theme files to do this so it needs a little technical skill. Open up the header.php file of your child theme, find the opening <head> tag and place your code just after it.
- Add it directly to your theme if you can. You will need to consult your theme documentation or ask the developer where can you add Google analytics tracking code. I use the Divi theme and the code is placed on the ‘Divi Options -> Integration’ tab where it says ‘Add code to the < head >’
Please note: If you add the code in your theme then you will have to do it again if you ever change themes.
Using Google tag Manager is my preferred method because it keeps your website code much cleaner, it’s easier to find and maintain, there is a slight speed benefit and you don’t need to add the code again if you change themes.
If you have a WIX website:
Follow these instructions https://support.wix.com/en/article/adding-your-google-analytics-code-to-your-site
If you have a Square Space website:
Follow these instructions https://answers.squarespace.com/questions/83857/where-do-i-put-google-analytics-tracking-code
Step 3: Confirm the tracking code is sending data.
Once you have added the code to your site, you need to confirm your analytics dashboard is receiving data.
Go to Admin -> properties -> Tracking code.
Look for the status near the top of the page.
Hopefully you will see a message saying “receiving traffic”. If you do not, click the send test traffic button. If your code is installed correctly you should see 1 active user appear.
If it still isn’t receiving data after sending test traffic verify the code you posted is exactly the same as provided and you haven’t missed out the <script></script> tags.
Once your code installation is verified you will need to set up your analytics. I will shortly have a masterclass to show you how to do this.
Register your interest here and I will notify you when it is available.
SHARING IS CARING
If you have enjoyed this article and found value in it, please consider sharing it with someone who would benefit it. Not only will it help them but it will help me too. Thank you.