• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Google Analytics Advanced Tracking Basics (for WordPress)

By Abhishek Ghosh October 25, 2014 12:02 am Updated on October 25, 2014

Google Analytics Advanced Tracking Basics (for WordPress)

Advertisement

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.

 
Google Analytics Advanced Tracking Basics for WordPress

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 :

Advertisement

---

Vim
1
https://support.google.com/tagmanager/answer/3281379

 

Google Analytics Advanced Tracking Means Js Plugins

 

By default, your script is like this :

Vim
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 :

Vim
1
function(i,s,o,g,r,a,m)

We use kind of minified script. The comment tells :

Vim
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 :

Vim
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 :

Vim
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
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Google Analytics Advanced Tracking Basics (for WordPress)

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Outgoing Link Tracking with Google Analytics

    Outgoing Link Tracking with Google Analytics is quite easy to setup both with the traditional or the asynchronous code. You can track outgoing certain link.

  • PHP Snippet to Hide AdSense Unit on WordPress 404 Page

    Here is Easy PHP Snippet to Hide AdSense Unit on WordPress 404 Page to Avoid Policy Violation and Decrease False Impression, False Low CTR.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy