Back to articles
Detecting Keyword Cannibalization with the Search Console API

Detecting Keyword Cannibalization with the Search Console API

via Dev.to JavaScriptTugelbay Konabayev

What is Keyword Cannibalization When multiple pages on your site compete for the same search query, Google splits ranking signals between them. Neither page ranks as well as a single consolidated page would. This is keyword cannibalization. Detection Algorithm async function detectCannibalization ( siteUrl , days = 28 ) { const res = await webmasters . searchanalytics . query ({ siteUrl , requestBody : { startDate : daysAgo ( days ), endDate : today (), dimensions : [ " query " , " page " ], rowLimit : 5000 } }); // Group by query const queryMap = {}; for ( const row of res . data . rows ) { const query = row . keys [ 0 ]; const page = row . keys [ 1 ]; if ( ! queryMap [ query ]) queryMap [ query ] = []; queryMap [ query ]. push ({ page , position : row . position , impressions : row . impressions }); } // Find queries with 2+ pages return Object . entries ( queryMap ) . filter (([ _ , pages ]) => pages . length >= 2 ) . map (([ query , pages ]) => ({ query , pages : pages . sort (( a

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
2 views

Related Articles