11TH FEBRUARY 2015 / WEB ANALYTICS

How does the Universal Analytics snippet work

(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-123123123', 'auto'); ga('send', 'pageview'); The first thing that may attract your attention is the function parameters,…

8TH FEBRUARY 2015 / WEB ANALYTICS

Pushing data to the right Google Tag Manager dataLayer namespace

It may happen that the site we're tracking is using a custom dataLayer name, or that it's using more than one Google Tag Manager accounts at the same time and therefore (it should) using 2 different dataLayer namespaces.  Most of people just push the info to window.dataLayer variable, but it could be window.myOwnDataLayerNS . So we'd need to adapt our dataLayer pushes to that variable name. So we're going to setup a Macro that is going to take…

12TH JANUARY 2015 / WEB ANALYTICS

Blocking your tags firing from your own IPs with Google Tag Manager

The subject about how to exclude your own visits from GA has been commented before loads of times, most of time filters are used to keep out our own visits from Google Analytics , but some other tools may not have the possibility to filter out our own visits. This is why we're going to use Google Tag Manager to block all our tracking pixels, conversions pixels, custom tags, or whatever tag type we want. We're going to lay on a Lookup Table type macro…

28TH DECEMBER 2014 / WEB ANALYTICS

Tracking the browser orientation status and changes

Last day we were talking about how to measure if our site was showing a responsive layout to our users, and today we're going to expand that tracking post with orientation tracking for our sites. We could use the Media Queries to match the orientation, but as this is not much standard we're going to use the window.orientation value and the viewPort Width and Height values to guess the current page orientation and pass that info to Google Analytics and…

26TH DECEMBER 2014 / WEB ANALYTICS

Tracking a responsive site and the media queries changes

Every day more sites choose to use a responsive designs for their new sites, making it somekind difficult to track what version of our page is being showed to the user (as all we may now, browser detection is not perfect at all, most of them are based on the User Agent that can be easily faked). This post will try to show you the different ways to track if user's are viewing a responsive layout or not, and using the Google Analytics Event Tracking…

24TH DECEMBER 2014 / WEB ANALYTICS

Tracking fragments based navigation websites with GTM the right way

We're going to learn how to track those websites where the navigation is based on Ajax, ie: no pages reloads with Google Tag Manager.  As you may know a full page reload is needed in order to have Google Analytics tracking your pageviews, but those sites like the ones based on AngularJS are not reloading the page just the current page content, so this new pages won't be tracked by our Analytics tools, or even catched by our conversion pixels.…

23RD NOVEMBER 2014 / WEB ANALYTICS

Google using ISPs to cache Google Analytics endpoint

I don't really know if this is happening users using different ISP's but starting from today I've noticed that all my requests to www.google-analytics.com were being served from a not usual but familiar IP address range, and the response time was just 9ms. Hey just a great improvement from the 42ms of average I'm usually getting from Google Analytics servers. [email protected]:~$ ping www.google-analytics.com PING www-google-analytics.l.google.com (212.142.160.238)…

23RD OCTOBER 2014 / WEB ANALYTICS

Keeping your Google Analytics clientId value as long as possible

If you are an analyst you may be concerned about your analytic tool (specifically talking about Google Analytics on this post) cookies tool integrity and about keeping that cookies as long as you can. Today I was working on a little audit for a client that was experimenting some cookies deletion problem on their intranet. They have, let say, 100 employees and they were seeing ~300 users on Google Analytics for one month, ~550 users when looking for…

9TH SEPTEMBER 2014 / WEB ANALYTICS

Google Analytics added sendBeacon functionality to Universal Analytics JavaScript API

New  day and another not publicly published functionality (not that I was aware of) has been added by Google to Universal Analytics JavaScript API. Till now, for example if we wanted to track our outgoing links or our PDF downloads using an event or a virtual pageview  to be sure that the info was really sent to Google Analytics we needed to either write some javascript to delay the user redirection to the destination page or using the…

17TH JULY 2014 / WEB ANALYTICS

Tracking HTML5 Videos with GTM

Almost all new browsers support the video playing using HTML5 including mobiles and tablets, so it may be way to embed videos that can be considerated when publishing videos on our pages. HTML5 has support for most of the videos format used on internet, even YouTube has been running an HTML5 version of their site for a long. So we're going to teach you how you can track those videos embed's using the built-in API and Event Listeners. We have setup…