Why we developed our own analytics

Maté Gvo
3 min readJul 30, 2019

Google Analytics is a must have for any website. Tracking website speed, or visitors count, or bounce rate works great. But there’s a lot that’s missing from it, that you could easily solve by developing your own analytics tracker. Some of the Google Analytics drawbacks that were important for us to addresses:

  • Statistics update only once a day only. Which not only prevents you from seeing real time data, but also makes it very hard to debug. Let’s say you have just set up goals or advanced ecommerce analytics — you won’t be sure they work, until the next day (and only as long you had actual traffic hit your goals or ecommerce triggers)
  • No access to data. We can look at the charts, we can programmatically get some specific values, but there is no API to query the statistics database and adapt our ecommerce based on statistics
  • In some cases trackers are not 100% reliable. For example, in ecommerce tracking, you can send order complete event from “thank you” page. But this page is not reached by all of your customers. To access it, user first often leaves the website to fullfill a payment, and only than is redirected back to the page which is supposed send the order received data. In reality, there’s a lot that can go wrong — user closing browser immidiatelly after completing payment on 3rd party website is one
  • GDPR concerns. It’s obligatory to ask users consent when using analytics tracker. But this is only true when we are using a 3rd party analytics tracker, because we are sending data to a 3rd party. What if your users don’t allow for 3rd party analtyics tracking? Should we just ignore this traffic? Defenietly not. To the rescue come tools that you can host on your own server, although slightly less reliable, they can compete with Google Analytics.

Why bother

In ecommerce business it is crucial to understand performance of your catalogue. Based on products’ performance, search results’ order of products shuffles real-time. These is technology is called a recommender systems. Recommender systems do much more than this, but I won’t to deviate from the topic— why to develop your own analytics tracker.

In our case, we wanted to understand:

  • how many times given product is shown to the user. This is called an impression,
  • how many times a products has been viewed, for us this means opening a page with product details,
  • how many times a product was added to cart,
  • and finally how many times product was purchased

These are our basic parameters. But one could also track:

  • how many times a product was mouse-overed in the catalogue (or other interaction indicating interest)
  • how many times a product was returned — this metric would tell us less about customers’ interest in a product, more about their satisfaction in purchases, or potentially a promise vs. deliver ratio, which still can affect how often we’d like to show the product to a customer

How we did it

Actually, it is so simple to develop such tracking mechanism, that I won’t even bother talking about details. As long as you have basic programming knowledge, give it a thought, you will come up with a solution in no time

  1. whenever a product is shown in the catalogue, we send an XHR (or ajax) request to our backend, with product details and a key “impression”
  2. when a product page is open, same thing happens but with a key “view”
  3. same for “add to cart”
  4. an interesting exception is purchase which if you rememeber, wasn’t possible to be tracked reliably via Google Analytics. This information comes directly from our shop’s backend. With our own solution as long as purchase was made, it must appear in our analytics!

Why we are so happy with our own analytics

It’s not just that we have real time access to statistics, we can do something with them. We calculate product’s ranking based on collected data, and use it to show more relevant results to the users, which in turn increases our revenue. On top of that an overall tracking gives us information about the overall catalogue performance, which we can measure over time. One number to track the entire catalogues worth of performacne — I find this cool!

Would you like to know read more about solutions like this? Drop a comment or a few claps. Thanks!

--

--