How to calculate Click-Through Rate (CTR)

Click-through rate is the percentage of people who saw an ad, link or email and clicked it.

Formula

CTR = clicks ÷ impressions × 100

SQL query

This example assumes: ad_stats(campaign, day, impressions, clicks). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.

SELECT campaign,
       SUM(impressions) AS impressions,
       SUM(clicks)      AS clicks,
       SUM(clicks) * 100.0 / NULLIF(SUM(impressions), 0) AS ctr_pct
FROM ad_stats
WHERE day >= CURRENT_DATE - 30
GROUP BY campaign
ORDER BY ctr_pct DESC;

Common mistakes that make Click-Through Rate (CTR) wrong

  • Averaging daily CTRs weights a day with 10 impressions like a day with 10,000; sum clicks and impressions first.
  • Campaigns with tiny impression counts show extreme CTRs.
  • Accidental or bot clicks inflate it without any business value.

Ask for Click-Through Rate (CTR) in plain English

Instead of writing the query yourself, you can type the question. SchemaChat turns it into SQL against your connected database or uploaded file, runs it, and shows the SQL and the figures it used so you can check the answer before you share it. It does not replace your judgement about the definition: check that the query matches the formula your business uses.

  • Which campaigns have the highest click-through rate this month?
  • How did CTR change week by week?

Frequently asked questions

What is Click-Through Rate (CTR)?
Click-through rate is the percentage of people who saw an ad, link or email and clicked it.
How do you calculate Click-Through Rate (CTR)?
CTR = clicks ÷ impressions × 100. The SQL example on this page shows the same calculation against a simple table.
What commonly goes wrong when calculating Click-Through Rate (CTR)?
Averaging daily CTRs weights a day with 10 impressions like a day with 10,000; sum clicks and impressions first.