Skip to content
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

Open
wants to merge 62 commits into
base: main
Choose a base branch
from

Conversation

dipratap
Copy link
Contributor

@dipratap dipratap commented Jan 9, 2025

Calculating projected traffic and projected traffic value for metadata opportunity as per wiki.

  • Fetches organic traffic from RUM using traffic-acquisition handler in rumapiclient.
  • Identifies CPC value for the domain using wiki
  • Stores the projected traffic details in the audit results and opportunity

Copy link

github-actions bot commented Jan 9, 2025

This PR will trigger a patch release when merged.

@dipratap dipratap changed the title fix: projected traffic calculation for meta-tags (draft) fix: projected traffic calculation for meta-tags Jan 16, 2025
src/metatags/handler.js Outdated Show resolved Hide resolved
Copy link
Contributor

@habansal habansal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

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;
Copy link
Contributor

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

Copy link
Contributor Author

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.

log.warn(`No rum data found for ${endpoint}`);
return 0;
}
const trafficSum = target.earned;
Copy link
Contributor

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

Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants