Skip to content

Commit

Permalink
SITES-22537 [oppty] Pages with steady decline of CTR
Browse files Browse the repository at this point in the history
  • Loading branch information
Dereje Dilnesaw committed Aug 21, 2024
1 parent ff4c4e5 commit 0f1a7ab
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ function handler(bundles) {
data[bundle.url][weekKey].clicks += Object.keys(selector).length * bundle.weight;
data[bundle.url][weekKey].pageCTR = (data[bundle.url][weekKey].clicks / data[bundle.url][weekKey].pageViews) * 100;

// Calculate CTR for each unique selector and add to metrics array
// for (const [source] of Object.entries(selector)) {
// const ctr = (1 / data[bundle.url][weekKey].pageViews) * 100;
// data[bundle.url][weekKey].metrics.push({ selector: source, ctr });
// }
let uniqueSelectors = new Set();

for (const event of bundle.events) {
Expand All @@ -85,6 +80,7 @@ function handler(bundles) {
data[bundle.url][weekKey].metrics.push({ selector: source, ctr });
}
}
data[bundle.url][weekKey].metrics = data[bundle.url][weekKey].metrics.filter(metric => metric.ctr >= 5);
}
// remove pages with less than 5000 page views per day on average for the last 28 days
for (const url in data) {
Expand Down

0 comments on commit 0f1a7ab

Please sign in to comment.