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

feat: adding new forms opportunity and sending urls for scraping #649

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

Conversation

05rahulsingh
Copy link
Contributor

Please ensure your pull request adheres to the following guidelines:

  • make sure to link the related issues in this description
  • when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes

Related Issues

Thanks for contributing!

siteId: auditData.siteId,
auditId: auditData.id,
runbook: 'https://adobe.sharepoint.com/:w:/s/AEM_Forms/EU_cqrV92jNIlz8q9gxGaOMBSRbcwT9FPpQX84bRKQ9Phw?e=Nw9ZRz',
type: 'high-page-views-low-form-cta',
Copy link
Contributor

Choose a reason for hiding this comment

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

Low-form-ctr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

type: 'high-page-views-low-form-cta',
origin: 'AUTOMATION',
title: 'Form has low views but CTA page has high views',
description: 'Form has low views but CTA page has high view',
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: views

Copy link
Contributor

@nit23uec nit23uec Feb 13, 2025

Choose a reason for hiding this comment

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

We should rewrite desc as
The page containing the form CTA has high views but low CTR for the form CTA

runbook: 'https://adobe.sharepoint.com/:w:/s/AEM_Forms/EU_cqrV92jNIlz8q9gxGaOMBSRbcwT9FPpQX84bRKQ9Phw?e=Nw9ZRz',
type: 'high-page-views-low-form-cta',
origin: 'AUTOMATION',
title: 'Form has low views but CTA page has high views',
Copy link
Contributor

Choose a reason for hiding this comment

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

But conversion element has low CTR

log.info(`Triggering scrape for [${JSON.stringify(uniqueUrls, null, 2)}]`);
if (uniqueUrls.size > 0) {
await sqs.sendMessage(process.env.SCRAPING_JOBS_QUEUE_URL, {
processingType: 'default',
Copy link
Contributor

Choose a reason for hiding this comment

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

ProcessingType : form

}

const { formVitals } = auditData.auditResult;
const formOpportunities = generateOpptyDataForHighPageViewsLowFormCTA(formVitals);
Copy link
Contributor

Choose a reason for hiding this comment

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

LowFormCTR

* @param auditData - The audit data containing the audit result and additional details.
* @param context - The context object containing the data access and logger objects.
*/
export default async function highPageViewsLowFormCTAOpportunity(auditUrl, auditData, context) {
Copy link
Contributor

Choose a reason for hiding this comment

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

LowFormCTR

export default async function highPageViewsLowFormCTAOpportunity(auditUrl, auditData, context) {
const { dataAccess, log } = context;
const { Opportunity } = dataAccess;
log.info(`Syncing high page views low form cta opportunity for ${auditData.siteId}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

CTR


try {
const opportunities = await Opportunity.allBySiteIdAndStatus(auditData.siteId, 'NEW');
highPageViewsLowFormCtaOppty = opportunities.find((oppty) => oppty.getType() === 'high-page-views-low-form-cta');
Copy link
Contributor

Choose a reason for hiding this comment

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

low-form-ctr

const opportunityData = {
siteId: auditData.siteId,
auditId: auditData.id,
runbook: 'https://adobe.sharepoint.com/:w:/s/AEM_Forms/EU_cqrV92jNIlz8q9gxGaOMBSRbcwT9FPpQX84bRKQ9Phw?e=Nw9ZRz',
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you pls create a unique runbook for this besides the existing one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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


const uniqueUrls = new Set();
formOpportunities.forEach((opptyData) => {
uniqueUrls.add(opptyData.url);
Copy link
Contributor

@nit23uec nit23uec Feb 13, 2025

Choose a reason for hiding this comment

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

This url should be of the page containing CTA

Copy link
Contributor

@nit23uec nit23uec left a comment

Choose a reason for hiding this comment

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

Inline comments

);

// const formVitalsByDevice = aggregateFormVitalsByDevice(formVitalsCollection);
return getHighPageViewsLowFormCtrMetrics(formVitalsCollection, 7).map(convertToOpportunityData);
Copy link
Contributor

Choose a reason for hiding this comment

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

Oppoty data would need some changes for this oppoty type.
CtaPageUrl
MaxCTR
formCTR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oppty data for high page views low form ctr has
{
url: 'https://www.surest.com/newsletter',
pageViews: 8670,
formViews: 300,
formEngagement: 300,
CTA: {
url: 'https://www.surest.com/about-us',
source: '#teaser-related02 .cmp-teaser__action-link',
},
}

Copy link

This PR will trigger a minor release when merged.

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.

2 participants