How to setup Google Analytics on wordpress

Setup Google Analytics on wordpressBy gathering the information about your site visitors you will come to know how they interact and engage within your site and by understanding that you can further focus on making your site more interesting. As for in wordpress you can monitor your site’s traffic using a popular plugin called Jetpack (site stats) or wp statistics which shows the complete statistics of your blog, but that’s not much effective when compared to Google Analytics.

Google Analytics is a powerful web analytics and reporting tool that effectively gathers your site’s traffic data. Google Analytics provides more detailed report on your site’s traffic rather than just showing the number of page views. Google Analytics is free and we have previously covered about adding Google analytics in Blogger. Here we will see how to setup Google Analytics on wordpress site.

Also read: Google webmaster tools vs Google Analytics – What is the difference

What data does Google Analytics Collect?

Yes! What type of data does Google Analytics gather about your site visitors and what do they track? Google Analytics collects information about your users like who they are (IP address), their time of visit, how long are they staying (bounce rate), what browser they are using, where did they came from (referrals), what do they do in your site, how do they interact with your site etc.

After the Google Analytics setup when you look on to your audience overview the first thing you will see is demographics then system and then mobile. Under demographics it shows of your visitor’s language, country and city in percent per session. Under system it shows of information like user’s browsers, operating system and service provider in percentage. Then for mobile it shows info like their operating system, service provider and the type of screen resolution. As a webmaster all these data will be extremely useful for you to design and develop your site.

istall Google Analytics on wordpress

Other than that you can additionally acquire in-depth data on user’s age, gender, their interests, their behavior (new users, returning users, engagement), user flow etc. By knowing the users behavior and engagement you can focus on increasing the page views and decreasing the bounce rate.

Google Analytics stats graph

Also read: Decreasing bounce rate by best using internal links

Another great feature about Google Analytics is that it shows real time report. Don’t you like to know how many people are currently viewing your site; it’s very interesting to know. It will let you know peoples current location, their traffic sources (referral links), content they are currently viewing, events, conversions etc.

currently viewing pages users

Sorry! Forget to mention that you can setup goals in Google Analytics. Goals will let you measure how often users take or complete specific actions. There are four types of goals such as destination (a specific location loads), duration (sessions that lasts longer), Pages per session (a user viewing number of pages) and event. There are a lot more features to mention about Google Analytics; unfortunately this post is not intended for that. So now we will move on to adding Google Analytics on wordpress with and without using plugin.

Google Analytics goals

Also read: How to share Google webmaster tools and Analytics account with someone

How does Google Analytics track your website?

So how does Google Analytics track all those data about your website? Google Analytics JavaScript code is first installed on your website (which we will show you in this article). When a user arrives to your page, the tracking code is accomplished by his or her browser. Then it gathers all the information about your users such as their OS, browser, screen resolution, timings, location, IP and other settings. Then the code sets some cookies with basic info on user’s PC. So when he or she revisits your website again the cookie will determine them as a returning visitor.

You can know more about Google Analytics tracking code here.

Sign up for Google Analytics account

Step 1: First all you need to do is go to Google Analytics and  sign up for a new account. You can sign up for an Analytics account using your existing Google account.

Analytics account sign up page

Step 2: After signing in you will be taken to next page where you have to setup your new account. Which one would you like to track? website or mobile, since this tutorial is for website choose website.

Setup Google Analytics for wordpress

Step 3: Next you have to setup your account and property by entering all the necessary fields. With single account you can manage multiple tracking ID’s that is you can track multiple sites that you own. So choose an account name, website name, website URL, Industry Category and reporting time zone. When everything is done click on get tracking ID at the bottom and then agree to Google analytics terms.

setup Google Analytics on wordpress

Your Google Analytics account is complete, now you will be provided with a Google Analytics tracking ID and tracking code. Just keep the page open because you have to add the tracking code into your website.

installing Analytics tracking code in wordpress

How to setup Google Analytics on wordpress without plugins

Installing Google Analytics on wordpress is very simple as it just takes a minute to accomplish. All you have to do is add the tracking code in to your wordpress theme, but note that Google Analytics can be installed only on self-hosted wordpress sites and not on sites. Follow these steps. Login to your wordpress site, go to appearance menu in dashboard and then select editor. Now towards your right hand side you will see the template files. Just open header.php file and then paste the tracking code just above the </head> tag, save the file and that’s it.

adding google analytics tracking code

You have installed Google Analytics on your wordpress site with no hassle. Now go to the Google Analytics tab that you have left open and check for the tracking status. Or in case if you have closed the window then open Google Analytics, click on admin at the top. Now under property settings choose tracking info and open tracking code. Now you should see a status like this which says Status: Receiving data. Just wait for 12 to 24 hours for Analytics to show your site tracking info

Installing Google Analytics on wordpress using plugin

The above mentioned is simple manual method that just tracks all your site pages, but with that you can’t obtain some powerful features. Google Analytics for wordpress plugin will let you to quickly and easily enable analytics on your site and moreover you can track outbound clicks and downloads. Also you can set custom variables for author, logged in users, single category, multiple category, tags etc. In case if you don’t like to track logged in users on your site then you can handle it using this plugin.

Hope this article helped you to setup Google Analytics on wordpress. Do you find Google Analytics useful? Have you installed the Google Analytics code manually or you have you installed Google Analytics for wordpress plugin? Have you ever used Google Analytics in the past in any of your sites? Please let us know all those in comments below.