0
0
Digital Marketingknowledge~30 mins

Attribution models (last-click, multi-touch) in Digital Marketing - Mini Project: Build & Apply

Choose your learning style9 modes available
Understanding Attribution Models: Last-Click and Multi-Touch
📖 Scenario: You work as a digital marketing analyst for an online store. Your manager wants to understand how different marketing channels contribute to sales. You will create a simple model to represent customer journeys and apply two common attribution models: last-click and multi-touch.
🎯 Goal: Build a step-by-step representation of customer journeys and apply last-click and multi-touch attribution models to assign credit to marketing channels.
📋 What You'll Learn
Create a dictionary called customer_journeys with exact customer IDs as keys and lists of marketing channels as values.
Create a variable called last_click_credit to store the last-click attribution results.
Create a variable called multi_touch_credit to store the multi-touch attribution results.
Use a for loop with variables customer and channels to iterate over customer_journeys.items().
Assign full credit to the last channel in each journey for last-click attribution.
Assign equal credit to all channels in each journey for multi-touch attribution.
💡 Why This Matters
🌍 Real World
Marketers use attribution models to understand which marketing channels help drive sales and how to allocate budgets effectively.
💼 Career
Digital marketing analysts and managers rely on attribution models to measure campaign performance and optimize marketing strategies.
Progress0 / 4 steps
1
Create customer journeys data
Create a dictionary called customer_journeys with these exact entries: 'C001': ['Email', 'Social Media', 'Paid Search'], 'C002': ['Direct', 'Email'], and 'C003': ['Social Media', 'Paid Search', 'Email'].
Digital Marketing
Need a hint?

Use a dictionary with customer IDs as keys and lists of channels as values.

2
Set up attribution result containers
Create two empty dictionaries called last_click_credit and multi_touch_credit to store attribution results.
Digital Marketing
Need a hint?

Use empty dictionaries to store the attribution credits for each channel.

3
Calculate last-click and multi-touch attribution
Use a for loop with variables customer and channels to iterate over customer_journeys.items(). For last-click attribution, assign full credit (1) to the last channel in channels. For multi-touch attribution, assign equal credit (1 divided by the number of channels) to each channel in channels. Update last_click_credit and multi_touch_credit dictionaries accordingly, adding to existing values if the channel appears multiple times.
Digital Marketing
Need a hint?

Remember to add credit to existing values using dict.get(key, 0) to avoid overwriting.

4
Complete attribution model setup
Add a comment at the end of the code explaining that last_click_credit shows the total credit per channel using last-click attribution, and multi_touch_credit shows the total credit per channel using multi-touch attribution.
Digital Marketing
Need a hint?

Write a clear comment summarizing what each dictionary represents.