Data-Driven Marketing Attribution
Custom Attribution with Cooperative Game Theory
The problem with marketing attribution
Popular marketing attribution models have their pros and cons, and choosing the best model is down to individual business needs. However, one drawback the popular models have in common is that they are rules based, and the user has to decide up front how they want the credit for sales conversions to be divided between channels. Popular models include:
- Linear: credits an equal share of the payoff between all touch-points
- Time-decay: credits a decreasing percentage of payoff the further away in time a touch-point is from the date of conversion
- Positional: credits 40% to the first and last touches, and the remaining 20% is evenly distributed to the touches in between
Chief Marketing Officers use the results from the chosen model to measure ROI and make more informed decisions on where to invest marketing resources in the future. Accurate results are important, but these heuristic solutions are inflexible and unable to distinguish between the true low and high impact touch-points, resulting in an inaccurate division of credit.
Luckily, there are more sophisticated, data-driven approaches that address these limitations. Data-driven attribution is a custom solution that is able to capture the intricacies of buyer journeys by modelling how channels, and more importantly how different combinations of channels, interact with buyers to influence a desired sales outcome. A data-driven model provides the most accurate view of which channels are performing the best, driving better marketing accountability and efficiency.
This post explores a data-driven attribution model based on the Shapley value concept taken from cooperative game theory.
Game theory and the Shapley value
In a game of multiple players that can work together (form coalitions) to increase the likelihood of a desired outcome (payoff), the Shapley value provides a way to fairly divide the payoff between the players.
Essentially, the Shapley value is a measure of a player’s average marginal contribution to each coalition. Taking into consideration that players can join coalitions at different points in time (order), and have varying degrees of influence (worth). It’s based on the assumption that each ordering has the same probability of occurring, thus players are awarded by their contribution to all permutations.
Papers published by Rovira i Virgili University [1] and UCLA [2] provide excellent formal definitions of the Shapley value and its axioms, which is beyond the scope of this post.
In the context of marketing analytics, campaign channels are the players of the game, and the various ways in which the channels interact with accounts throughout the buyer journey form the coalitions. Cooperative game theory and the Shapley value provide a stable way to measure channel influence and fairly divide the credit for sales conversions between the channels, based on their individual contribution to the total payoff.
Marketing benefits:
- Deeper insight into channel performance
- Fair division of credit, based on measured contribution
- Ability to optimise marketing investment and influence sales results
- Shapley value is a widely used, and Nobel prize winning solution (Google Analytics uses it for channel attribution)
The characteristic function
A game is defined by a set of players N and a characteristic function v. Every subset of players is called a coalition S, and the characteristic function v(S) assigns a value to each coalition to signify its worth. A coalition’s worth represents the payoff that it can generate when its players work together.
Options for defining the characteristic function for marketing include:
- Total revenue generated by each coalition
- Total number of sales conversions generated by each coalition
- Conversion ratio of each coalition (conversions / opportunities)
- Conditional probability of conversion — likelihood of converting given a set of channels
Conversion ratio example
Let’s walk through an example using channel conversion ratios. Say that your company converted 100 opportunities at the end of a fiscal quarter. During that period, the marketing department advertised to the associated accounts using three channels:
N = {Facebook, Google, LinkedIn}
All 100 accounts were touched by one or more of the channels throughout their buyer journeys. In other words, the channels worked together by forming coalitions to increase the likelihood of opportunity conversion.
The table below lists all possible channel coalitions and their conversion ratios:
The worth of each coalition is determined by the characteristic function. In this example, the worth is represented as the sum of the conversion ratio of each channel in a coalition.
- Coalition S5 = Facebook+LinkedIn
- v(S5) = Facebook (S1) + LinkedIn (S3) + Facebook+LinkedIn (S5)
- v(S5) = 0.18 + 0.08 + 0.26
- v(S5) = 0.52
The coalition containing all players is known as the grand coalition v(N). The grand coalition’s worth should be equal to the total payoff.
Now that we know the worth of each coalition, the Shapley values can be calculated by taking the average of each channels marginal contribution to the game, accounting for all possible orderings. Specifically, the Shapley value gives us a way to distribute the worth of the grand coalition (total payoff) between the three channels.
Facebook’s Shapley value:
- In orders 1 and 2, Facebook is first to arrive so it receives its full contribution
- In order 3, Facebook arrives after Google so its marginal contribution is the coalition containing both Facebook & Google v(S4) minus the coalition without Facebook v(S2)
- In orders 4 and 6, Facebook is last to arrive so its marginal contribution is the coalition containing all channels v(S7) minus the coalition without Facebook v(S6)
- In order 5, Facebook arrives after LinkedIn so its marginal contribution is the coalition containing both Facebook & LinkedIn v(S5) minus the coalition without Facebook v(S3)
The Shapley values for all channels:
The code for this example can be found in this Jupyter Notebook on Github. Here is a snippet to show how to calculate the Shapley values in Python:
Conclusion
It is clear from the Shapley values in this example that Facebook is the best performing channel, and the combination of Facebook and LinkedIn is the most influential coalition. A CMO may look at this and decide to allocate more resources to Facebook and LinkedIn to optimise conversion rates. They may also question why Google is underperforming and invest more resources towards improving the campaigns running on Google Ads.
In summary, as businesses strive for more accountability, efficiency, and data-driven decision making, cooperative game theory and the Shapley value provide marketing departments with an accurate and tailored solution for attribution that has the potential to deliver much more than the rules-based models are able to provide.
References
- [1] S. Cano Berlanga and JM. Giménez Gómez and C. Vilella, Attribution models and the Cooperative Game Theory (2017), Rovira i Virgili University
- [2] T. Ferguson, Game Theory (2014), UCLA Department of Mathematics
- [3] R. Affane, Marketing Attribution (2018), Data from the trenches — Dataiku