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…

Date
Keep reading ,

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…

Date
Keep reading ,

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…

Date
Keep reading ,

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

Date
Keep reading ,

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,…

Date
Keep reading ,

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…

Date
Keep reading ,

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…

Date
Keep reading ,

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…

Date
Keep reading ,

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…

Date
Keep reading ,