Answer "which pages are winning in search, and why" by layering three views of the same URLs. Search Console is the source of truth for your own performance; Ahrefs adds competitive context; GA4 tells you whether the traffic is worth anything.
Steps
-
Get your top pages by real search traffic. Call
google_search_console.querywithdimensions: ["page"], a 28-day window, androwLimit: 100. Sort the result by clicks descending. This is ground truth. Use it, not Ahrefs estimates, whenever the site is verified in Search Console. -
Get the queries behind the top pages. Re-query with
dimensions: ["page", "query"]over the same window. Group by page and keep the top ~10 queries per page. This tells you what each page actually ranks for, which is usually broader than what it was written for. -
Add competitive context (if Ahrefs is connected). Call
ahrefs.top_pageswith the site astargetto get estimated traffic value and ranking keyword counts per page. Traffic value is the number worth surfacing, because it separates a page pulling 10k low-intent visits from one pulling 500 visits that are worth real money. -
Check whether the traffic converts. Call
google_analytics.run_reportwithdimensions: ["landingPage"],metrics: ["sessions", "engagementRate", "conversions"](add"totalRevenue"for ecommerce), same date range. Join to the Search Console pages on the URL path. -
Report. One table, one row per page: clicks, impressions, average position, top query, engagement rate, conversions, and Ahrefs traffic value where available. Sort by clicks. Then call out the two or three pages with high clicks but weak engagement or conversions. Those are the real findings, not the leaderboard itself.
Gotchas
- Join on the URL path, not the full URL. Search Console returns absolute URLs (
https://example.com/pricing); GA4'slandingPageis a path (/pricing). Normalize both to the path, strip trailing slashes and query strings, before joining. - Search Console data lags 2 to 3 days. Never end the window at today or you'll report a fake cliff. End it 3 days back.
- Search Console truncates. Rows are capped and low-volume queries are omitted for privacy, so per-page query clicks won't sum to the page total. Don't present the gap as missing traffic.
- Ahrefs traffic is modelled, not measured. When both are available, quote Search Console for your own numbers and use Ahrefs only for value estimates and competitor comparison. If they disagree, say so rather than averaging them.
- Average position is an average. A page at "position 8.4" may rank 3rd for its main term and 40th for a long tail. Don't optimize off it without looking at the per-query rows.