FORUM Product Analytics Choice of numerator for calculating conversion rate?

Choice of numerator for calculating conversion rate?

144. Signup rate per device type

I got the right answer (and same SQL results) for the exercise even though I counted event action ‘Signup’ instead of DISTINCT pageview_id.

As a rule of thumb, I understand that it’s preferable to count unique identifiers for conversion rates. But are there any risks to using my method below?

My query is below for reference:

SELECT p.device_type, 100.0* COUNT(action) / COUNT(DISTINCT visitor_id) AS cvr
FROM web_analytics.pageviews p
LEFT JOIN
web_analytics.events e
ON p.pageview_id = e.pageview_id
AND e.action = 'Signup'
WHERE url LIKE '%/books/%'
GROUP BY 1
ORDER BY 2 DESC

REPLIES

Hi @Alex 👋

Great question!

Let’s think out loud together.

Point 1: Self-documented code

When I read a statement like COUNT(action) it doesn’t really tell me your intention — are we really counting actions? 🤔 If we count events, I’d expect some kind of ID inside the COUNT() function.

When looking at the signup rate, we’re basically answering the question “Given 100 page visitors, how many signed up?”. In other words, to calculate the signup rate, we should have visitors in the numerator and denominator. 💡

Point 2: Duplicates

Another problem with COUNT(action) is in the LEFT JOIN — if a user has event duplicates (imagine if we calculate a CTR of a play button or we have a bug in JavaScript code that fires an event twice) we’ll report a higher CTR. 💣

I hope that helps, Alex 🍻

WRITE A REPLY