Set up Google Analytics for a website


Copied from Greg’s notes, 17/12/2018

Add the site map code as per these instructions:

Add the website as a container to Google Tag Manager:

To the right of KB Software click the 3 dots and select Create Container

Add the site name:

Add the code to each page as requested

git push the amended code

You now need to add the Google Analytics (Universal) tag

First you need the Tracking ID from Google Analytics:

Add the site by clicking Create new Property under the Properties column, from the Property section pull down menu

Fill out the details and click Get Tracking ID

Copy and paste the Tracking ID into the Tag Manager

Track Type - Page View; Fire on - All Pages

In GA don’t forget to publish the changes

Deploy the amended pages to the site

In Webmaster Tools (Search Console):

Add the site as a property and when asked verify the account against the Tag Manager account Click continue

Under Crawl first: - select Fetch as Google and then Submit - Crawl this URL and its direct links - select Sitemaps and add a site map - - run test site map - check all pages submitted - If all Ok submit the site map and refresh the page

You should receive an email ref: Improve the search presence of

Follow instructions 1 - 4

  • In 1 add a property for,, and - verify, set up a site map and do a fetch for each

  • In 2 select prefer www. for each property - Tools (right hand cog)/site settings

  • In 4 add another user for each url variation, full rights - Tools (right hand cog)/site settings/Users and Property Owners