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.
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:
The next screen will list the 3 main steps for gettings start analyzing your site traffic > Click on Sign In:
Add additional information about your account:
- Google account – this will be your primary account shown inside your dashboard here.
- Website name – The name of your site.
- Website URL – Add the correct URL of your site.
- Industry Category – In which category your site falls?
- Reporting Time Zone – Make sure to change the time zone with yours.
- Additional Settings – check all the boxes here.
- Click on get tracking ID.
The pop-up screen will prompt you to agree with the terms and the services > Click I agree:
The new screen will give you a tracking code that needs to be added inside your WordPress installation:
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:
Paste google analytics code between the two lines like this:
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:
Activate the plugin after the installation is complete:
Inside the installed plugins > Go to Google Analytics dashboard click on settings:
Click Authorize plugin:
Get access code:
The page will ask for permission > Click on Allow:
Copy the code you see on this page:
Paste the code and click save access code:
The plugin authorization was successful message should appear:
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.:
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.
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: