Skip to content
Zwetan Kjukov edited this page Oct 8, 2015 · 1 revision

Tracking Scenarios

TODO

Tracking Server-Side

Google Analytics (analytics.js) can only track page views from visitors using a web browser visiting HTML pages and having JavaScript enabled, if one of this element is missing nothing will be tracked.

The general idea is as soon as you don't display HTML you can not track, for example a REST API returning JSON or XML data, there is no HTML to embed the analytics.js, but in fact there are many more other cases.

Static Files

Even if an HTML page that point to a zip, pdf, and other binaries have the links setup with analytics events, once the user get the path of the file, this direct path can not be tracked.

JavaScript or Flash turned off

If there is no JavaScript analytics.js can not run, same if the browser block the Flash plugin.

It could be user initiated but mainly it will happen with spammers (they don't want to be seen) and robots, crawlers, spiders (most can not parse/interpret JavaScript or Flash).

API Requests

Wether you are in a Single Page Application (SPA) that do most of it works making AJAX requests, or that you are returning API calls over REST, SOAP, AMF, etc. or other non-HTML protocols like AJAX, RDF, Atom etc.

There you are sending data (JSON, XML, etc.) that is not HTML and so can not embed the analytics.js and so tracking can happen from the client-side.

Ad Blockers

From an Ad Blocker point of view, to protect user privacy not-only they will block ads but also sometimes block tracking and so scripts like analytics.js or domain *.google-analytics.com.

I'm all to protect user privacy but I don't think blocking altogether tracking is the solution, from the webmaster or developer point of view, you do want to gather informations about how your website or application is used.

Incomplete Requests

If a user cancel the load of the page or simply if the load fail you will get an incomplete pageload and it's unlikely any tracking would happen.

Server Activity

Things like sending emails, users login with other services (SSH, FTP, etc.), creating backups, etc. happen only server-side.

For example you may want to see in your analytics when fail2ban is banning or unbanning an IP address, or when a backup completed and other things related to the server.