ARTICLE AD BOX
I'm building an SEO dashboard where I want to:
Merge Google Search Console page data with my audit scores
Find out if better audit scores actually lead to more traffic (correlation)
Automatically detect unusual spikes or drops in daily impressions/clicks
I've been doing this manually in spreadsheets, but it's slow and doesn't scale. I'm looking for a programmatic TypeScript solution.
What I have:
typescript
// GSC data from my Search Console API const gscPages = [ { url: '/blog/react-seo', clicks: 1240, impressions: 18500, ctr: 0.067, position: 4.2 }, { url: '/blog/meta-tags', clicks: 380, impressions: 9200, ctr: 0.041, position: 8.7 }, { url: '/blog/seo-audit', clicks: 55, impressions: 3100, ctr: 0.018, position: 19.1 }, ]; // Audit scores from my audit tool const auditResults = [ { url: '/blog/react-seo', score: 88, issues: [] }, { url: '/blog/meta-tags', score: 71, issues: [] }, { url: '/blog/seo-audit', score: 44, issues: [] }, ]; // Daily impressions time series const dailyData = [ { date: '2026-02-01', value: 8500 }, { date: '2026-02-02', value: 8900 }, { date: '2026-02-05', value: 24800 }, // possible spike? { date: '2026-02-07', value: 2100 }, // possible drop? ];What I need:
Merge GSC data with audit results by URL (they don't always match exactly due to trailing slashes, protocol differences, etc.)
Compute a Pearson correlation between audit scores and click counts
Detect statistically significant anomalies in time-series data
Identify "striking distance" queries (ranked 4–20) that are quick-win opportunities
Expected output:
// Correlation result { correlation: 0.741, topOpportunities: [...] } // Anomaly result [ { date: '2026-02-05', value: 24800 }, // spike { date: '2026-02-07', value: 2100 }, // drop ] // Ranking buckets [ { range: '1-3', count: 12 }, { range: '4-10', count: 34 }, { range: '11-20', count: 28 }, ]