-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: projected traffic calculation for meta-tags #573
base: main
Are you sure you want to change the base?
Conversation
This PR will trigger a patch release when merged. |
…rker into metrics-automate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
src/support/utils.js
Outdated
log.warn(`Invalid organic traffic data present for ${siteId} - cost:${lastTraffic.cost} value:${lastTraffic.value}, Using Default CPC value.`); | ||
return DEFAULT_CPC_VALUE; | ||
} | ||
return lastTraffic.cost / lastTraffic.value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dipratap this cost value is in cents, as in this ahrefs doc and discussed in slack.
For Bamboo, this came as 229, but that's a very high number for CPC, so, we should divide this by 100 and return the property CPC value in USD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rpapani for spotting. I will update this.
src/metatags/handler.js
Outdated
log.warn(`No rum data found for ${endpoint}`); | ||
return 0; | ||
} | ||
const trafficSum = target.earned; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
earned and owned is considered organic traffic, I think you should add target.owned
as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpapani As per my understanding, for metadata, actual organic traffic that comes from searches and paid display ads(might show title or description in link preview) is considered. Metatags generally don't contribute to traffic coming from users directly coming to the page. Can you please share why should the owned one be considered as well?
Calculating projected traffic and projected traffic value for metadata opportunity as per wiki.
traffic-acquisition
handler in rumapiclient.