Marketing Attribution wrong numbers

Hello everyone! It’s actually my first post here, and I’m a total newbie in programming.
So, I’ve been doing the named project, and actually everything works, but at the very last task I get numbers, which are different from the answer.

"6. How many last touches on the purchase page is each campaign responsible for?

This query will look similar to your last-touch query, but with an additional WHERE clause."

so, the answer in the video is 115 - 113 - 54 - 52 - 9 - 9 - 7 - 2
and mine is 114 - 112 - 53 - 9 - 9 - 7 - 2.

I wouldn’t be surprised if the answer was completely different or nothing worked, but this partial difference really confuses me.
On top of it, previous query from question 5 was to count total "last touches on the purchase page " and it returned 361, whuch is a sum of correct answer, not mine. So it means, that 3 “last touches” were lost somewhere between the queries. Does anyone have any idea, where and why were they lost? Thanks in advance! (code included below - a bit different from the given sample, but yet everything else worked and gave correct results)

WITH last_touch_x AS
(
SELECT
user_id,
MAX(timestamp) AS last_touch_time,
utm_campaign,
utm_source
FROM page_visits
GROUP BY user_id
)

SELECT
COUNT(ltx.user_id),
ltx.last_touch_time,
pv.utm_source,
pv.utm_campaign
FROM last_touch_x AS ltx
JOIN page_visits AS pv
ON ltx.user_id = pv.user_id
AND ltx.last_touch_time = pv.timestamp
WHERE page_name = ‘4 - purchase’
GROUP BY 4
ORDER BY 1 DESC;

Strange, I don’t think this is an error in your code but rather a result in the database you are accessing.

I am wondering where this data come’s from and if it’s there to be used or if you create that data yourself.

Also do you have a link to the video you are mentioning ?

This is probably unrelated but i think it is better to use LIKE when you are checking on strings.

WHERE page_name LIKE '4 - purchase'

Some information on this. LIKE vs EQUALS(=)

Hello biirra!
Thanks a lot for your reply!
Here is the link to the video which I mentioned: https://youtu.be/5dIuXojqfMg

I think it is because your query is just different from the one in the video.
In the video they are counting pv.utm_campaign and not ltx.user_id.

image