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.
Method 1: Using Insert headers and footers plugin.
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 .
- 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.
Thats it Google analytics has been added to your wordpress site.
Method 2- Using google tag manager plugin.
- Create 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 you 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.
Thats it. Now you have added Google analytics to your wordpress site.