Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
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
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
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
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
Hint
Write a clear comment summarizing what each dictionary represents.
Practice
(1/5)
1. What does the last-click attribution model do in digital marketing?
easy
A. Distributes credit based on ad cost
B. Gives all credit to the final ad clicked before purchase
C. Ignores the last ad clicked and credits the first one
D. Shares credit equally among all ads seen
Solution
Step 1: Understand last-click attribution
Last-click attribution assigns 100% credit to the last ad clicked before a purchase.
Step 2: Compare with other models
Unlike multi-touch models, it does not share credit among multiple ads.
Final Answer:
Gives all credit to the final ad clicked before purchase -> Option B
Quick Check:
Last-click = final ad credit [OK]
Hint: Last-click means credit goes to the last ad clicked [OK]
Common Mistakes:
Thinking credit is shared among all ads
Confusing last-click with first-click attribution
Assuming cost affects credit distribution
2. Which of the following correctly describes a multi-touch attribution model?
easy
A. It ignores all ads except the most expensive one
B. It gives all credit to the first ad clicked
C. It shares credit among multiple ads that influenced the customer
D. It credits only the ad with the highest click rate
Solution
Step 1: Define multi-touch attribution
Multi-touch attribution divides credit among several ads that helped influence the customer.
Step 2: Eliminate incorrect options
It does not give all credit to just one ad or ignore ads based on cost or click rate.
Final Answer:
It shares credit among multiple ads that influenced the customer -> Option C
Quick Check:
Multi-touch = shared credit [OK]
Hint: Multi-touch means credit is shared among ads [OK]
Common Mistakes:
Confusing multi-touch with last-click
Thinking only one ad gets credit
Assuming credit depends on ad cost
3. Consider a customer who saw three ads: Ad A, Ad B, and Ad C. They clicked Ad A first, then Ad B, and finally Ad C before purchasing. In a last-click attribution model, which ad gets full credit?
medium
A. Ad A
B. All ads share credit equally
C. Ad B
D. Ad C
Solution
Step 1: Identify the last ad clicked
The customer clicked Ad A, then Ad B, and lastly Ad C before purchase.
Step 2: Apply last-click attribution rule
Last-click attribution gives 100% credit to the final ad clicked, which is Ad C.
Final Answer:
Ad C -> Option D
Quick Check:
Last-click credit = last ad clicked [OK]
Hint: Last-click means credit goes to the last clicked ad [OK]
Common Mistakes:
Giving credit to the first or middle ad
Sharing credit equally in last-click model
Confusing last-click with multi-touch
4. A marketer uses a multi-touch attribution model but notices all credit is going to only one ad. What is the most likely error?
medium
A. They are actually using a last-click model by mistake
B. They shared credit equally among all ads
C. They ignored the last ad clicked
D. They gave credit based on ad cost
Solution
Step 1: Understand expected multi-touch behavior
Multi-touch should share credit among multiple ads, not just one.
Step 2: Identify why all credit goes to one ad
If all credit goes to one ad, likely the last-click model is used instead of multi-touch.
Final Answer:
They are actually using a last-click model by mistake -> Option A
Quick Check:
Single ad credit = last-click, not multi-touch [OK]
Hint: All credit to one ad? Check if last-click model is used [OK]
Common Mistakes:
Assuming multi-touch always shares credit equally
Ignoring model settings
Confusing ad cost with credit assignment
5. A customer interacted with three ads: Ad X (first click), Ad Y (viewed but not clicked), and Ad Z (last click). Using a multi-touch attribution model that gives 40% credit to first click, 20% to views, and 40% to last click, how is the credit distributed?
hard
A. Ad X: 40%, Ad Y: 20%, Ad Z: 40%
B. Ad X: 33%, Ad Y: 33%, Ad Z: 33%
C. Ad X: 0%, Ad Y: 50%, Ad Z: 50%
D. Ad X: 100%, Ad Y: 0%, Ad Z: 0%
Solution
Step 1: Identify credit percentages per interaction type
First click gets 40%, views get 20%, last click gets 40% credit.
Step 2: Assign credit to each ad
Ad X is first click -> 40%, Ad Y is viewed -> 20%, Ad Z is last click -> 40%.
Final Answer:
Ad X: 40%, Ad Y: 20%, Ad Z: 40% -> Option A
Quick Check:
Credit split matches model percentages [OK]
Hint: Match credit percentages to ad interaction types [OK]