Attribution models (last-click, multi-touch) in Digital Marketing - Time & Space Complexity
Start learning this pattern below
Jump into concepts and practice - no test required
When analyzing attribution models, we want to understand how the effort to assign credit grows as the number of customer interactions increases.
How does the time to calculate attribution change when more touchpoints are involved?
Analyze the time complexity of the following simplified attribution calculation.
function calculateAttribution(touchpoints) {
let credit = {};
for (let i = 0; i < touchpoints.length; i++) {
let channel = touchpoints[i];
credit[channel] = (credit[channel] || 0) + 1;
}
return credit;
}
This code counts how many times each marketing channel appears in a customer's journey.
Identify the loops, recursion, array traversals that repeat.
- Primary operation: Looping through each touchpoint once.
- How many times: Exactly once per touchpoint in the journey.
As the number of touchpoints grows, the time to assign credit grows proportionally.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | 10 steps to count channels |
| 100 | 100 steps to count channels |
| 1000 | 1000 steps to count channels |
Pattern observation: Doubling touchpoints doubles the work needed.
Time Complexity: O(n)
This means the time to calculate attribution grows directly with the number of touchpoints.
[X] Wrong: "Attribution calculation time stays the same no matter how many touchpoints there are."
[OK] Correct: Each touchpoint must be checked to assign credit, so more touchpoints mean more work.
Understanding how attribution calculations scale helps you explain data processing in marketing tools clearly and confidently.
What if we changed the model to assign credit only to the last touchpoint? How would the time complexity change?
Practice
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 BQuick Check:
Last-click = final ad credit [OK]
- Thinking credit is shared among all ads
- Confusing last-click with first-click attribution
- Assuming cost affects credit distribution
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 CQuick Check:
Multi-touch = shared credit [OK]
- Confusing multi-touch with last-click
- Thinking only one ad gets credit
- Assuming credit depends on ad cost
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 DQuick Check:
Last-click credit = last ad clicked [OK]
- Giving credit to the first or middle ad
- Sharing credit equally in last-click model
- Confusing last-click with multi-touch
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 AQuick Check:
Single ad credit = last-click, not multi-touch [OK]
- Assuming multi-touch always shares credit equally
- Ignoring model settings
- Confusing ad cost with credit assignment
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 AQuick Check:
Credit split matches model percentages [OK]
- Ignoring view credit
- Splitting credit equally instead of weighted
- Confusing first and last click percentages
