The life of a third party cookie

09/04 By Mattia Fumagalli

Key learnings summary:

  • The distribution of lifetimes of 3rd party cookies is bimodal. Either they live less than a day, or they are likely to live for more than two weeks.
  • Cookies seen by a campaign (any campaign!) live for longer.

Cookies are small pieces of data stored in your browser that websites use to remember important information regarding online activity. Cookies define our web-identity, for example they are able to retrieve your browsing history on a newspaper website in order to recommend relevant articles. However, they don’t retain any personal information that can be used to identify a person. A lot of web analytics is conducted through the use of ‘third-party’ cookies which allow us to access a web user’s browsing behaviour across all websites.

Selection effects and the lifetime of a cookie

While cookies are stored on your device in a folder determined by your browser, third-party verification vendors like IAS keep cookie data in logs. Every time a cookie is seen, a new line will be added to the log, storing relevant information – more specifically, viewability data.  

Looking back at historical logs, we can see how long cookies live. Cookies living at a particular moment of time need to be preselected to help assess how long they live after that moment. By doing this, we find a bimodal distribution like the histogram below: a large percentage of cookies live for less than a day (~40%), few cookies live for between 1 and 30 days, and the relative majority live for longer than a month (~45%).

Short-lived cookies (< 1 day) are typically really short lived (a few hours max), and are generally referred to as ‘session-cookies’, whose lifetime corresponds to the length of time browsing in ‘incognito’ mode.

Figure 1: Distribution of cookie lifetimes.

Interestingly we’ve found that if we observe a cookie that already lived for a certain period of time, it will have a high probability of living longer. For example, if we observe a cookie for a week, it usually has a 96% probability of living for at least two weeks. Moreover, if we see the cookie for longer  than a day, there is a high probability that it will live longer than a week (91%) and even a month (76%).

However, if we were to select cookies that were born on a certain day (and never seen before), the distribution of lifetimes would be quite different; with ~80% of cookies ‘dying‘ in one day or less and ~20% living for longer than a day. This might seem counter-intuitive, but it’s due to the fact that the cookies we see on a specific date are a mix of newborn cookies and longer lived cookies that we have seen before. This is a case of selection bias: different selections will give you different answers to the same question.

Different browsers, different lifespans

The lifetime of cookies is largely driven by the type of browser you are using, its settings, and the browsing mode. For example, the standard Safari setting is to not allow third-party cookies; users allowing these cookies had to change the default settings and are therefore a small minority. Their use of browsing in ‘private’ mode must be very different from that of a Chrome user, for example, where the default settings allow cookies. Most likely it is due to this, that we observe that only 20% of cookies in desktop Safari live for more than a day. Contrary to this, 50% of desktop Chrome cookies live for more than a day.

Figure 2: Fraction of cookies that live longer than a day for different browsers and platforms (mobile/desktop)

Cookies in a campaign live for longer

We mentioned earlier that selection bias plays a significant, and sometimes unexpected role. We assessed cookies shown ads from a particular advertising campaign, and observed that they tend to live longer than the general cookie population (~80% of them lived more than a day). A second campaign showed a similar effect, and a third as well. In reality all campaigns showed the same behaviour.

Figure 3: Observed distribution of lifetime of all cookies (light blue) and cookies seen by three random campaigns. No matter what campaign it is, cookies in a campaign will live longer than the overall population.

Long-lived cookies are touched by multiple campaigns at once, while short lived cookies are touched by one campaign each, making it much more likely for a cookie on a pre-selected campaign to live longer than a cookie picked without specifying the campaign.  

Cookies play a huge role in our web-identity and it is clear to see that a cookies life varies depending on the environment in which they live. And by no real surprise, human behaviour on the internet has no pattern: people use multiple devices, cookies can be deleted, the settings of our browser allow us to not accept cookies at all and we can even delete them after every session. Understanding how cookies work and how users can impact a cookies life is important when planning campaigns and understanding user behaviour on the internet.

Visit our insights page to learn more about data science.