Skip to content

Commit

Permalink
fix: Fixes wrong CTR value for Search Console Data
Browse files Browse the repository at this point in the history
fixes #48
  • Loading branch information
towfiqi committed Jan 11, 2023
1 parent b50733d commit cb24696
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/searchConsole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const fetchSearchConsoleData = async (domainName:string, days:number, type?:stri
date: row.keys[0],
clicks: row.clicks,
impressions: row.impressions,
ctr: row.ctr,
ctr: row.ctr * 100,
position: row.position,
});
});
Expand Down Expand Up @@ -101,7 +101,7 @@ export const parseSearchConsoleItem = (SCItem: SearchAnalyticsRawItem, domainNam
const page = SCItem.keys[3] ? SCItem.keys[3].replace('https://', '').replace('http://', '').replace('www', '').replace(domainName, '') : '';
const uid = `${country.toLowerCase()}:${device}:${keyword.replaceAll(' ', '_')}`;

return { keyword, uid, device, country, clicks, impressions, ctr, position, page };
return { keyword, uid, device, country, clicks, impressions, ctr: ctr * 100, position, page };
};

export const integrateKeywordSCData = (keyword: KeywordType, SCData:SCDomainDataType) : KeywordType => {
Expand Down

0 comments on commit cb24696

Please sign in to comment.