In this tutorial, I will demonstrate how you can add website to Google Analytics. Before adding a website to Google Analytics, it would be great if you know what Google Analytics is?
What is Google Analytics?
Google Analytics is a free analytics tool through which you can measure your website traffic. It gives you complete insights of user activity on your website with real-time and tangible data. This tool was launched on 14th November 2005 by Google. Now, it is top one analytics tool for online businesses.
Setup Google Analytics account
Firstly, open Google Analytics website to add your website in Google Analytics, and follow the steps:
- If you already have an account on Gmail, then enter you credentials to login into it, OR create an account by pressing Create account.
- Once you sign in, press Start Measuring.
- On the next page, enter Account Details, and press Next.
- Select Web to measure your website and press Next.
- Enter Property Details, and press Create.
- In pop window, accept Google Analytics Terms.
- In new window, unchecked all and save. ALL DONE!
Add Google Analytics code to your website
Once you setup the account for Google Analytics, you need to add tracking code in your website to verify ownership. Copy and paste Global Site Tag (gtag.js) tracking code as the first item into the <HEAD> of every webpage you want to track.
Techniques to add Google Analytics tracking code
Technique 1: Using WordPress Plugin
Step 1: If you have WordPress website, then it will be easy for you to add the tracking code in your website. Install GA Google Analytics plugin to your WordPress dashboard. If you don’t know how to install a plugin in WordPress dashboard then check out our tutorial about How to install a plugin in WordPress.
Once you install plugin, you need to authorize plugin from setting:
- Go to your Installed Plugin, scroll to GA Google Analytics plugin, and click Settings.
- Press Plugin Settings tab to let it fade down:
i) Enter your GA Tracking ID.
ii) After Tracking Method, select “Global Site Tag / gtag.js”
iii) After Tracking Code Location, select “Include tracking code in page head (via wp head)” option.
iv) Copy paste your Global Site Tag (gtag.js) code in Custom Tracker Objects area.
v) Press Save Changes button.
Technique 2: Add Google Analytics code manually to website
The 2nd way is to add GA tracking code in the header section of the website/theme. You can do it by adding this code in your website header file. If you have website on WordPress CMS, login into it, copy Global Site Tag (gtag.js) code from your Google Analytics account, and then follow the steps:
- Mouse hover to Appearance in your left sidebar menu and select Theme Editor from the list.
- On the next page, click Theme Header (header.php) from the right sidebar menu.
- paste your Google Analytics Global Site tag before </head> tag and press Update File.
That’s it! You can visit the Google Analytics website to view reports.
If your website is developed by custom coding, you can add the tracking code through your cPanel OR you can ask to your hosting technical support to do it for you.
How to add Website in Google Search Console.
Let me know in comment section that what kind of website are you going to add in Google Analytics?