You can add Google Analytics to WordPress in two ways: paste your tracking code into the Insert Headers and Footers plugin under Settings, or connect Google Tag Manager using the Google Tag Manager for WordPress plugin and a Universal Analytics tag. First, create a Google Analytics account at google.com/analytics and copy your tracking code.
Do you want to add Google Analytics to WordPress? Google Analytics is a great way to monitor in-depth site metrics. You can monitor site traffic, bounce rates, traffic by geography, source, monitor search queries, etc.
Add google analytics to wordpress
| Method | Plugin | Tools needed | Steps |
|---|---|---|---|
| Method 1 | Insert Headers and Footers | Google Analytics account and tracking code | Paste the code at Settings > Insert headers and footers, then save. |
| Method 2 | Google Tag Manager for WordPress | Google Analytics account, Google Tag Manager account and Tag Manager ID | Enter the Tag Manager ID at Settings > Google tag manager and save. Then create a Universal Analytics tag in Google Tag Manager and set it to fire on all pages. |
Method 1: Add Google Analytics with the Insert Headers and Footers plugin
- Tracking code: the snippet copied from Admin > Tracking Info > Tracking code in Google Analytics.
- Tracking ID: the identifier entered into a Universal Analytics tag in Google Tag Manager.
- Google Tag Manager ID: the container ID entered under Settings > Google tag manager in WordPress.
Here are steps to add google analytics to your wordpress site-
- Create a google analytics account-https://www.google.com/analytics
- Sign up with your Gmail account.

- You will be prompted to this page.

- Choose “website” and enter your website URL details

- Get Google analytics tracking code. Copy this.

- Sign up with your Gmail account.
- Add Google Analytics to WordPress–
- Add the plugin Insert headers and footers
- Go to your WordPress dashboard-> Settings-> Insert headers an footers-> add the copied code-> press save.

That’s it Google analytics has been added to your WordPress site.
Method 2: Add Google Analytics with Google Tag Manager
- Create a Google Analytics account using the steps mentioned above.
- Create a google tag manager account. Check my article on how to add Google tag manager to WordPress.
- Install Google tag manager for WordPress plugin. https://wordpress.org/plugins/duracelltomi-google-tag-manager/

- Get your Google tag manager ID

- Enter your Google tag Manager ID in your WordPress dashboard. (You can access this by going to Settings-> Google tag manager). Press save.

- Get your Google Analytics ID from https://analytics.google.com->Admin->Tracking Info-> Tracking code-> copy your tracking code.

- Go to your Google tag manager account. https://tagmanager.google.com
- Click on new tag

- Click on universal analytics

- Enter your tracking ID you copied from google analytics.

- Click fire on all pages.

That’s it. Now you have added Google Analytics to your WordPress site.


















