Bird
Raised Fist0
Digital Marketingknowledge~5 mins

Attribution models (last-click, multi-touch) in Digital Marketing - Time & Space Complexity

Choose your learning style10 modes available

Start learning this pattern below

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
Time Complexity: Attribution models (last-click, multi-touch)
O(n)
Understanding Time Complexity

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?

Scenario Under Consideration

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 Repeating Operations

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.
How Execution Grows With Input

As the number of touchpoints grows, the time to assign credit grows proportionally.

Input Size (n)Approx. Operations
1010 steps to count channels
100100 steps to count channels
10001000 steps to count channels

Pattern observation: Doubling touchpoints doubles the work needed.

Final Time Complexity

Time Complexity: O(n)

This means the time to calculate attribution grows directly with the number of touchpoints.

Common Mistake

[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.

Interview Connect

Understanding how attribution calculations scale helps you explain data processing in marketing tools clearly and confidently.

Self-Check

What if we changed the model to assign credit only to the last touchpoint? How would the time complexity change?

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

  1. Step 1: Understand last-click attribution

    Last-click attribution assigns 100% credit to the last ad clicked before a purchase.
  2. Step 2: Compare with other models

    Unlike multi-touch models, it does not share credit among multiple ads.
  3. Final Answer:

    Gives all credit to the final ad clicked before purchase -> Option B
  4. 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

  1. Step 1: Define multi-touch attribution

    Multi-touch attribution divides credit among several ads that helped influence the customer.
  2. Step 2: Eliminate incorrect options

    It does not give all credit to just one ad or ignore ads based on cost or click rate.
  3. Final Answer:

    It shares credit among multiple ads that influenced the customer -> Option C
  4. 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

  1. Step 1: Identify the last ad clicked

    The customer clicked Ad A, then Ad B, and lastly Ad C before purchase.
  2. Step 2: Apply last-click attribution rule

    Last-click attribution gives 100% credit to the final ad clicked, which is Ad C.
  3. Final Answer:

    Ad C -> Option D
  4. 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

  1. Step 1: Understand expected multi-touch behavior

    Multi-touch should share credit among multiple ads, not just one.
  2. 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.
  3. Final Answer:

    They are actually using a last-click model by mistake -> Option A
  4. 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

  1. Step 1: Identify credit percentages per interaction type

    First click gets 40%, views get 20%, last click gets 40% credit.
  2. Step 2: Assign credit to each ad

    Ad X is first click -> 40%, Ad Y is viewed -> 20%, Ad Z is last click -> 40%.
  3. Final Answer:

    Ad X: 40%, Ad Y: 20%, Ad Z: 40% -> Option A
  4. Quick Check:

    Credit split matches model percentages [OK]
Hint: Match credit percentages to ad interaction types [OK]
Common Mistakes:
  • Ignoring view credit
  • Splitting credit equally instead of weighted
  • Confusing first and last click percentages