web logs analyzers vs JavaScript web analytics - Flat 101

Log-based and JavaScript-based web analytics, pros and contras

If I look back at the end of the 90s, when I started work in this delightful web/digital sector, I already used web analytics without being aware of it (because the term “web analytics” was not in use), by regularly consulting tools such as Webalizer (my favourite) or AWStats. They were primitive in terms of graphics, but they provided valuable information on access to websites. They were tools for showing the data from the server log where the website was hosted. Basic data, but data nonetheless.

In the early 2000s I came across Urchin, a more powerful web analytics tool with greater capacity than Webalizer or AWStats. Google bought Urchin in 2005 to create what we now know as Google Analytics, which launched at the end of 2005. I spent an inordinate amount of time working with Google Analytics in 2006, but also with tools such as AWStats and Webalizer, and I was always asked the same question in the companies that used them, “Ricardo, why does Google Analytics give me some visits, and AWStats give me others? Which is correct?The answer is easy enough. They are both right.

This tale of the good old days is intended to outline the difference between web analytics tools based on logs (AWStats) and those based on JavaScript (Google Analytics).

Today there are many tools available for web/digital analytics which use both systems of measurement, based on logs and JavaScript.

What do the log-based web analytics tools actually measure?

Log file preview

Easy. As the drawing at the top of this post shows, log-based web analytics tools gather information on log activity and display it as a graph or structures in data tables. A log file is a file generated by a server that contains a register of all requests (called hits) that it receives. Literally all requests, which means any type of file that forms part of data group that is required in order to “see” a website, and not just HTML files. The data received is stored anonymously with details such as the time and date of the request, the IP that sent it, the URL requested and browser’s user-agent.

Image of a log file. This is how good it looks

In basic terms, a log is a register of a server’s activity, so web analytics tools based on this system will show data about the files and requests that are sent to the host.

OK, so what do the JavaScript-based web analytics tools measure?

Here is one simple way to explain the basics of how JavaScript-based web analytics work
Here is one simple way to explain the basics of how JavaScript-based web analytics work

This block has the most popular tools on the market, headed by Google Analytics. Unlike log-based tools, which extract information from the log file, JavaScript-based tools work by the insertion of a small fragment of JavaScript in each of the HTML documents that make up our website, either directly or through tag manager. Every time a user requests a URL where this JavaScript is present, the data from the user’s browser header are collected in a cookie, sent to the Google servers (in the case of Analytics) and processed to be presented in a graphic panel, as our friend Google Analytics.

An example of classic Google Analytics code working on a website
An example of classic Google Analytics code working on a website

In short, they are tools that interpret the data from the user’s browser header, and they all use these same basic elements: URLs, cookies and JavaScript.

So they all measure the same thing, right?

No, no they don’t. A log-based web analytics tool has data on the requests that are sent to the machine, the server which hosts the website. A JavaScript-based web analytics tool offers data based on the browser headers of the users who have accessed the website and where the URL-JavaScript-cookie cycle has been completed to collect this information.

So what is the difference? I don’t get it.

Easy. A log-based web analytics tool will tell you, for example, that the home URL of a website has been requested 400 times. Over the same period, a JavaScript-based tool will tell you that this same URL has been requested 300 times. What does this difference mean? Easy. The log processes requests, as we have already seen, regardless of whether they come from users, bots or browser systems that do not use JavaScript or cookies. On the other hand, tools like Google Analytics only offer data that can be captured by this URL-JavaScript-cookie triad. If any of these elements fails or is absent, the visit is not counted.

Pros and cons of log-based and JavaScript-based web analytics.

First of all, it must be said that these measuring systems do not replace, but supplement each other. They do not measure the same thing, so they complement each other, and should be used depending on the type of information that we need at any specific time, the problem we want to address or the inefficiency we want to remedy.

Log-based web analytics tools will not provide valuable information about, for example:

  • Bots visiting our site
  • Requests for files “hanging” from our website, like PDFs or documents.
  • Errors on the site linked to HTTP Status.
  • Technical details about access to the website: IPs, etc.
  • Especially when the data can be reprocessed as many times as we want, because it is 100% raw.
 As the image shows, a simple log-based web analytics system such as AWStats collects all the requests from bots from the browsers that have taken place.

As the image shows, a simple log-based web analytics system such as AWStats collects all the requests from bots from the browsers that have taken place.

In contrast, the JavaScript-based web analytics is easier to use, very flexible as a tool, and has a relatively fast learning curve, making it easy for the user to understand. It is, to put it one way, a form of web analytics for “normal” folk, people without technical training.

Having said that, it should be clear that both systems can and should co-exist and be used depending on the needs that the growth of a digital project might have. This is the best approach, because a single measurement system is a mistake as it only offers us a partial view of the website.

In fact, if I had to choose only one system to use for measurement, I would probably choose the logs; which are harder to use but much more reliable overall. We have both approaches, though, so why should we choose?

Leave a Reply

Your email address will not be published. Required fields are marked *

If you need development specialists to develop or improve your digital business, we can help you.

  • Los datos que nos faciliten el usuario a través este formulario se incorporarán a tratamientos cuyo responsable es FLAT 101 S.L. con CIF B99393613 y domicilio social en Avda. Maria Zambrano, nº 31, Edif. WTCZ, Torre Oeste, 12D, 50018 de Zaragoza. Puede contactar llamando al 976419856 o a través del correo electrónico info@flat101.es. La finalidad de recogida de datos en este formulario es poder contestar las consultas planteadas y enviar al usuario la información solicitada a través del correo electrónico o teléfono indicados en el formulario. Solo se realizan cesiones si existe una obligación legal. Reservados sus derechos a acceder, rectificar y suprimir, así como otros derechos, como se indica en la Política de Privacidad.