Install Code To Your Website

To link Google Analytics to our website, we essentially need to add a short snippet of code to every single page on our website. Now, it's no where near as hard as it sounds, so don't panic! However, if you have a custom made website that was made by developers not using a website builder such as Shopify, Wix or WordPress, then I would recommend getting them to add this for you.

If you use WordPress or Wix, you're in luck! There are even easier methods for setting it up, which I'll get onto later, so you can skip down to Method 2 (WordPress) or Method 3 (Wix). 

If you don't have WordPress or Wix, then buckle down because we're about to do some coding! Don't panic though, it's just a simple copy and paste job and I'll walk you through every step of the way!

Method 1 (No WordPress or Wix)

Step 1

To start, we first need to collect the code snippet from our google analytics account.

We can do this by heading from the home page to > Admin Settings > Data Streams > Web

Now, we need to enter the URL of our website & name our data stream (I just use the website name).

Next, select 'Create Stream'.

This should open the 'Web Stream Details'. From here, we can select 'View Tag Instructions' (See below: Highlighted in green)

Now we can select 'install manually' and copy all of the code in the box. It should look something like this:

Step 2

All that's left to do now is to add this code to every single page on our website.

How do we do this you ask? Well, most website's will have a header or footer that appears on every page, so we can just paste the code into the HTML for either of those.

Most website builders will provide access to the HTML editor, but to find this section will be slightly different in each builder.

Anything that mentions 'HTML', 'code', 'source' or something similar will be a good place to start. If you're struggling to find where the HTML editor is, you can google 'How to access the code in XYX Website Builder' and you should find some instructions.

(Shopify)

Once you've found the website code, we'll need to edit the 'header', 'Theme' or 'Global' sections (They all mean the same thing). In these sections you should see <Head> written near the top of the page. 

We need to find the first <head> section and paste our code just below.

You can now hit 'Save' and you've now added Google Analytics! 

Step 3

To validate the changes and ensure that the code has been added successfully, we can visit your website on google.

Next, we need to right click and choose 'View Source'.

Once the source code has loaded, we can hit 'Ctrl + F' (Windows) or 'Command + F' (Mac) and search for <head>.

We should then see our code above the first </head> tag.

Method 2 - WordPress

Step 1

To start, we first need to collect the code snippet from our google analytics account.

We can do this by heading from the home page to > Admin Settings > Data Streams > Web

Now, we need to enter the URL of our website & name our data stream (I use the website name).

Next, select 'Create Stream'.

This should open the 'Web Stream Details'. From here, we can select 'View Tag Instructions' (See below: Highlighted in green).

Now we can select 'install manually' and copy all of the code in the box. It should look something like this:

Step 2

Next, we need to install a WordPress Plugin Called WPcode. 

Here's a step by step guide on how to install a WordPress Plugin.

Once you've installed and activated the plugin, you'll see a page with some code snippet option. 

We need to select the 'Header & Footer' section.

Finally, we need to paste our code at the top of the 'Header' code section, as seen in the above.

That's it! You've now installed google analytics in your WordPress site.

Method 3 - Wix.

To start, we first need to collect the code snippet from our google analytics account.

We can do this by heading from the home page to > Admin Settings > Data Streams > Web

Now, we need to enter the URL of our website & name our data stream (I use the website name).

Next, select 'Create Stream'.

This should open the 'Web Stream Details'.

We now need to copy the measurement ID in the top right hand corner (See below: Highlighted in green).

Step 2

Now that you have your measurement ID, check out this article here on how to add this tracking code to your website: ADD WIX TRACKING CODE.