Spotify deploys machine learning to automate user acquisition campaigns
Spotify engineers detail implementation of pre-ranking algorithm that reduced acquisition costs by 14% while maintaining performance after iOS privacy changes.

Spotify's engineering team published details on November 7, 2023, describing an automated content marketing system that generates thousands of ad variations daily for user acquisition campaigns. The streaming service developed a machine learning model using XGBoost to select which ad creatives to deploy across Facebook, Google UAC, TikTok, and other digital platforms.
The technical blog post from Spotify Engineering outlined how the company combined automated creative generation with predictive algorithms to manage campaigns across tens of thousands of ads globally. Bryan Maloney, Christopher Tang, Deepak Bhat, and Ryan Kim authored the detailed account of building what they described as an end-to-end automated system for performance marketing.
Subscribe PPC Land newsletter ✉️ for similar stories like this one. Receive the news every day in your inbox. Free of ads. 10 USD per year.
High-cardinality creative variants created deployment challenges
Spotify's marketing team developed a creative production pipeline that could generate and deploy ad creatives based on listening habits in geographic regions. The system produced creatives from a high-cardinality dataset, where the number of variations being uploaded to marketing channels overwhelmed those channels' ability to optimize ads effectively.
The problem stemmed from Spotify's vast content catalog. With millions of artists and numerous template designs, the combination possibilities reached hundreds of thousands of potential ad creatives. Digital ad platforms like Facebook are designed to optimize across four to eight ad variations, not orders of magnitude more options.
Prior to 2019, Spotify conducted manual tests of content marketing that showed varying success levels. A manual test in the first half of 2019 demonstrated potential for bringing incremental users through content ads. The engineering challenge became building a system that automatically generated content-based ads, loaded them to digital marketing channels, and observed performance to make adjustments continuously.
XGBoost model outperformed heuristic approach across metrics
The engineering team conceived a five-stage loop for system behavior: ingest, rank, deploy, learn, and repeat. The technical approach required automating each step sequentially, starting with content generation.
Spotify initially used basic templating with a Java-based backend service that retrieved content elements from metadata services. This service generated static images but limited the team to simplistic templates without animation capabilities.
The team evaluated several solutions including Lottie and Blender before selecting Adobe After Effects for motion graphics. After Effects provided creative freedom for designers while supporting template generation across dozens of aspect ratios and sizes. The open source project nexrender extended aerender into a batchable system, enabling the team to script file movements and manage headless render nodes efficiently.
For content ranking, Spotify leveraged machine learning combined with data sources to rank content daily. The system collected data points on ad performance metrics including clicks, impressions, app installs, registrations, and subscriptions from different ad platform APIs and mobile measurement partner APIs.
The first heuristic model used three calculations: popularity, share of registrations, and diversity. The model used popularity to build a set of eight artists for campaigns, observed performance using share-of-registrations metrics, and evaluated optimization based on both popularity and differentiation from other artists and ads.
The machine learning approach transformed these fixed factors into a supervised learning problem. Features of each artist predicted share of registrations, with popularity added as one learning feature. The model incorporated campaign metadata like market, ad creative dimension, operating system, and template theme.
Spotify used the XGBoost library via the company's Kubeflow managed service to implement the algorithm. The model trained daily with historical data over a lookback window and predicted two main target variables for free-tier ads: reg_percentage (percentage of registrations the ranked artist would contribute) and relative_cpr_ratio (ratio of the ranked artist in overall CPR).
For premium-tier ads, the model predicted sub_percentage (percentage of premium subscriptions) and relative_cps_ratio (share in overall cost per subscription).
The team chose relative metrics instead of absolute metrics because raw metrics depend on external market factors that are difficult to model.
Buy ads on PPC Land. PPC Land has standard and native ad formats via major DSPs and ad platforms like Google Ads. Via an auction CPM, you can reach industry professionals.
A/B testing validated performance improvements
An A/B test ran for three weeks in two regions with the heuristic model as control and the ML model as treatment. Results showed the ML model achieving 4% and 14% cheaper cost per registration than the heuristic model in the two regions.
The ads generated from ML model rankings had 11% to 12% higher click-through rates than the heuristic model. This improvement came from the ML model being trained with richer data containing a higher number of features.
Following test results, the natural choice was productionizing the ML model for content ranking across all active regions running marketing campaigns.
The end-to-end architecture included metadata services, mosaic rendering, color-picker tools, an orchestrator, oseary-drakoulias coordination system, BigQuery for content rankings per country, Belafonte processing, BigQuery data cleanup via Klaus, and integration with digital ad platforms. The system operated through scheduled runs using Styx and Dataflow.
iOS privacy changes did not impact model performance
A significant technical consideration emerged when Apple unveiled Identifier for Advertisers (IDFA) restrictions in summer 2021 for iOS version 14.5 onward. The change transformed the ad tech industry landscape regarding which data points advertisers could collect and use.
Spotify would no longer rely on getting user-level or log-level ad performance data to optimize campaigns. However, because the ML model trained on aggregated data over a lookback window, the change did not affect it adversely.
The moment Spotify became aware that IDFA would activate for iOS version 14.5 onward, the team evaluated the ML model output through offline analyses for any negative impact on model performance. The analysis showed the model performance would not be impacted negatively.
Eric Seufert, mobile marketing analyst, discussed the Spotify implementation in an October 4, 2025, post on X. "Spotify's ML pre-ranking model outperformed a simple heuristic model, with 4%-14% lower CPRs and 11%-12% higher CTRs," Seufert wrote. "The ML model utilized a rich set of features to predict sub_percentage (the percentage of contributed subscriptions from the artist) and relative_cps_ratio (the share of the artist's cost per subscription in the marketing campaign) for premium subscriptions, whereas the heuristic model used three fixed features."
Seufert noted that although this was deployed before Apple's App Tracking Transparency framework, the team found that ATT didn't impact performance, as training relied on aggregated data. "This obviously remains a relevant issue as advertisers scale the volume of their creative production through generative tools," Seufert observed.
Subscribe PPC Land newsletter ✉️ for similar stories like this one. Receive the news every day in your inbox. Free of ads. 10 USD per year.
Technical challenges included external dependencies and migration
Throughout the project, the team encountered several technical challenges. Moving from Java templates to After Effects turned asset generation from something that could be done inline in an API call to something that needed rendering asynchronously. Scaling render workers up and down in response to asset volume proved challenging.
Dependency on ad platform APIs for ingesting ad performance metrics created vulnerability. To feed the ML content ranking model with quality training data, data pipelines had to fetch ad performance metrics from platform APIs daily. Facebook API outages in several instances caused disruptions in data pipelines, which resulted in the ML model not being able to train and produce content rankings until Facebook's marketing API returned to normal.
As a workaround, the team decided to continue preserving artist rankings from the previous day when the ML model lacked insight into the latest day's ad performance.
Spotify also migrated from Adjust to Branch for its preferred deep linking and attribution partner. This required updating all data pipelines and the ML model to consume Branch-powered ad metrics, then calibrating the system for content ranking. The team verified that consuming ad performance attribution data from Branch instead of Adjust did not result in performance implications for the ML ranking model.
Automation addresses growing creative production scale
The implementation demonstrates how companies handle increasing creative production volumes. Spotify has expanded its advertising infrastructure throughout 2025, including the April 3 announcement of Spotify Ad Exchange for programmatic buying and generative AI integration for audio ad creation.
The streaming service integrated with Smartly on September 3, 2025, enabling advertisers to manage audio, display, and video campaigns through AI-powered platforms. That partnership combined Spotify's listener base with automated creative production and cross-channel measurement capabilities.
IAB Europe's September 18, 2025, report found 85% of companies already deploy AI-based tools for marketing purposes, with targeting and content generation leading adoption patterns at 64% and 61% respectively.
The technical architecture Spotify built reflects broader industry movement toward automated campaign management. Amazon DSP added Spotify's global audio and video inventory through a programmatic partnership announced October 1, 2025, combining Amazon's shopping signals with Spotify's 696 million monthly users across nine markets.
Creative automation systems like those Spotify developed address production bottlenecks by enabling rapid generation of multiple creative variants tailored to different audiences, formats, and platforms. Smartly's clients produce over 150 million creative variants monthly through automated tools, demonstrating scalability potential.
For marketing professionals, this development carries several implications. The pre-ranking algorithm approach allows companies to generate creative variations at scale without overwhelming platform optimization algorithms. The use of aggregated rather than user-level data for training provided resilience against privacy framework changes.
The Spotify team emphasized that only a handful of tech companies have fully automated the performance marketing cycle globally. The product required cross-functional efforts between engineering and marketing to solve problems at the intersection of content catalog data, creative production, and performance optimization.
Machine learning systems for advertising continue evolving as platforms balance automation with advertiser control. Google introduced text guidelines for AI-powered campaigns on September 10, 2025, enabling term exclusions and natural language restrictions in Performance Max and AI Max campaigns.
The technical details published by Spotify provide insight into implementation challenges for automated marketing systems. The balance between generating creative variations and maintaining platform optimization capabilities represents a constraint that pre-ranking algorithms can address through predictive modeling and feature-rich training data.
Spotify's approach of building a supervised learning model that predicts relative metrics rather than absolute values demonstrates one method for handling external market factors that affect campaign performance. The daily retraining cycle based on defined lookback windows allows the system to adapt to changing conditions while maintaining prediction quality.
Subscribe PPC Land newsletter ✉️ for similar stories like this one. Receive the news every day in your inbox. Free of ads. 10 USD per year.
Timeline
- H1 2019: Spotify conducts manual test demonstrating potential of content ads for bringing incremental users
- 2019: Engineering team begins brainstorming automated content marketing system with five-stage loop
- Pre-2021: Spotify deploys machine learning model for content ranking before Apple's ATT framework
- Summer 2021: Apple announces IDFA restrictions for iOS 14.5 onward; Spotify evaluates ML model impact
- November 7, 2023: Spotify Engineering publishes technical blog post detailing automated content marketing system
- April 3, 2025: Spotify launches Ad Exchange and generative AI tools for advertising platform
- July 11, 2025: Spotify expands automated podcast buying to 170 million listeners across 12 markets
- September 3, 2025: Smartly integrates with Spotify Ads Manager for cross-channel campaigns
- September 18, 2025: IAB Europe reports 85% of companies using AI for marketing
- October 1, 2025: Amazon DSP adds Spotify inventory through programmatic partnership
- October 4, 2025: Eric Seufert analyzes Spotify's ML pre-ranking implementation on X
- October 16, 2024: DoubleVerify expands measurement to Spotify video ads
Subscribe PPC Land newsletter ✉️ for similar stories like this one. Receive the news every day in your inbox. Free of ads. 10 USD per year.
Summary
Who: Spotify's engineering team, including Bryan Maloney (Senior Engineering Manager), Christopher Tang (Senior ML Engineer), Deepak Bhat (Senior Data Engineer), and Ryan Kim (Senior Product Manager), developed the automated content marketing system.
What: An automated content marketing system combining creative generation, machine learning-based content ranking using XGBoost, and deployment to digital advertising platforms. The ML model achieved 4%-14% lower cost per registration and 11%-12% higher click-through rates compared to heuristic approaches while managing tens of thousands of ad variations globally.
When: Spotify began developing the system after successful manual tests in H1 2019, deployed the ML model before 2021, and published technical details on November 7, 2023. The system remains operational as of October 2025.
Where: The system operates across Spotify's global user acquisition campaigns on platforms including Facebook, Google UAC, TikTok, and other digital advertising channels. Implementation spans multiple markets where Spotify runs marketing campaigns.
Why: The system addresses the challenge of optimizing user acquisition at scale when creative production generates variations that overwhelm advertising platforms' native optimization capabilities. By implementing pre-ranking algorithms, Spotify can leverage its extensive content catalog while maintaining advertising platform performance, ultimately improving return on ad spend for marketing budgets.