Skip to content

Commit

Permalink
Merge pull request #1080 from adobe/eventRegistryAJOOnly
Browse files Browse the repository at this point in the history
[PDCL-11254] limit personalization event storage to only AJO campaigns
  • Loading branch information
jonsnyder authored Oct 31, 2023
2 parents 2266556 + 2988332 commit 3539519
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/DecisioningEngine/createEventRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import {
createSaveStorage,
getExpirationDate,
getActivityId,
hasExperienceData
hasExperienceData,
getDecisionProvider
} from "./utils";
import { EVENT_TYPE_TRUE } from "../../constants/eventType";
import { ADOBE_JOURNEY_OPTIMIZER } from "../../constants/decisionProvider";

const STORAGE_KEY = "events";
const MAX_EVENT_RECORDS = 1000;
Expand Down Expand Up @@ -129,6 +131,9 @@ export default ({ storage }) => {
.filter(validPropositionEventType)
.forEach(propositionEventType => {
propositions.forEach(proposition => {
if (getDecisionProvider(proposition) !== ADOBE_JOURNEY_OPTIMIZER) {
return;
}
addEvent(
{},
propositionEventType,
Expand Down
6 changes: 6 additions & 0 deletions src/components/DecisioningEngine/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ export const hasExperienceData = xdm => {

return true;
};

export const getDecisionProvider = proposition => {
const { scopeDetails = {} } = proposition;
const { decisionProvider } = scopeDetails;
return decisionProvider;
};
12 changes: 12 additions & 0 deletions src/constants/decisionProvider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Copyright 2023 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
export const ADOBE_JOURNEY_OPTIMIZER = "AJO";
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ describe("DecisioningEngine:createEventRegistry", () => {
id: "222#bbb"
}
}
},
{
id: "333",
scope: "web://something",
scopeDetails: {
decisionProvider: "TGT",
correlationID: "aasfsdf",
activity: {
id: "333#ccc"
}
}
}
],
propositionEventType: {
Expand Down

0 comments on commit 3539519

Please sign in to comment.