How To Easily Add Google Analytics To WordPress Website With And Without Plugin

by
on June 22, 2017

Google Analytics helps you to get a better insight of the website. This post helps you to know how to add google analytics to website easily with and without plugin

add-google-analytics-to-website

In the new updates that are going to roll out soon all the Google Analytics, Google AdWords, and Doubleclick all data is going to be integrated for deeper insight of your user behavior and ad performances. In order to integrate Google Analytics

Table Of Contents

General Procedure Before Integrating Google Analytics To Website

Of Course, all of us own a Google account, that is enough to use Google Analytics thanks to Google’s one account to all product structure. If you want a separate account for your business you can create a separate account, for more professional approach use Google G suite.

Experts

Easy One Click Solution: Install G suite and configure it your website, get the Google services needed for your website. Get G Suite Install And Configure Support Service.

Once you setup your Google account sign into the Google Analytics. For each Google Analytics account, you can add up to 50 properties (website)

analytics-accocunt

Once you signed into your account the following screen appears where you can fill in the details about your website or the mobile app. Here in our case we need website so choose website and fill in the details.

new-account

The account name is your profile name for this particular website, give the most applicable one for you. Once you add your website that you want to track select “Get Tracking Id”. In order to track your website, you need the Tracking code. To get that under Tracking info select the Tracking Code.

google-analytics-track-code

Add Google Analytics To Website Without A Plugin

In order to track your website without a plugin, you need to manually add tracking code snippet to each page you need to track just before the /head tag of each page. The javascript tracking code will be like this

<script><script type="text/javascript">

     var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

     document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js <http://google-analytics.com/ga.js>' type='text/javascript'%3E%3C/script%3E"));

</script>

<script type="text/javascript">

     var pageTracker = _gat._getTracker("UA-xxxxxx-x");

     pageTracker._trackPageview();

</script>

In the above code, UA-xxxxxx-x will be your unique tracking Id you get when you open a property in the Google Analytics.

You can also add tracking code to your theme file under the theme header.php. One problem with this method is when you change the theme or update the theme which has major updates this code may vanish. If you want to take a try, use this code in the header.php file using the tag.

<body <?php body_class(); ?>>
 
<script><script type="text/javascript">

     var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

     document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js <http://google-analytics.com/ga.js>' type='text/javascript'%3E%3C/script%3E"));

</script>

<script type="text/javascript">

     var pageTracker = _gat._getTracker("UA-xxxxxx-x");

     pageTracker._trackPageview();

</script>

Add Google Analytics To Website Using A Plugin

Adding the tracking code to each and every page is really a tedious job. For example, our blog gets updated frequently with new content, whenever you publish a post you need to add the tracking code for each post you publish.

Experts

Easy One Click Solution: Integrate Google Analytics to your website in one click. Get Setting Up Google Analytics Support Service.

To make this process more simple especially in CMS systems plugins are used. Some hosting providers who provide website builder also gives an easy way to add Google analytics to website from server side like GoDaddy.

Best Google Analytics WordPress Plugins

google-analyticator-sumome

To add Google analytics to website platform like WordPress has been made very simple with the help of Plugins. All you need to do is to copy and paste the Track ID rest the plugin will take care of the rest. These are the best Google Analytics WordPress plugins with their features.

Google Analyticator By SumoMe

Google analyticator plugin allows you to see your Google Analytics data right inside your WordPress admin panel. Apart from that, it has several widgets for displaying Analytics data in the admin and on your blog.

Features

  • Google Analyticator Has the Following Features:
  • Supports Universal (analytics.js) and traditional analytics (ga.js)
  • Includes a widget that can be used to display visitor stat information on the front-end
  • Supports outbound link tracking of all links on the page, including links not managed by WordPress
  • Supports download link tracking
  • Shortcodes to show off your Google Analytics stats publicly
  • Supports event tracking with outbound links/downloads instead of the old pageview tracking method
  • Supports any advanced tracking code Google provides
  • Installs easily – unlike other plugins, the user doesn’t even have to know their Analytics UID
  • Provides complete control over options; disable any feature if needed
  • Supports localization – get the settings page in your language of choice
  • Ability to hide Google UID dropdown
  • Translations – Polish, Turkish, Dutch and Spanish

Google Analytics for WordPress by MonsterInsights

monster-insights

Google analytics Yoast was acquired by Syed Balkhi who also owns Optinmonster and runs WPBeginner.com. MonsterInsights is the most popular plugin known to add Google Analytics to website. It has both free and pro version. All the basic features are available on the free version itself.

Recommended Reading: 10 Best WordPress Google Plugins to Integrate Google Services in Your Website

Features

  • See real-time stats inside your Google Analytics dashboard.
  • Get better insights with Google Analytics’ universal tracking.
  • Add Google Analytics tracking for WooCommerce and Easy Digital Downloads store.
  • Track your Google Adsense ads with Google Analytics.
  • File Download Tracking
  • Track your outbound link clicks with Google Analytics.
  • See who’s the most popular author with Author tracking.
  • See which blog post and section is the most popular.
  • Track the performance of your custom post types.
  • See how visitors are finding your website to better focus your marketing efforts.

How To Add Google Analytics To Website Using A Plugin

Am going to use Monster Insight to add Google analytics to website. Since Monster Insight is very popular and already has more than 1 million+ active users, it is more recommended.

Step1- Install the Monster Insight Plugin to your WordPress

Step2- At the top, you will get the admin panel notification to confirm your Google Analytics settings

Step3- In the Monster insight settings click the “Authenticate with your Google account”

After clicking this following image dialog box appears to follow the steps prompted and you will add Google analytics to website. At the end a code will be prompted to bridge the Monsterinsight plugins and the Google Analytics, the code is auto generated all you need is to copy and paste the code.

monster-insight-install-wpteamsupport

How To Test Google Analytics Is Working Properly

Finally, we know how to add Google analytics to website, now we need to know whether the analytics is tracking properly.

You can do this easily by installing the Google Tag Assistant plugin from the Chrome store. Tag Assistant lets you record a user journey on your site, and then see a report of all the hits sent during that journey and whether there were any errors associated with sending those hits.

Pro Tip:Google tags are handy to organize the code snippets you use from Google into your website. Check here for more detailed functioning of Google Tag Assistant

After installing the extension to the browser navigate throughout your website as a user. The assistant records the tags triggered and whether it is functioning properly. If there is any error the report will be like this.

google-tag-manager

Let’s Get The Insight

That is all these are the steps you need to add Google analytics to website both using plugin and without using the plugin. Adding analytics code manually to each and every page suits for a raw website built with HTML and PHP, because that is the only way.

Recommended Reading: How To Fix and Customize WordPress Website Maintenance Mode With Ease And Grace

If you build your website on any CMS then its is better to use a plugin for this. It saves time and is also very simple. If you come across any problem during the process let us know in the comment section, we are ready to help. Happy Website!!

Ansif

Ansif is the co-founder and CTO of WP Team Support (WPTS), With his thirst towards web development from the very beginning of his college days he started helping his brother in developing websites and entered in Cyberspace Builder full fledged from 2013.

WordPress SupportAnd Maintenance Services
  • Bill Parlaman

    “ Really great to work with. Listens to my issues and works hard until they get it done perfectly. ”

  • Alex Petrou

    “ Always a pleasure working with WPTS. Their work is fantastic and timely. Maintain our website regularly. ”

  • Thomas Carlson

    “ WP Team Support was very responsive and Increased my website efficiency by 53%. ”

Get Started Now
Feature

Support teams across the world

Feature

Safe & Secure online payment