Cost Per Action optimization campaigns

Experimental framework to create, deploy, monitor & optimize digital marketing campaigns; powered by Python, solid statistical framework, enhanced by Machine Learning methods & clear interactive visualizations tools.

The goal of the project was to increase the revenue and user volume for the games through a novel type of digital publishing campaigns. In a digital publishing campaign the advertising company pays the publisher for users, where the publisher is usually an AdNet like Google, Facebook, etc. The execution of this task from the AdNet side is framed in a "campaign", which specifies the target and the price of the users. Common targets aim to deliver users that will "convert" or will download the app (game), this project implemented campaigns that targeted users that will trigger a game-action. The motivation to use this type of campaigns called CPA (cost per action) instead of the conventional ones is two fold, firstly the net cost is cheaper due to lower ROI estimation from the AdNet. Secondly we have access to fully controlled data that gives us access to key exploitation points, which we can drive to higher conversion from users in unexplored market shares.

To achieve this goal we delivered a framework to search, qualify, launch & monitor these campaigns. The framework implemented four stages and involved instances of techniques such as Clustering methods, Decision Trees, Bayesian Statistics, Visualization and more. The first stage provided tools to find the in-game-actions (or events) that would provide the best campaign outcome. The second stage estimated the performance of each possible campaign based on these events. The third stage selected the deployable campaigns and launch them. The fourth stage monitor & optimized the production performance.

The definition of success for the first stage meant to overcome an overwhelming noisy search of possible events for each game, since initially we didn't know what are the best events in the game to target users that are likely to make purchases. Although the data is structured in tables which we have great control on, the space of possibilities is so large that a brute-force approach was impossible (impractical) for the time cost it would imply. Two tools where provided and deployed to the relevant teams to achieve the task, a Forensic Tool and an Event Search Pipeline Tool. The first one packaged a collection of queries and interactive visualizations to address a game play story-line for targeted users, powered by Plotly and Databrikcs Dashboards. The second tool combined a set of statistical methods to reduce the size of the event search space, starting with a filtering funnel based on business rules and data quality loose criteria, we then look at the discrimination power of the events between to group of players the NP (non-payers) and the HP (high-payers). The filtering funnel eventually gave place to a Decision Tree based model, once our understanding of the metrics was deeper. The outcome of this first stage was a small (the order of 10) set of event candidates to be implemented as the action in the campaign.

To measure the expected (prior) performance of the candidate event list we rely on the following key metrics:

Metric Name Metric Definition Details
Trigger Rate $${p(ev) = \frac{N_{ev}}{N_T}|_{scope}}$$ Fraction of users that triggered the target event with respect to the set scope.
Conversion Rate $${p(conv) = \frac{N_{conv}}{N_T}|_{scope}}$$ Fraction of users that converted (made a purchase) with respect to the set scope.
Conversion Significance $${p(conv|ev) = \frac{N_{conv,ev}}{N_{conv}}|_{scope}}$$ Fraction of users that converted given that they triggered the event.
Payer Coverage $${p(ev|conv) = \frac{N_{conv,ev}}{N_{ev}}|_{scope}}$$ Fraction of users that triggered the event given that they converted.
I was able to show that our key metrics were related by the Bayes Rule, like so: $${ p(ev|conv) = \frac{p(conv|ev)p(ev)}{p(conv)} }$$ I also estimated the statistical and systematic uncertainty of each metric. With all this elements we built a pipeline to measure and display the expected performance in terms of those metrics for each event-candidate. As a result we can select the events that target the users that are most likely to convert and increase the revenue. With the inclusion of uncertainties it became clear that events displayed a cluster behavior, thus we added a Machine Learning Clustering technique; a k-medians model to extend the clustering to account for a higher number of features.

Having selected the events to configure the CPA campaign the next step is to send the AdNet the information to provide the users we target. This will mark the beginning of the deployment stage since once the information (signal) is sent we can launch the campaigns. By "sending the signal (or information)" we mean to update the AdNet when an event of interest (target) happened inside the game. Sending the signal or information means to update the AdNet when an event of interest (target) happened inside the game. To achieve this task we sended everyday the previous set of users that trigger the event through the AdNets API, using a pipeline we developed for that particular purpose and was integrated in Airflow. Once the signal was sent we developed a Monitoring Tool to check the quality and sanity of the sent signal. The final step was handled by the Media Buyers team, responsible of launching and supervising the production status of the campaign.

After the campaign was in production for two weeks we started controlling and comparing its performance to the expected values computed at the 2nd stage. In this instance we gathered the prior metrics into what we called the optimization metrics, we added extra value metrics such as: bid, spend and projected revenue; and we included volume metrics such as number of installs and number of trigger events. We packaged this analysis into a pipeline for us and the Media Buyers to easily access it. As a result we deployed more than 20 campaigns across 4 different games (Zooba, War Machine, Sniper 3D & Tennis Clash) and 2 different AdNets (Google & Facebook), within 3 months of development. We grew the revenue over 120k u$d thank to these campaigns and we brought more than 6k new users to these games.