Page Tagging Analytics

Digital Analytics tools are not within your head neither in the one who is asking you to perform digital analytics on their behalf. As they don't know what you really want to track or analyze, they can only guess by providing you default data collection tools.

The data collection tool is called a tracker, as it allows to track/measure something. In Digital Marketing you may find trackers for almost everything: to measure conversions in SEA, to know if a message has been opened in emailing, to fire remarketing campaigns, to know if a marketing campaign on a social network has been profitable, etc.

A tracker will look like something similar to this:


here is my tracker.


According to the tracker you will choose it may be more or less understandable, here is for example the default tracking code of Matomo Analytics:

<!-- Matomo -->
<script type="text/javascript">
  var _paq = window._paq || [];
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  (function() {
    var u="//localhost/matomo/piwik/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '34']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
<!-- End Matomo Code -->

For a beginner this tracker may be difficult to read, but if you go through Matomo's documentation, you will see that each feature is clearly explained:, for example:

  • trackPageView: this function record the fact that the web page has been viewed
  • enableLinkTracking: it measures the interaction on some special links such as clicks on downloads and outbound links
  • setTrackerUrl: indicate the server to which you would like to send the data to
  • setSiteId: indicate the id of the website to which you would like to send the data to

So, understanding a tracker is all about being curious and investigating its developer documentation.

Don't be surprised, sometimes the word pixel is used. A pixel is an alternative to JavaScript page tagging. It adds an invisible image to the page (in fact it is not really invisible it is 1 pixel height per 1 pixel width and it is transparent). Here is an example of what a pixel look like:

<!-- Matomo Image Tracker-->
<img src="http://localhost/matomo/piwik/matomo.php?idsite=34&rec=1" style="border:0" alt="" />
<!-- End Matomo -->

Here you can see, that it is a basic HTML tag. When this tag is loaded on the page then we know that the interaction has occurred.

The concept of a tracker is very simple, it consists of executing the given tracker at the moment when you would like the data to be collected.

Those default data collection tools are mostly using JavaScript programming language. The reason behind this is that JavaScript is a very dynamic language, which allows to collect many data performed through a web browser.

Among the data which are collected by default with a JavaScript tracker, there are:

  • User IP address.
  • Date and time of the request.
  • Title of the page.
  • URL of the page.
  • Referrer page.
  • Screen resolution of the browser.
  • Main Language of the browser.
  • User Agent of the browser being used.

As you can see, they are very close to the one collected by the server.

Said clearly, it is up to you to explain the Digital Analytics solution which data you would like to collect.

JavaScript trackers are also well-known for the deployment of HTTP cookies. Cookies are nothing more than Post-its. A text file stored in the browser of the internet user in order to use this data afterward for one of your information system.

So typically, when someone is visiting a webpage, cookies can be deployed thanks to JavaScript trackers. As for Matomo, here is a list of a few cookies that can be deployed:

  • _pk_id: it sets a unique id which will be used in order to recognize the visitor
  • _pk_ses: used in order to identify the visit
  • _pk_ref: used in order to know the channel the visitor has arrived

The values and expiry dates of each of those cookies can be directly checked within your browser.

Advantages of Using Page Tagging Tools

  • Page tagging require the execution of JavaScript and most of robots do not execute it. As a result, those solutions are very suitable for marketers who just want to monitor the traffic of internet visitors and not the robots.
  • By default, page tagging solutions are collecting extra data that logs don't, such as the screen resolution, the plugins installed on the browser, etc.
  • With page tagging you can collect the interactions of the users which are not the result of downloads, like scrolls.
  • Page tagging can be used in order to fire cookies and collect data about the visitors in order to reuse them later.
  • In some cases you won't get access to the server logs, and page tagging solutions will be your only way to process data.

Disadvantages of Page Tagging Solutions

  • Page tagging do not measure information related to downloads, so you won't find any technical information there such as how much bandwidth is consumed
  • Even measuring simple technical errors such as 400 and 500 errors is more difficult than on log servers
  • Does not measure easily the traffic coming from robots
  • If your code is not on the page or if the internet user is blocking your tracking code then no data will be recorded and your data will be lost
  • Privacy concern: more and more people are trained to data privacy and as a result will block the execution of your code. Moreover than you have to respect the regulation of the market you are targeting in terms of data collection

What Kind of Extra Data Can You Collect?

Cross linking data: typically here you will use one existing type of data that you have collected and you use it in order to get an additional one. For example, by getting your visitors' IP address you can get their location. Knowing the location and the time of the user, you can request a weather forecast third party application what the weather was at the time and location of the internet user and add this information (sunny, cloudy, rainy...) into your own information system.

Last modified: Wednesday, 29 July 2020, 4:39 PM