Beginner’s guide to web analytics

SHIV GARG
Technology at upGrad
7 min readMar 7, 2020

--

If you are reading this blog, you might have encountered a situation where you need to implement some sort of user tracking for your product or you need to make some changes to the existing implementation and now you are looking for some material to understand the whole territory then you are at the right place.

In this blog, I will be covering all the major topics broadly, which you need to take care of when you are dealing with the analytics

Credits: meya.ai

What is tracking?

The purpose of web tracking is for websites to gain insight into their users, their behaviour and preferences.

These insights serve to optimise user-friendliness and experience, as well as for statistical purposes, customisation, commerce, and profiling and targeted marketing.

Why you need a separate platform for tracking?

Most of people use separate platforms for tracking. Google Analytics, Mixpanel, Clevertap are some of the popular analytics platforms out there. Now the question is why would you want to purchase a tool for tracking whereas you can store this data in your database and save a lot of money. Here is why.

  1. Separation of concerns- In your primary database you would like to store things that are close to your actual business e.g products, payments, users etc and you would like to focus on your business-specific code rather than tracking specific code.
  2. Focus on business-specific tools:- As a company, you would like to build tools important for your business. Building a tracking platform is not an easy job. It requires a substantial amount of effort and resources which you can spend on the other important things.
  3. Infrastructure considerations:- Scaling a tracking platform is the hardest thing. As you would like to track each and every click user does, a small app with hundreds of users can generate millions of concurrent events. Handling these many requests is a challenging task and can force you to maintain an infrastructure which could have been avoided in the first place.
  4. Features and user experience:- Most of the tracking platforms provide a lot of features e.g. auto-track properties, attribution models, funnel creation, A/B experiment, campaign param handling etc. which are hard to build and maintain. But most importantly these platforms provide a very nice and easy interface, which your business teams are generally familiar with and they can easily create reports.

Start with the tracking

After you finalise and install a tracking platform. You can start tracking events. For the start, start with the top 10 events which are most important to your business and marketing.

Important event Types

  1. Page views: Page views are the most important events when you start tracking. page views give you an estimate on how many users visited a particular page. Pageviews also help you create funnels, measure the impact of A/B experiment and so on. Most of the tracking platforms expose a separate method to track page views. You should rely on this method only to track page views instead of a custom event.
  2. Events: Events are the custom events which you need to fire when a user does specific events like button click, link click, and zoom a particular section. When you are talking about analytics, you are talking about any kind of click, scroll, video, the time elapsed events. On most of the platforms, an event consists of an event-name and few properties. Generally, events are of two types: interaction type and non-interaction type events. You should be really careful when you are marking events as interaction type /non-interaction type. Otherwise, your bounce rate metrics will get screwed.
  3. User calls: The third type of call that I am covering over here is user identification calls. The prime focus of this call is to track the user across multiple devices. Most of the tracking platforms set a cookie for distinct id in the user’s browser when the user opens your website for the first time. All the events by the user are tracked against this id. But what about events by the same user from some other device? For this purpose you do a identify call, in which you ask the tracking platform to recognise that particular user with your given id. Generally, you do an identification call after login/signup and ask tracking platform to track that user with the user id in your database. Now if the user logs in from some other device you can track that user with the same database id.
  4. Reset Calls: As much as user calls are important, reset calls are equally important. Reset calls help you to reset a particular user from the platform. All the tracking calls after the reset call are considered from a new user. Reset calls are important to make when the user logs out of your application.

Reporting

If you have done all the above steps you have successfully set up tracking on your platform. Now the next big thing to achieve is reports on the analytics platform. All the tracking platforms offer a lot of views to see your data.

  1. Reports: You can create reports based on your events and filter them based on the various event properties that you have sent or based on the properties the particular platform is tracking automatically e.g timestamp, UTM params, page URL etc. Most of the platforms offer a feature to create reports based on the unique events by users which is really helpful to understand the product.
  2. Funnels: Funnel is created to get information about the journey of a user when he is using your website. Most of the times funnels are used to see drop-offs at the various stages. e.g a common funnel for an e-commerce platform is search → product view → add to cart → product check out → payment. Now let say you rolled out a discount on a particular product you can see its effect by comparing the change in product view to add to cart ratio.
  3. Retention reports:- These reports give you insights on the probability of a user returning on your platform after n days or weeks. These reports are can give you really important insights on user patterns before purchasing a product and you can configure your marketing or re-marketing accordingly.
  4. Bounce Rate: Bounced users are the users who landed on your platform and closed platform without doing anything significant. You should create reports for bounce rate on the different sections of the platforms and specific to ads.
Sample Search Funnel

Attribution

When you are running advertisements on different ad platforms(e.g google, Facebook, youtube etc) you will need to understand that which ad platform is doing better for you and where it makes more sense to spend more. You will also need to bifurcate organic, direct traffic from the traffic coming via ads. For this purpose concept of attribution is used. Attribution in itself is a fairly complex concept.

How attribution is performed

In most of the cases, attribution is done via query params. Urchin Tracking Module (UTM) parameters are five variants of URL parameters used by marketers to track the effectiveness of online marketing campaigns across traffic sources and publishing media. Most of the tracking platforms give inbuilt support for UTM params. When you create an ad on a particular platform you associate unique UTM parameters in the URL. Later when a user lands on your platform by clicking the ad URL, these parameters are present in the URL and are automatically tracked by the tracking platform in all the events fired from your platform. You can later use this data to generate reports.

Defining an attribution model

Attribution models come into the scene when you have visitors landing on your platform from multiple campaigns/channels. Let's say you have a user who lands on your platform first from google ad link and then from Facebook ad after a day and then purchased something. To which ad will you attribute this sale? This is handled by attribution models. You need to select an attribution model which works best for your business. Most common attribution models used.

  1. First touch:- In this model, you attribute a user to the first ad campaign which caused this user to land on your platform.
  2. Last touch:- In this model, you attribute a user to the last ad campaign from which the user landed on your platform and purchased the product.
  3. Linear:- In the Linear attribution model, each touchpoint in the conversion path would share equal credit for the conversion.
  4. Time decay model:- In the Time Decay attribution model, the touchpoints closest in time to the sale or conversion get most of the credit
  5. Position-based model:- In position-based attribution model, you divide majority attribution to first touch and last touch campaigns and a small percentage to intermediate campaigns.

Conclusion and Next Steps:

Although all the above-mentioned things can help you set up the tracking infra for your business. But the list is not exhaustive. Tracking is a very vast topic and it’s not possible to cover everything in a single article. As the next step in your learning, you can read more on

  1. Third-party cookies and how they are used to track the user across different platforms.
  2. Marketing pixels.
  3. Server-side tracking.
  4. Advanced E-Commerce, Video Analytics, form field analytics.
  5. Re-marketing

And the list goes on.

I hope this article helps you and gives you good insights and a head start in the area and you know your users better.

--

--