There is No Need of Any WordPress Plugin For Enabling Google Analytics Advanced Tracking in WordPress. Here is How You Should Plan Tracking. Advanced Tracking is not required for all because frankly, a small mistake of configuration can give fully wrong data. Secondly you must not pay a single dollar to a wrong person. There is huge difference only on the aspect of asynchronous tracking and traditional tracking snippet. This is one of the basic reason behind AdSense and Google Analytics Data mismatch those who use the old snippet with advanced customization.
Google Analytics Advanced Tracking Basics for WordPress
AdSense data is over 99% correct. As we using inferior language named PHP and hundreds of ways to make WordPress somewhat faster – by using W3TC like Plugin, by using Ngnix Static File serving, by using WordPress Fragment Cache, by using PHP5-FPM Microcache to cover up PHP related problem, there will be always some error in data capture. So, using the simple default Google Analytics asynchronous tracking code is better for those who has not ever read Mean, Median, Mode or exam purpose. Google Analytics Advanced Tracking has lot of different parameters like Events Tracking, Enhanced Link Attribution, Site Search and so on.
Setup for a very basic example of Events can be Outgoing Link Tracking with Google Analytics. Google Tag Manager is another way to understand the way visitors are interacting. Normally, if you are using DoubleClick Ads and asynchronous tracking snippet, you are already capturing lot of extra parameters. analytics.js
JavaScript snippet is the new way to measure how the users interact within our website. analytics.js
JavaScript snippet is similar to the previous tracking code ga.js
, but it offers more flexibility. This is where Google Tag Manager and Google Analytics Meets :
---
1 | https://support.google.com/tagmanager/answer/3281379 |
Google Analytics Advanced Tracking Means Js Plugins
By default, your script is like this :
1 2 3 4 5 6 7 8 9 10 11 12 | <!-- Google Analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXX-Y', 'auto'); ga('send', 'pageview'); </script> <!-- End Google Analytics --> |
You will use Header and Footer like plugin to insert this normal tracking script. Too basic, but there is reason to show the code. Notice this :
1 | function(i,s,o,g,r,a,m) |
We use kind of minified script. The comment tells :
1 2 3 4 5 6 7 | * @param {Window} i The global context object. * @param {Document} s The DOM document object. * @param {string} o Must be 'script'. * @param {string} g URL of the analytics.js script. Inherits protocol from page. * @param {string} r Global name of analytics object. Defaults to 'ga'. * @param {DOMElement?} a Async script tag. * @param {DOMElement?} m First script tag in document. |
Hit callback is a funny function :
1 | https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#hitCallback |
Enhanced link distribution is nothing but adding this :
ga('require', 'linked', 'linkid.js');
before ga('send', 'pageview');
, so that it becomes :
1 2 3 4 5 6 7 8 9 10 11 12 13 | <!-- Google Analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXX-Y', 'auto'); ga('require', 'linkid', 'linkid.js'); ga('send', 'pageview'); </script> <!-- End Google Analytics --> |
Now, if you add Outgoing Link Tracking with Google Analytics method to internal links – it will practically give you wrong data. Because action of the user within the domain is default action, we need to only mark the dom elements. Practically more precise analysis could be done, but Google never tells because some are related to AdSense.
So, actually you need no WordPress Plugin for even quite advanced setup!
Tagged With WordPress Google Analytics jQuery tw