skip to Main Content
How To Add Google Analytics To WordPress And Where To Paste Google Analytics Code

How to Add Google Analytics to WordPress and Where to Paste Google Analytics Code

How to Add Google Analytics to WordPress and Where to Paste Google Analytics Code

Both business owners running physical stores and website owners that have online businesses have something in common. They both don’t have enough time for everything.

Among the countless tasks every online entrepreneur has, the one that can really make a difference is understanding how people act when they visit your site and where most of the visitors are coming from.

Of course, something like this can be only done by using analytics software. And what better one to use than a free one.

Google Analytics is the most popular free software for WordPress users. Used from more than 22 million users worldwide it’s currently the best solution for learning more about the people visiting your website.

In this detailed tutorial, I am going to show you how to add Google analytics to WordPress and where to paste Google analytics code inside your site.

Let’s begin:


How to Setup Google Analytics on Your Site

Before we add google analytics to WordPress it will be best to first create the actual Analytics account. To do so, just search in Google: google analytics or use this link here: Google analytics : Click Sign In on the top right (it’s free, you only need Google account)> Select Google Analytics:

Where to Paste Google Analytics Code

The next screen will list the 3 main steps for gettings start analyzing your site traffic > Click on Sign In:

Where to Paste Google Analytics Code 1

Add additional information about your account:

Where to Paste Google Analytics Code 2

  1. Google account – this will be your primary account shown inside your dashboard here.
  2. Website name – The name of your site.
  3. Website URL – Add the correct URL of your site.
  4. Industry Category – In which category your site falls?
  5. Reporting Time Zone – Make sure to change the time zone with yours.
  6. Additional Settings – check all the boxes here.
  7. Click on get tracking ID.

The pop-up screen will prompt you to agree with the terms and the services > Click I agree:

Where to Paste Google Analytics Code 3

The new screen will give you a tracking code that needs to be added inside your WordPress installation:

Where to Paste Google Analytics Code 4

Copy the link and access your WordPress admin section.

Where to Paste Google Analytics Code

You now have the google analytics code copied, right?

Access your WordPress admin area and navigate to Appearance > Editor > Theme header (header.php) find where is the </head> section. You need to paste the google analytics code between <?php wp_head(); ?> and </head>, click with the mouse and add one additional space:

Where to Paste Google Analytics Code 5

Paste google analytics code between the two lines like this:

Where to Paste Google Analytics Code 6

Scroll to the button of the page to save the changes.

Ok, you’ve successfully added the google analytics code inside your WordPress. Now is time to add the stats inside your admin area.


Add Google Analytics to WordPress

Using Google analytics will require the installation of a plugin. Access your WordPress admin area, go to Plugins > Add new > Search for the plugin Google Analytics dashboard for WP > Install it:

using google analytics

Activate the plugin after the installation is complete:

using google analytics 1

Inside the installed plugins > Go to Google Analytics dashboard click on settings:

using google analytics 2

Click Authorize plugin:

using google analytics 3

Get access code:

using google analytics 4

The page will ask for permission > Click on Allow:

using google analytics 5

Copy the code you see on this page:

using google analytics 6

Paste the code and click save access code:

using google analytics 7

The plugin authorization was successful message should appear:

using google analytics 8

Now if you go to your Home admin area you will see the dashboard showing  you all the data. From the drop-down menu, you can select different stats: Sessions; organic searches, visitors by countries, bounce rate, pages views and etc.:

using google analytics 9

Keep in mind that it might take a couple of hours or sometimes even a day or two in order some data to show in this dashboard here.


Final Thoughts

Once you add google analytics to WordPress and you start collecting and analyzing the data, make sure to act accordingly. Use the statistic in best possible way. See which posts and pages are getting most of your traffic and try making them even better.  Find out people from which countries are visiting your site and if needed target your site to that country throughout yours google webmaster tools account.

You will find additional information inside your google analytics account. Check it every once in a while to see how your site is performing.

Did you find where to paste google analytics code? Contact me using the comments below if your need further assistance:

Leave a Reply

Your email address will not be published. Required fields are marked *