harrisahmad.dev

Writing

The hidden mobile data cost of YouTube video ads

· updated · 4 min read

Mobile YouTube is free in price, but not always free in data. That matters most where prepaid mobile broadband is expensive relative to income.

In our paper at The ACM Web Conference 2024 (WWW ’24), we measured the hidden data cost of in-stream YouTube video ads from the user’s perspective — not advertiser CPM, and not platform revenue.

Paper: Uncovering the Hidden Data Costs of Mobile YouTube Video Ads (PDF, code & data)

What we measured

We built a crawl/stream pipeline and released a public corpus covering:

  • 17,600 main videos
  • 46,600+ in-stream ad videos
  • ~8,225 hours of streamed content
  • 8 countries (four developing, four developed)

We then analyzed client buffer state around ad placement — which is where latent waste shows up.

How the measurement works

We ran eight Ubuntu machines, one per country, each connected through a commercial VPN endpoint in that country and throttled to the country’s average mobile bandwidth. Collection ran daily from 1 March to 1 May 2023.

Picking videos. S1.py drives desktop Chrome with Selenium. It scrolls four Trending feeds and the YouTube homepage, keeps the watch?v= links, and reads each video’s duration from the player. data-collection.sh splits the trending and non-trending lists into four files each and starts an S2.py worker on every file.

Streaming. Each S2.py worker drives Chrome through ChromeDriver, emulating a Nexus 5 (a 360×640 viewport) on m.youtube.com. It turns on Stats for Nerds, mutes the player, turns autoplay off, and polls the page continuously until the video ends. Every pass reads the player’s state and playback time and whether an ad is showing. Outside ads it also reads the resolution and seconds of buffer ahead from Stats for Nerds; during an ad it reads the ad’s video ID, buffer and resolution, whether it has a skip button, and the skip countdown. When the video ends, the worker writes four JSON logs.

From seconds to bytes. Offline scripts add each ad’s duration and format size from yt-dlp and its most common resolution. make-csv.ipynb then builds one row per video: how many seconds of each skippable ad were fetched by a skip at 5 s, and how much main-video buffer was lost across each mid-roll ad. The analysis converts seconds to bytes with each format’s size.

Architecture — Eight machines, one per country, stream through an in-country VPN at that country’s average mobile bandwidth. S1.py collects trending and homepage video URLs; data-collection.sh splits them into list files and starts an S2.py worker on each. S2 drives Chrome emulating a Nexus 5 on m.youtube.com and polls the page continuously: Stats for Nerds video ID, resolution and buffered seconds; player state, time and duration; and the ad flag, skip button and skip countdown. Offline, yt-dlp adds ad durations and format sizes, and make-csv.ipynb computes how much of each skippable ad was fetched by the 5 s skip and how much main-video buffer was lost across each mid-roll ad (blue path). Dashed boxes are outside the released code: YouTube itself, yt-dlp and the per-country machines.

Key findings (short version)

  1. Skipping is not free. Users frequently still download 80–100% of a skippable ad’s data after skipping (~31% of cases in developing regions, ~52.6% in developed regions in our data).
  2. Mid-roll ads disrupt the main video buffer. A mid-roll can force re-download of as much as ~71 seconds of main-video on average early in playback.
  3. Affordability impact is real. Excess losses averaged about 6.7% of a 2GB mobile plan in our affordability analysis.

Put differently: ad playback policies interact with buffering in ways that charge users for bytes they never asked to consume.

Why this matters for builders

If you work on video players, ABR, ad insertion, or mobile products in emerging markets:

  • Treat skip as a hard stop on further ad media fetch when possible.
  • Avoid policies that discard large main-video buffers on mid-roll insert.
  • Measure user-paid bytes, not only completion rate or fill rate.
  • Publish buffer/ad interaction metrics the way we publish latency SLOs.

What we released

The dataset and toolchain are public so others can reproduce and extend the measurement:

Citation

Emaan Atique, Saad Sher Alam, Harris Ahmad, Ihsan Ayyub Qazi, Zafar Ayyub Qazi. Uncovering the Hidden Data Costs of Mobile YouTube Video Ads. WWW ’24.

If you’re studying video affordability, ABR/ad interaction, or mobile QoE in developing regions and want to compare notes, email me.