Google Analytics integration to WordPress
Google Analytics is a must-have tool to have insights into how users are interacting with your website or application. It is used to track various website activities such as no of users, no of sessions, page views, session duration, page per session, bounce rate, etc. You can also track the real-time activity of the users. Along with these data, it also gives you geographical, technical, demographics, interest, and behavioural data of the website user. Various other platforms of Google can also be integrated into it to have one-stop analytics of their performance.
The integration of Google Analytics to the WordPress website can be done in two ways.
- Integration with a plugin – With just a few clicks and you would be able to install, activate and set up google analytics on your WordPress website. Once the set-up is complete, with the free version you would be able to view the basic insight into the WordPress dashboard, but if you want to track some advanced data e-commerce, affiliate program, etc. you have to switch to their paid plans.
- Integration without a plugin – If you are tight on your budget and still want to track some advanced useful insights for your business, there is another way out where you will have to copy and paste a few code lines to the website for each type of tracking you want. It is always advisable to do the integration using the codes, especially if you are new in the digital marketing field, as you will learn the basics of integration.
So, let us see step by step process of integrating Google Analytics into your WordPress website using codes.
Step by step guide – Google Analytics to WordPress
Step 1 – Sign in to Google Analytics
- Go to the Google Analytics website. Click here to visit.
- Sign in using Gmail / Google account. {If you do not have an account you can click here and learn how to create it.}
- Once you have signed in, you will find a similar dashboard as below.
Step 2 – Create an Account and set up a property
- Click on Admin on the bottom right of the dashboard.
- In the Account, column click on to
create a new account. [Note: In one analytics account you can create a maximum of 100 accounts]
- Type your desired account name and click on Next.
- Now select one from the three given options, what do you want to measure? Web, Apps, or Apps and Web
- Enter the website name and URL for which you want to set up analytics. From the drop-down menu of Industry Category, select the relevant category for your website. Also, select your time zone and click on Create.
- Google Analytics Terms of Service Agreement will pop up. Select your country and click on the checkbox and accept the agreement.
- At this step, you have successfully created a property in Google Analytics and generated a unique code snippet.
Step 3 – Add tracking code to the header
- Once the code is generated, you need to paste this code into the header section of your website.
- Visit the admin panel of your WordPress website and on the left side menu you will find the ‘Appearance’, under it there will be a sub-menu called ‘theme editor’, click on it.
- You will be redirected to the theme editor window. On the right side of this window, you will find ‘header.php’ click on it.
- In this editing window, you have to paste the code which you got from Google Analytics.
- Paste the code just below <head> and click on Update File.
- Once the code is updated you will see a message ‘File edited successfully’.
- This indicates you have successfully integrated Google Analytics into your WordPress website.
Step 4 – Checking Google Analytics integration
- After Google Analytics integration, you should be able to view different kinds of data about user behaviour on the website.
- Go to the dashboard of Google Analytics and simultaneously open your website in a new tab.
- If the integration is successful you should be able to see Active Users right now like 1.
- This shows that your Google Analytics has started receiving data from your website and now you can view different types of data in it.
Key facts
- In one analytics account, you can create a maximum of 100 accounts.
- Under one account you can have a maximum of 50 properties.
- Under one property you can have a maximum of 25 views.
Do you have any clarification about the topic? Let me know in the comments below.
And don’t forget to subscribe to our newsletter to join the tribe of marketers & successful digital marketers.
Share & Care for your friends & peers.

