diff --git a/packages/storefront-events-collector/src/handlers/account/createAccountAEP.ts b/packages/storefront-events-collector/src/handlers/account/createAccountAEP.ts index 5194fc96..3856e8f7 100644 --- a/packages/storefront-events-collector/src/handlers/account/createAccountAEP.ts +++ b/packages/storefront-events-collector/src/handlers/account/createAccountAEP.ts @@ -4,10 +4,11 @@ import * as sdkSchemas from "@adobe/magento-storefront-events-sdk/src/types/sche import { sendEvent } from "../../alloy"; import { createAccountPayload } from "../../../src/utils/aep/account"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "userAccount.createProfile"; const aepHandler = async (event: Event): Promise => { - const { debugContext, accountContext, customContext } = event.eventInfo; + const { debugContext, accountContext, storefrontInstanceContext, customContext } = event.eventInfo; const payload = createAccountPayload(customContext, accountContext as sdkSchemas.Account); @@ -15,6 +16,9 @@ const aepHandler = async (event: Event): Promise => { createProfile: 1, }; + payload.commerce = payload.commerce || {}; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/account/editAccountAEP.ts b/packages/storefront-events-collector/src/handlers/account/editAccountAEP.ts index 11c5f587..3f214692 100644 --- a/packages/storefront-events-collector/src/handlers/account/editAccountAEP.ts +++ b/packages/storefront-events-collector/src/handlers/account/editAccountAEP.ts @@ -4,10 +4,11 @@ import * as sdkSchemas from "@adobe/magento-storefront-events-sdk/src/types/sche import { sendEvent } from "../../alloy"; import { createAccountPayload } from "../../../src/utils/aep/account"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "userAccount.updateProfile"; const aepHandler = async (event: Event): Promise => { - const { debugContext, accountContext, customContext } = event.eventInfo; + const { debugContext, accountContext, storefrontInstanceContext, customContext } = event.eventInfo; const payload = createAccountPayload(customContext, accountContext as sdkSchemas.Account); @@ -15,6 +16,9 @@ const aepHandler = async (event: Event): Promise => { updateProfile: 1, }; + payload.commerce = payload.commerce || {}; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/account/signInAEP.ts b/packages/storefront-events-collector/src/handlers/account/signInAEP.ts index a5a64086..d66a01e3 100644 --- a/packages/storefront-events-collector/src/handlers/account/signInAEP.ts +++ b/packages/storefront-events-collector/src/handlers/account/signInAEP.ts @@ -4,10 +4,11 @@ import * as sdkSchemas from "@adobe/magento-storefront-events-sdk/src/types/sche import { sendEvent } from "../../alloy"; import { createAccountPayload } from "../../../src/utils/aep/account"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "userAccount.login"; const aepHandler = async (event: Event): Promise => { - const { debugContext, accountContext, customContext } = event.eventInfo; + const { debugContext, accountContext, storefrontInstanceContext, customContext } = event.eventInfo; const payload = createAccountPayload(customContext, accountContext as sdkSchemas.Account); @@ -15,6 +16,9 @@ const aepHandler = async (event: Event): Promise => { login: 1, }; + payload.commerce = payload.commerce || {}; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/account/signOutAEP.ts b/packages/storefront-events-collector/src/handlers/account/signOutAEP.ts index 022609db..28c4f5ba 100644 --- a/packages/storefront-events-collector/src/handlers/account/signOutAEP.ts +++ b/packages/storefront-events-collector/src/handlers/account/signOutAEP.ts @@ -2,10 +2,11 @@ import { Event } from "@adobe/magento-storefront-events-sdk/dist/types/types/eve import { sendEvent } from "../../alloy"; import { BeaconSchema } from "../../types/aep"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "userAccount.logout"; const aepHandler = async (event: Event): Promise => { - const { debugContext, customContext } = event.eventInfo; + const { debugContext, storefrontInstanceContext, customContext } = event.eventInfo; let payload: BeaconSchema = {}; if (customContext && Object.keys(customContext as BeaconSchema).length !== 0) { @@ -17,6 +18,9 @@ const aepHandler = async (event: Event): Promise => { logout: 1, }; + payload.commerce = payload.commerce || {}; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; sendEvent(payload); diff --git a/packages/storefront-events-collector/src/handlers/checkout/placeOrderAEP.ts b/packages/storefront-events-collector/src/handlers/checkout/placeOrderAEP.ts index 7c912ca5..4f6c54d8 100644 --- a/packages/storefront-events-collector/src/handlers/checkout/placeOrderAEP.ts +++ b/packages/storefront-events-collector/src/handlers/checkout/placeOrderAEP.ts @@ -4,6 +4,7 @@ import { sendEvent } from "../../alloy"; import { BeaconSchema } from "../../types/aep"; import { createOrder } from "../../utils/aep/order"; import { createProductListItems } from "../../utils/aep/productListItems"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "commerce.purchases"; @@ -48,6 +49,8 @@ const aepHandler = async (event: Event): Promise => { value: 1, }; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/product/addToCartAEP.ts b/packages/storefront-events-collector/src/handlers/product/addToCartAEP.ts index 6a37048c..c15cf473 100644 --- a/packages/storefront-events-collector/src/handlers/product/addToCartAEP.ts +++ b/packages/storefront-events-collector/src/handlers/product/addToCartAEP.ts @@ -3,6 +3,7 @@ import { Event } from "@adobe/magento-storefront-events-sdk/dist/types/types/eve import { sendEvent } from "../../alloy"; import { BeaconSchema } from "../../types/aep"; import { createProductListItems } from "../../utils/aep/productListItems"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "commerce.productListAdds"; @@ -32,6 +33,8 @@ const aepHandler = async (event: Event): Promise => { value: 1, }; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; sendEvent(payload); diff --git a/packages/storefront-events-collector/src/handlers/product/removeFromCartAEP.ts b/packages/storefront-events-collector/src/handlers/product/removeFromCartAEP.ts index 95407616..bc9451a4 100644 --- a/packages/storefront-events-collector/src/handlers/product/removeFromCartAEP.ts +++ b/packages/storefront-events-collector/src/handlers/product/removeFromCartAEP.ts @@ -3,6 +3,7 @@ import { Event } from "@adobe/magento-storefront-events-sdk/dist/types/types/eve import { sendEvent } from "../../alloy"; import { BeaconSchema } from "../../types/aep"; import { createProductListItems } from "../../utils/aep/productListItems"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "commerce.productListRemovals"; @@ -32,6 +33,8 @@ const aepHandler = async (event: Event): Promise => { value: 1, }; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/product/viewAEP.ts b/packages/storefront-events-collector/src/handlers/product/viewAEP.ts index 8be52d8e..c8817f8b 100644 --- a/packages/storefront-events-collector/src/handlers/product/viewAEP.ts +++ b/packages/storefront-events-collector/src/handlers/product/viewAEP.ts @@ -3,6 +3,7 @@ import { Event } from "@adobe/magento-storefront-events-sdk/dist/types/types/eve import { sendEvent } from "../../alloy"; import { BeaconSchema, ProductListItem } from "../../types/aep"; import { getDiscountAmount } from "../../utils/discount"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "commerce.productViews"; @@ -38,6 +39,8 @@ const aepHandler = async (event: Event): Promise => { value: 1, }; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/requisitionList/addToRequisitionListAEP.ts b/packages/storefront-events-collector/src/handlers/requisitionList/addToRequisitionListAEP.ts index f90a9fd0..152c69ec 100644 --- a/packages/storefront-events-collector/src/handlers/requisitionList/addToRequisitionListAEP.ts +++ b/packages/storefront-events-collector/src/handlers/requisitionList/addToRequisitionListAEP.ts @@ -3,6 +3,7 @@ import { sendEvent } from "../../alloy"; import { BeaconSchema } from "../../types/aep"; import { createProductListItems } from "../../utils/aep/productListItems"; import { createRequisitionList } from "../../utils/aep/requisitionList"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "commerce.requisitionListAdds"; @@ -41,6 +42,8 @@ const handler = async (event: Event): Promise => { value: 1, }; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/requisitionList/createRequisitionListAEP.ts b/packages/storefront-events-collector/src/handlers/requisitionList/createRequisitionListAEP.ts index d7e837a6..3b8ea540 100644 --- a/packages/storefront-events-collector/src/handlers/requisitionList/createRequisitionListAEP.ts +++ b/packages/storefront-events-collector/src/handlers/requisitionList/createRequisitionListAEP.ts @@ -4,11 +4,13 @@ import { sendEvent } from "../../alloy"; import { BeaconSchema } from "../../types/aep"; import { createRequisitionList } from "../../utils/aep/requisitionList"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "commerce.requisitionListOpens"; const handler = async (event: Event): Promise => { - const { accountContext, debugContext, requisitionListContext, customContext } = event.eventInfo; + const { accountContext, debugContext, requisitionListContext, customContext, storefrontInstanceContext } = + event.eventInfo; let payload: BeaconSchema = {}; if (customContext && Object.keys(customContext as BeaconSchema).length !== 0) { // override payload on custom context @@ -25,6 +27,8 @@ const handler = async (event: Event): Promise => { value: 1, }; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/requisitionList/removeFromRequisitionListAEP.ts b/packages/storefront-events-collector/src/handlers/requisitionList/removeFromRequisitionListAEP.ts index 869a9eef..c9d5fa2f 100644 --- a/packages/storefront-events-collector/src/handlers/requisitionList/removeFromRequisitionListAEP.ts +++ b/packages/storefront-events-collector/src/handlers/requisitionList/removeFromRequisitionListAEP.ts @@ -4,6 +4,7 @@ import { sendEvent } from "../../alloy"; import { BeaconSchema } from "../../types/aep"; import { createRequisitionList } from "../../utils/aep/requisitionList"; import { createProductListItems } from "../../utils/aep/productListItems"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "commerce.requisitionListRemovals"; @@ -42,6 +43,8 @@ const aepHandler = async (event: Event): Promise => { value: 1, }; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; sendEvent(payload); diff --git a/packages/storefront-events-collector/src/handlers/search/searchRequestSentAEP.ts b/packages/storefront-events-collector/src/handlers/search/searchRequestSentAEP.ts index 15a82632..793899ad 100644 --- a/packages/storefront-events-collector/src/handlers/search/searchRequestSentAEP.ts +++ b/packages/storefront-events-collector/src/handlers/search/searchRequestSentAEP.ts @@ -4,11 +4,13 @@ import { SearchFilter, SearchSort } from "@adobe/magento-storefront-events-sdk/d import { sendEvent } from "../../alloy"; import { createSearchInputCtx } from "../../contexts"; import { BeaconSchema, Filter, Sort } from "../../types/aep"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "searchRequest"; const handler = async (event: Event): Promise => { - const { searchUnitId, searchInputContext, debugContext, customContext } = event.eventInfo; + const { searchUnitId, searchInputContext, debugContext, storefrontInstanceContext, customContext } = + event.eventInfo; let payload: BeaconSchema = {}; @@ -63,6 +65,9 @@ const handler = async (event: Event): Promise => { payload.searchRequest.id = searchInputCtx.data.searchRequestId as string; } + payload.commerce = payload.commerce || {}; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/search/searchResponseReceivedAEP.ts b/packages/storefront-events-collector/src/handlers/search/searchResponseReceivedAEP.ts index e63c0d39..b96bf090 100644 --- a/packages/storefront-events-collector/src/handlers/search/searchResponseReceivedAEP.ts +++ b/packages/storefront-events-collector/src/handlers/search/searchResponseReceivedAEP.ts @@ -5,11 +5,13 @@ import { sendEvent } from "../../alloy"; import { createSearchResultsCtx } from "../../contexts"; import { BeaconSchema } from "../../types/aep"; import { SearchResultProduct } from "../../types/contexts"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "searchResponse"; const handler = async (event: Event): Promise => { - const { searchUnitId, searchResultsContext, debugContext, customContext } = event.eventInfo; + const { searchUnitId, searchResultsContext, debugContext, storefrontInstanceContext, customContext } = + event.eventInfo; const searchResultsCtx = createSearchResultsCtx(searchUnitId as string, searchResultsContext); @@ -44,6 +46,9 @@ const handler = async (event: Event): Promise => { payload.searchResponse.id = searchResultsCtx.data.searchRequestId as string; } + payload.commerce = payload.commerce || {}; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/shoppingCart/initiateCheckoutAEP.ts b/packages/storefront-events-collector/src/handlers/shoppingCart/initiateCheckoutAEP.ts index eda3ee50..d99e2468 100644 --- a/packages/storefront-events-collector/src/handlers/shoppingCart/initiateCheckoutAEP.ts +++ b/packages/storefront-events-collector/src/handlers/shoppingCart/initiateCheckoutAEP.ts @@ -3,6 +3,7 @@ import { Event } from "@adobe/magento-storefront-events-sdk/dist/types/types/eve import { sendEvent } from "../../alloy"; import { BeaconSchema } from "../../types/aep"; import { createProductListItems } from "../../utils/aep/productListItems"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "commerce.checkouts"; @@ -26,10 +27,13 @@ const handler = async (event: Event): Promise => { undefined, storefrontInstanceContext, ); + payload.commerce.checkouts = { value: 1, }; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/shoppingCart/openCartAEP.ts b/packages/storefront-events-collector/src/handlers/shoppingCart/openCartAEP.ts index 667a00e6..4d5cceb3 100644 --- a/packages/storefront-events-collector/src/handlers/shoppingCart/openCartAEP.ts +++ b/packages/storefront-events-collector/src/handlers/shoppingCart/openCartAEP.ts @@ -3,6 +3,7 @@ import { Event } from "@adobe/magento-storefront-events-sdk/dist/types/types/eve import { sendEvent } from "../../alloy"; import { BeaconSchema } from "../../types/aep"; import { createProductListItems } from "../../utils/aep/productListItems"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "commerce.productListOpens"; @@ -31,6 +32,8 @@ const handler = async (event: Event): Promise => { value: 1, }; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/handlers/shoppingCart/viewAEP.ts b/packages/storefront-events-collector/src/handlers/shoppingCart/viewAEP.ts index 3981c85b..3e6f16a8 100644 --- a/packages/storefront-events-collector/src/handlers/shoppingCart/viewAEP.ts +++ b/packages/storefront-events-collector/src/handlers/shoppingCart/viewAEP.ts @@ -3,6 +3,7 @@ import { Event } from "@adobe/magento-storefront-events-sdk/dist/types/types/eve import { sendEvent } from "../../alloy"; import { BeaconSchema } from "../../types/aep"; import { createProductListItems } from "../../utils/aep/productListItems"; +import { createCommerceScope } from "../../utils/aep/commerceScope"; const XDM_EVENT_TYPE = "commerce.productListViews"; @@ -32,6 +33,8 @@ const aepHandler = async (event: Event): Promise => { value: 1, }; + payload.commerce.commerceScope = createCommerceScope(storefrontInstanceContext); + payload._id = debugContext?.eventId; payload.eventType = XDM_EVENT_TYPE; diff --git a/packages/storefront-events-collector/src/types/aep/commerce.ts b/packages/storefront-events-collector/src/types/aep/commerce.ts index 8f91bb09..132154cb 100644 --- a/packages/storefront-events-collector/src/types/aep/commerce.ts +++ b/packages/storefront-events-collector/src/types/aep/commerce.ts @@ -6,6 +6,7 @@ export type Commerce = { productListViews?: ProductListViews; cart?: Cart; checkouts?: Checkout; + commerceScope?: CommerceScope; purchases?: Purchases; order?: Order; promotionID?: string; @@ -17,6 +18,13 @@ export type Commerce = { shipping?: Shipping; }; +export type CommerceScope = { + environmentID: string; + storeCode?: string; + storeViewCode?: string; + websiteCode?: string; +}; + export type ProductView = { value: number; }; diff --git a/packages/storefront-events-collector/src/utils/aep/commerceScope.ts b/packages/storefront-events-collector/src/utils/aep/commerceScope.ts new file mode 100644 index 00000000..ca846752 --- /dev/null +++ b/packages/storefront-events-collector/src/utils/aep/commerceScope.ts @@ -0,0 +1,13 @@ +import { StorefrontInstance } from "@adobe/magento-storefront-events-sdk/src/types/schemas"; +import { CommerceScope } from "../../types/aep"; + +const createCommerceScope = (storefrontInstanceContext: StorefrontInstance): CommerceScope => { + return { + environmentID: storefrontInstanceContext.environmentId, + storeCode: storefrontInstanceContext.storeCode, + storeViewCode: storefrontInstanceContext.storeViewCode, + websiteCode: storefrontInstanceContext.websiteCode, + }; +}; + +export { createCommerceScope }; diff --git a/packages/storefront-events-collector/tests/handlers/checkout/placeOrderAEP.test.ts b/packages/storefront-events-collector/tests/handlers/checkout/placeOrderAEP.test.ts index 31cef290..377cf8b6 100644 --- a/packages/storefront-events-collector/tests/handlers/checkout/placeOrderAEP.test.ts +++ b/packages/storefront-events-collector/tests/handlers/checkout/placeOrderAEP.test.ts @@ -13,6 +13,12 @@ test("correctly structures AEP event and calls alloy.sendEvent", () => { expect(sendEvent).toHaveBeenCalledWith({ commerce: { + commerceScope: { + environmentID: "aaaaaa", + storeCode: "magento", + storeViewCode: "default", + websiteCode: "website", + }, order: { purchaseID: "111111", currencyCode: "USD", diff --git a/packages/storefront-events-collector/tests/handlers/product/addToCartAEP.test.ts b/packages/storefront-events-collector/tests/handlers/product/addToCartAEP.test.ts index b8b35f98..334d0bf3 100644 --- a/packages/storefront-events-collector/tests/handlers/product/addToCartAEP.test.ts +++ b/packages/storefront-events-collector/tests/handlers/product/addToCartAEP.test.ts @@ -13,6 +13,12 @@ test("correctly structures AEP event and calls alloy.sendEvent", () => { expect(sendEvent).toHaveBeenCalledWith({ commerce: { + commerceScope: { + environmentID: "aaaaaa", + storeCode: "magento", + storeViewCode: "default", + websiteCode: "website", + }, cart: { cartID: "111111", }, diff --git a/packages/storefront-events-collector/tests/handlers/product/removeFromCartAEP.test.ts b/packages/storefront-events-collector/tests/handlers/product/removeFromCartAEP.test.ts index 98579d46..582fed20 100644 --- a/packages/storefront-events-collector/tests/handlers/product/removeFromCartAEP.test.ts +++ b/packages/storefront-events-collector/tests/handlers/product/removeFromCartAEP.test.ts @@ -13,6 +13,12 @@ test("correctly structures AEP event and calls alloy.sendEvent", () => { expect(sendEvent).toHaveBeenCalledWith({ commerce: { + commerceScope: { + environmentID: "aaaaaa", + storeCode: "magento", + storeViewCode: "default", + websiteCode: "website", + }, cart: { cartID: "111111", }, diff --git a/packages/storefront-events-collector/tests/handlers/requisitionList/addToRequisitionListAEP.test.ts b/packages/storefront-events-collector/tests/handlers/requisitionList/addToRequisitionListAEP.test.ts index c8bf3345..49c13c4b 100644 --- a/packages/storefront-events-collector/tests/handlers/requisitionList/addToRequisitionListAEP.test.ts +++ b/packages/storefront-events-collector/tests/handlers/requisitionList/addToRequisitionListAEP.test.ts @@ -21,6 +21,12 @@ test("correctly structures AEP event and calls alloy.sendEvent", () => { name: "Req List 1", description: "This is req list 1", }, + commerceScope: { + environmentID: "aaaaaa", + storeCode: "magento", + storeViewCode: "default", + websiteCode: "website", + }, }, productListItems: [ { diff --git a/packages/storefront-events-collector/tests/handlers/requisitionList/createRequisitionListAEP.test.ts b/packages/storefront-events-collector/tests/handlers/requisitionList/createRequisitionListAEP.test.ts index 25fe7fcc..9b25493f 100644 --- a/packages/storefront-events-collector/tests/handlers/requisitionList/createRequisitionListAEP.test.ts +++ b/packages/storefront-events-collector/tests/handlers/requisitionList/createRequisitionListAEP.test.ts @@ -21,6 +21,12 @@ test("correctly structures AEP event and calls alloy.sendEvent", () => { name: "Req List 1", description: "This is req list 1", }, + commerceScope: { + environmentID: "aaaaaa", + storeCode: "magento", + storeViewCode: "default", + websiteCode: "website", + }, }, personalEmail: { address: "beacon3@commerce.com", diff --git a/packages/storefront-events-collector/tests/handlers/requisitionList/removeFromRequisitionListAEP.test.ts b/packages/storefront-events-collector/tests/handlers/requisitionList/removeFromRequisitionListAEP.test.ts index dc3df950..fd959572 100644 --- a/packages/storefront-events-collector/tests/handlers/requisitionList/removeFromRequisitionListAEP.test.ts +++ b/packages/storefront-events-collector/tests/handlers/requisitionList/removeFromRequisitionListAEP.test.ts @@ -21,6 +21,12 @@ test("correctly structures AEP event and calls alloy.sendEvent", () => { name: "Req List 1", description: "This is req list 1", }, + commerceScope: { + environmentID: "aaaaaa", + storeCode: "magento", + storeViewCode: "default", + websiteCode: "website", + }, }, productListItems: [ { diff --git a/packages/storefront-events-collector/tests/handlers/shoppingCart/openCartAEP.test.ts b/packages/storefront-events-collector/tests/handlers/shoppingCart/openCartAEP.test.ts index a9d23390..1293a913 100644 --- a/packages/storefront-events-collector/tests/handlers/shoppingCart/openCartAEP.test.ts +++ b/packages/storefront-events-collector/tests/handlers/shoppingCart/openCartAEP.test.ts @@ -19,6 +19,12 @@ test("correctly structures AEP event and calls alloy.sendEvent", () => { productListOpens: { value: 1, }, + commerceScope: { + environmentID: "aaaaaa", + storeCode: "magento", + storeViewCode: "default", + websiteCode: "website", + }, }, productListItems: [ {