Measuring what fraction of your visitors have third party cookies blocked

If you want to use the network_userid (i.e. third party cookie ID value) to perform analysis, it is sensible to measure what fraction of your userbase has third party cookies enabled / disabled.

This can be done using the following query:

with tpcids_and_pvs_by_fpcids as (
    count(distinct(network_userid)) as number_of_3rd_party_cookie_ids,
    count() as page_views
  where event = 'page_view'
  group by 1
  case when number_of_3rd_party_cookie_ids = page_views then 'third party cookies blocked' else 'third party cookies enabled' end,
from tpcids_and_pvs_by_fpcids
where page_views > 1
group by 1;

The query works by:

  1. Identifying users (as identified by first party cookie IDs i.e. the domain_userid that have viewed more than one page
  2. Counting the number of network_userid values that have been assigned to users who have visited more than one page
  3. Comparing the number of distinct network_userid values to pages viewed. For a user who has 3rd party cookies blocked, each time they visit a new page a new value of network_userid will be set. So if a user has visited three pages, and has three distinct values for their network_userid, we can be very confident that he/she has third party cookies blocked.

We use a custom collector that redirects through to Cloudfront but if the beacon doesn’t contain the third-party cookie, we set the cookie and redirect back to itself with a slightly changed URL (so we don’t end up with redirect loops), and then redirects off to Cloudfront for collection.

You can see it in action with:
curl -v -L '' >/dev/null

1 Like

@Simon_Rumble This feature has been suggested by me as a RFC: Scala Stream Collector: add support for cookie bounce

And it has been implemented and submitted as a pull request:

So it might become available to all snowplow users.

1 Like