Skip to content

Commit

Permalink
feat: introduce Opportunity creation for Broken Backlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
dzehnder committed Nov 21, 2024
1 parent 5dfe5fe commit e42c99a
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/backlinks/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,35 @@ export default async function auditBrokenBacklinks(message, context) {
auditResult,
};

await dataAccess.addAudit(auditData);
const audit = await dataAccess.addAudit(auditData);
const data = {
type,
url: site.getBaseURL(),
auditContext,
auditResult,
};

const opportunityData = {
siteId: site.getId(),
auditId: audit.getId(),
runbook: 'https://adobe.sharepoint.com/:w:/r/sites/aemsites-engineering/_layouts/15/doc2.aspx?sourcedoc=%7BAC174971-BA97-44A9-9560-90BE6C7CF789%7D&file=Experience_Success_Studio_Broken_Backlinks_Runbook.docx&action=default&mobileredirect=true',
type: 'broken-backlinks',
origin: 'AUTOMATION',
title: 'Authoritative Domains are linking to invalid URLs. This could impact your SEO.',
description: 'Provide the correct target URL that each of the broken backlinks should be redirected to.',
guidance: {
steps: [
'Review the list of broken target URLs and the suggested redirects.',
'Manually override redirect URLs as needed.',
'Copy redirects.',
'Paste new entries in your website redirects file.',
'Publish the changes.',
],
},
tags: ['traffic-acquisition'],
};

dataAccess.Opportunity.create(opportunityData);
await sqs.sendMessage(queueUrl, data);

log.info(`Successfully audited ${siteId} for ${type} type audit`);
Expand Down

0 comments on commit e42c99a

Please sign in to comment.