Skip to content

Commit

Permalink
feat: high bounce rate and low ctr opportunities
Browse files Browse the repository at this point in the history
  • Loading branch information
ekremney committed Aug 29, 2024
1 parent 64a0804 commit 9f3607e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@adobe/spacecat-shared-data-access": "1.43.3",
"@adobe/spacecat-shared-google-client": "1.2.2",
"@adobe/spacecat-shared-http-utils": "1.6.8",
"@adobe/spacecat-shared-rum-api-client": "2.8.0",
"@adobe/spacecat-shared-rum-api-client": "https://gitpkg.now.sh/adobe/spacecat-shared/packages/spacecat-shared-rum-api-client?9b54c84d774a490e107c56c51db8d7a38562c8c9",
"@adobe/spacecat-shared-rum-api-client-v1": "npm:@adobe/[email protected]",
"@aws-sdk/client-lambda": "3.637.0",
"@aws-sdk/credential-provider-node": "3.637.0",
Expand Down
11 changes: 8 additions & 3 deletions src/opportunities/opportunities.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ import { AuditBuilder } from '../common/audit-builder.js';
import { getRUMDomainkey } from '../support/utils.js';

const DAYS = 30;
const OPPTY_QUERIES = [
'exp-opportunity/rage-click',
'exp-opportunity/high-inorganic-high-bounce-rate',
'exp-opportunity/high-organic-low-bounce-rate',
];

let log = console;

Expand All @@ -40,13 +45,13 @@ export async function opportunitiesHandler(auditUrl, context, site) {
interval: DAYS,
granularity: 'hourly',
};
const experimentationHandlers = ['rageclick'];
const queryResults = await rumAPIClient.queryMulti(experimentationHandlers, options);

const queryResults = await rumAPIClient.queryMulti(OPPTY_QUERIES, options);
const auditData = {
experimentationOpportunities: [],
};
for (const queryResult of Object.keys(queryResults)) {
if (experimentationHandlers.includes(queryResult)) {
if (OPPTY_QUERIES.includes(queryResult)) {
auditData.experimentationOpportunities.push(...queryResults[queryResult]);
}
}
Expand Down

0 comments on commit 9f3607e

Please sign in to comment.