Marketing Analytics Path · Mission 19 of 25Hard

How many organic purchases?

Use IS NULL to identify unattributed organic conversions

Back to Marketing Analytics

The Brief

Marcus BellHead of Growthanalytics-help

Not every purchase is tied to a campaign. How many purchases happened organically — meaning no campaign_id attached? I need the count and total revenue. Exclude refunds. This tells us what we earn without any marketing spend.

You'll practice

IS NULLAttribution

Tables available

fact_purchases

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

Organic = no campaign. Filter `fact_purchases` with `WHERE campaign_id IS NULL AND amount > 0`

Hint 2

Important: use `IS NULL`, not `= NULL` — the equals operator doesn't work with NULL in SQL

Hint 3

Aggregate both metrics in one query: `COUNT(*) AS organic_purchases, ROUND(SUM(amount)::numeric, 2) AS organic_revenue`