David Vallejo - Web Analyst

Tracking user's IP Autonomous System Number and Organization details to prevent the spam

Around end of 2019, Google Analytics dropped the Network Domain and Service Provider dimensions support from their reports making an official announment in February about it.These 2 dimensions, where widely used to fight the spam in Google Analytics and there have been a lot of posts going around this topic in the last months. Simo Ahava wrote about how to collect the ISP data third party service in you want to check it. On this post we'll learning…


Tracking your visitors effective connection speed details

I know this is just currently a draft but being it available on Chrome, Edge and Opera ( or any chrome based browser ) make this really usefull in my opinion.In those browsers, there’s a API that allows to get the details about the current connection of the current user. We cab query some info like the current "estimated" connection link, the round-trip ( latency ), based on the recently observed requests by the browser.All these details can be queried…


Tracking the anchor text for the incoming links in Google Tag Manager

Introduction It's been a long time since I took care of this blog's "Analytics" ( In the blacksmith's house, a wooden knife). And I noticed that would be cool having the info about the Anchor Text the sites referring to my sites are using to link me. So I'm sharing the solution I built today in order to capture which Anchor Text was on the referring URLs and sending the info back to Google Tag Manager and from there we'll be able send an event to…


APP + WEB: Google Analytics Measurement Protocol version 2

The Google Analytics Measurement Protocol allows users and developers to make HTTP requests directly to Google Analytics endpoint in order to measure how users interact from any enviroment/platform. Since Google announced the new APP+WEB Properties back in summer, we noticed that the &v parameter that used to hold a fixed 1 value turned to be a =2 value in our hit requests. Which implicitily means that at some point a new version of the Measurement…


Tracking the Protocol version in Google Analytics via Google Tag Manager

Despite you being a SEO or not, I'm sure you're aware of how important the WPO ( Web Performance Optimization ) and this of includes of course how fast your site loads. The faster it loads the better for your users ( and better for the conversion rates they say ... ).At this point you may have heard about HTTP/2 (2015) , which the replacement for the oldie HTTP/1.1 ( 1995) , you have even heard about http/3 ( last draft Feb 2020 ), which is ever…


Tracking Android In-App visits in Google Analytics

This is going to be a quick post about how to track in-app visits from Android devices. When an Android App opens a website in a webview ( in-app visit ), the visit usually comes with an special referrer, It does start with "android-app" referrer string, here you can see a log line about how the referrers comes up. 77.XXX.XXX.XXX - - [20/Mar/2020:11:20:10 +0000] "GET /in-app-test HTTP/1.0" 200 1580 "android-app://org.telegram.messenger" "Mozilla/5.0…


#Discussion :: GDPR Compliance - Google Analytics Setup Proposal

NOTE: I want to start this post with a big disclaimer over it I'm not publishing it in order to tell anyone how they should be doing the Google Analytics tracking to comply with the GDPR / CCPA . The goal of this post being able to start an open discussion about the reliability of this exposed method and any final decision should be taken the site owners under their own responsability. One of biggest issues I ( my clients ) are hitting when implementing…


sameSite Automated Fix and status reporting tool

It has been a hard week with all these vendors announcing the Four Hoursemen of the Cookies Apocalypse arrival.There're a lot of changes coming when we talk about cookies ( 1st, 3rd party ), ITP, GDPR, CCPA,etc . I understand it may be a terrible headache for anyone but we need to keep some calm. Last update has came from Google Chrome, which was expected to start blocking the cookies not containing the sameSite attribute on 4th February. Luckily…


The Definitive Approach for preventing duplicate transactions on Google Analytics - Using a Universal CustomTask

It's been a long time since I wrote my post about how to prevent duplicate transactions on Google Analytics. At that point, the customTask wasn't a thing on the Google Analytics JS library, and the approach consisted of writing a cookie on each transaction and then work with some blocking triggers. It's a working solution for sure, but based on all the feedback I had over the years, it was not easy to understand for people. Things got worse even…


Test API . Unit testing for Google Tag Manager Custom Templates

Google Tag Manager team has just added, in a stealth mode, a new Test API for the Custom Templates. This Test API will allow us to define some Unit Tests in order to be able to automate the testing of our template before publishing them. You will find a new tab within the templates editor named "test" where you will be able to run some code before the tests start, and then add a set of unit test to run each time you want to test your library. For…