How To Setup Google Analytics on Your Website
This is a visual step-by-step guide to add Google Analytics to your website.
Google Analytics – analytics service that tracks website traffic and conversion.
The most basic use of Analytics is to track your website traffic. It’ll give you raw, unfiltered (or even fake) data but it’s easy to start and you can at least get a general idea about visitors to your website.
There are more advanced steps to get much more accurate data and to track conversion or sales. They won’t be covered on this page but I’ll provide resources if you want to go more in depth at the end of this step-by-step.
Below are the steps to setup Analytics and add tracking code to your website.
Login to your existing Google/Gmail account or create a new one. You will need it for other services like adding your website to Google Search Console or adding your business to Google My Business directory for it to show up in Google Maps.
To to Google Analytics website and click “Sign Up:”
Next, you need to input the following:
- Account Name (use “Business Name” format) – this is an Analytics account for your whole brand and can track your website(s), app, YouTube channel and other properties.
- Website Name (use “Business Name Website” format).
- Website URL – choose your website protocol (http or https) and paste your website URL.
- Can also add your business category.
And choose email notifications you’d like to receive (I usually opt out from all) and click “Get Tracking ID:”
Accept terms of service:
Analytics account was successfully created.
You will come to Property Settings page:
This is your Tracking ID for your website. Copy tracking code below:
Now you need to add it to your website.
If you’re using platform other than WordPress – paste this code to to the body of your website (before </body> tag) or copy/paste your Tracking ID if they have a specific field to add it.
If you’re using WordPress, go to Appearance -> Editor:
It is better if you use Child Theme but if you’re not sure how to create one and your WordPress theme documentation didn’t include a step-by-step to create a Child Theme – it’s OK. Just don’t update your website theme.
Find “footer.php” file:
Open it and scroll down and find </body> and </html> code:
Make some space before </body> tag and paste your tracking code:
Google Analytics will now start getting data if you did everything correctly.
Back to Google Analytics and click “Admin:”
Google Analytics has 3 levels of organization:
Account (top level) can be used to track multiple properties (2nd level) of the same brand – website, app, YouTube, etc.
Each property has unique views of data.
Standard procedure is to create at least 3 views for each property:
- unfiltered view (all data without any filters)
- master view (useful filtered data)
- testing view (test impact of changes)
You can learn more at Google Analytics Academy.
Don’t experiment changing settings in Analytics unless you know what you’re doing.
If you only want to do the minimum today – just change the name of 1 view you currently have.
Click “View Settings” under your “All Web Site Data” view:
Under basic settings, change View Name to your business URL and add “(unfiltered)” after it:
Click “Home” and understand how it is all structured. You see all 3 levels here:
To test if you added your tracking code properly – open your website in a new tab (and leave it open).
Go to Analytics and click “Reporting” at the top.
Then “Real-Time” -> Overview:
Make sure you have your website opened in a new tab and (if you added tracking code correctly) you should see 1 active use on site:
Options are unlimited here. Analytics is an advanced area of study.
Here are some things you can do to improve your Analytics data:
- add your website to Google Search Console (use this guide) and make that data available in Analytics.
- learn basics of Analytics with Google Analytics Academy.
- understand what to focus on.
- understand Analytics better with these resources.
Any simple steps you know of to make your Analytics data better?
Any questions or feedback?