How to Install Google Analytics on WordPress?
After installing WordPress and launching your new website, you should set up Google Analytics (GA) to track/measure the behavior of your WordPress website visitors.
First you’ll have to install and set up Google Analytics on WordPress in one of the 3 quick methods.
The step-by-step Google Analytics installation/setup guide include:
- Sign Up or Login to Gmail or Google Account, and Set Up Google Analytics.
- Method 1: Add Google Analytics Tracking Code directly to WordPress Website.
- Method 2: Add Google Analytics through Google Tag Manager (GTM).
- Method 3: Add Google Analytics through WordPress plugin.
- Start Marketing Your WordPress Website and Verify Your Google Analytics Data
200+ Free Traffic Sources - The Complete List
Promote Your Website with Free Traffic
Get the Complete List as a PDF Document
Sign Up or Login to Gmail or Google Account, and Set Up Google Analytics.
To use Google Analytics, you must have a Google account or a Gmail account.
You can use your existing Gmail account to login to Google Analytics.
Or register a new Google account (https://account.google.com/).
Set Up Google Analytics
Now go to Google Analytics (https://analytics.google.com/analytics/web/), and login with your Google account (or Gmail account).
Set up Google Analytics for your website in 3 steps.
- Step 1: Account Setup.
- Step 2: What Do You Want To Measure?
- Step 3: Property Setup
Step 1: Account Setup.
Set up the account by entering a new account name.
For example, the website using Google Analytics is going to be https://www.chinamobileseo.com/, so set the account name to “ChinaMobileSEO.com“.
Under this account, you can create more than one Google Analytics Tracking ID.
Step 2: What Do You Want To Measure?
Select what you want to measure (e.g. Website, Apps). You have 3 choices to measure:
- Apps and Web
For your WordPress website, select Web.
Step 3: Property Setup
You need to provide property details. i.e. A website that you’re measuring/tracking through Google Analytics is called a GA property.
- Enter your website name.
- Enter your website URL.
- Select an industry category for your WordPress website.
- Select a reporting time zone. For example, if you locate in Hong Kong, normally you’ll choose HK time.
Get the Google Analytics Tracking Code.
Get the tracking code from within your Google Analytics account by copying it.
The latest tracking code is “Global Site Tag (gtag.js)”.
The next stage is to add this Google Analytics tracking code (GATC) to your WordPress website.
Method 1: Add Google Analytics Tracking Code directly to WordPress Website.
Google Analytics suggests that the tracking code should added to the head section of your WordPress website.
In your WordPress account, under the left side menu go to “Appearance” and then “Theme Editor”. You’ll be taken to the Theme Editor screen.
The head section HTML code can be found in a WordPress header file which usually is named “header.php“. Find this header file on the right side in the Theme Editor screen.
Now make sure you add the Google Analytics tracking code to the head section, and click “Update File”.
Method 2: Add Google Analytics through Google Tag Manager (GTM).
Go to Google Tag Manager (GTM) (https://tagmanager.google.com/) and login with your Google account.
Create a new Account. Complete the Account Setup by entering your new Account name and country.
Create a new Container. Complete the Container Setup by entering your new Container name.
Google Tag Manager has made 4 options available: Web, iOS, Android, or AMP.
For this case it is for a website, so select Web (for Target Platform).
Agree to the Google Tag Manager terms of service. You’ll have to click the Yes button.
GTM provides you with 2 parts of tracking codes. You will have to:
- Add the first part of the code to the head section of all the web pages of your website.
- Add the second part to the body section of all your web pages.
Your GTM Container has an ID with this format:
Create a tag, and select a tag type. In this case, select Google Analytics: Universal Analytics.
Check “Enable overriding settings in this tag”, and enter your Google Analytics Tracking Code ID in the Tracking ID field.
Previously when you were creating your Google Analytics acount and property, you would have seen your GA ID in this format:
Name your GTM tag, and click Save.
You need a trigger to activate the tag. Create a trigger with Trigger Type “Page View”, and let this trigger fires on all page views. Name the trigger and click Save.
Go back to the previously created Tag, and add the Trigger to it.
Now make sure you add the two parts of the GTM code to the head section and the body section of all the pages of your WordPress website.
Method 3: Add Google Analytics through WordPress plugin.
In your WordPress account, under the left side menu go to “Plugins” and then “Add New”.
Enter “google analytics” as keywords in the search box to find the plugin. Among many results, you will see the “GA Google Analytics” plugin.
Click the “Install Now” button to install the “GA Google Analytics” plugin. Click the “Activate” button to enable it.
Again on the left side menu, now go to “Settings” and then “Google Analytics”.
Under the “Plugin Settings” section of the “GA Google Analytics” plugin, enter your GA ID (of this format: UA-XXXXXXXXX-1), and click “Save Changes”.
Start Marketing Your WordPress Website and Verify Your Google Analytics Data
Market Your WordPress Website
After successfully developing your website using WordPress and installing Google Analytics to track your website visitors’ behavior and the performance, the next immediate step is to get people to visit your new website.
I’ve compiled a list of over 200 free traffic sources where you can get traffic to your website.
Go through the list and pick out a small list of free traffic sources that can be regarded as “the low hanging fruits” i.e. traffic sources that you must place at the top of your priority, simply because you’re able to have them executed quickly.
Verify Data in Google Analytics Reports
You won’t see data showing up in your Google Analytics report right away. But once people started to visit your website, usually within 1-2 hours data will show up.
Rank Your Site on Google's 1st Page - Google's Mobile-first Index ranks web pages based on their mobile version. Optimize your site for mobile to load super fast and display well on all devices.
How to do SEO for YMYL Pages? Websites with YMYL (Your Money Your Life) topics are having their Google organic search ranking strongly affected by the E-A-T ranking factors. E-A-T is Expertise (E), Authority (A), and Trust (T).
Step-by-step guide to install WordPress. Register your domain, select your hosting plan & set up your WordPress website all on Siteground. Install plugins to enhance WordPress SEO & speed.