How to add google analytics to wordpress

How to add google analytics to wordpress

Rate this article

Share this article

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

  1. 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-

  1. Create a google analytics account-https://www.google.com/analytics
    1. Sign up with your Gmail account.add google analytics to wordpress
    2. You will be prompted to this page.add google analytics to wordpress
    3. Choose “website” and enter your website URL detailsadd google analytics to wordpress
    4. Get Google analytics tracking code. Copy this.add google analytics to wordpress
  2. Add Google Analytics to WordPress–
    1. Add the plugin Insert headers and footers
    2. Go to your WordPress dashboard-> Settings-> Insert headers an footers-> add the copied code-> press save.add google analytics to wordpress

That’s it Google analytics has been added to your WordPress site.

 

Method 2: Add Google Analytics with Google Tag Manager

  1. Create a Google Analytics account using the steps mentioned above.
  2. Create a google tag manager account. Check my article on how to add Google tag manager to WordPress.
  3. Install Google tag manager for WordPress plugin. https://wordpress.org/plugins/duracelltomi-google-tag-manager/add google analytics to wordpress
  4. Get your Google tag manager IDadd google analytics to wordpress
  5. Enter your Google tag Manager ID in your WordPress dashboard. (You can access this by going to Settings-> Google tag manager). Press save.add google analytics to wordpress
  6. Get your Google Analytics ID from https://analytics.google.com->Admin->Tracking Info-> Tracking code-> copy your tracking code.add google analytics to wordpress
  7. Go to your Google tag manager account. https://tagmanager.google.com
  8. Click on new tagadd google analytics to wordpress
  9. Click on universal analyticsadd google analytics to wordpress
  10. Enter your tracking ID you copied from google analytics.add google analytics to wordpress
  11. Click fire on all pages.add google analytics to wordpress

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

Search Plugin for WordPress

 

 

Are you showing the right products, to the right shoppers, at the right time? Contact us to know more.
You may also like