@adobe/magento-storefront-event-collector 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +37 -47
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.LICENSE.txt +1 -1
  4. package/dist/types/src/handlers/account/createAccountAEP.d.ts.map +1 -1
  5. package/dist/types/src/handlers/account/editAccountAEP.d.ts.map +1 -1
  6. package/dist/types/src/handlers/account/signInAEP.d.ts.map +1 -1
  7. package/dist/types/src/handlers/account/signOutAEP.d.ts.map +1 -1
  8. package/dist/types/src/handlers/checkout/placeOrderAEP.d.ts.map +1 -1
  9. package/dist/types/src/handlers/page/viewAEP.d.ts.map +1 -1
  10. package/dist/types/src/handlers/product/addToCartAEP.d.ts.map +1 -1
  11. package/dist/types/src/handlers/product/removeFromCartAEP.d.ts.map +1 -1
  12. package/dist/types/src/handlers/product/viewAEP.d.ts.map +1 -1
  13. package/dist/types/src/handlers/requisitionList/addToRequisitionListAEP.d.ts.map +1 -1
  14. package/dist/types/src/handlers/requisitionList/createRequisitionListAEP.d.ts.map +1 -1
  15. package/dist/types/src/handlers/requisitionList/removeFromRequisitionListAEP.d.ts.map +1 -1
  16. package/dist/types/src/handlers/search/searchRequestSentAEP.d.ts.map +1 -1
  17. package/dist/types/src/handlers/search/searchResponseReceivedAEP.d.ts.map +1 -1
  18. package/dist/types/src/handlers/shoppingCart/initiateCheckoutAEP.d.ts.map +1 -1
  19. package/dist/types/src/handlers/shoppingCart/openCartAEP.d.ts.map +1 -1
  20. package/dist/types/src/handlers/shoppingCart/viewAEP.d.ts.map +1 -1
  21. package/dist/types/src/types/aep/beaconSchema.d.ts +0 -1
  22. package/dist/types/src/types/aep/beaconSchema.d.ts.map +1 -1
  23. package/dist/types/src/types/aep/commerce.d.ts +8 -1
  24. package/dist/types/src/types/aep/commerce.d.ts.map +1 -1
  25. package/dist/types/src/types/aep/pageView.d.ts +2 -2
  26. package/dist/types/src/types/aep/pageView.d.ts.map +1 -1
  27. package/dist/types/src/types/aep/productListItem.d.ts +2 -2
  28. package/dist/types/src/types/aep/productListItem.d.ts.map +1 -1
  29. package/dist/types/src/utils/aep/account.d.ts +5 -0
  30. package/dist/types/src/utils/aep/account.d.ts.map +1 -0
  31. package/dist/types/src/utils/aep/commerceScope.d.ts +5 -0
  32. package/dist/types/src/utils/aep/commerceScope.d.ts.map +1 -0
  33. package/dist/types/src/utils/aep/order.d.ts +1 -1
  34. package/dist/types/src/utils/aep/order.d.ts.map +1 -1
  35. package/dist/types/src/utils/aep/productListItems.d.ts +3 -3
  36. package/dist/types/src/utils/aep/productListItems.d.ts.map +1 -1
  37. package/dist/types/src/utils/aep/requisitionList.d.ts +3 -11
  38. package/dist/types/src/utils/aep/requisitionList.d.ts.map +1 -1
  39. package/package.json +1 -1
package/README.md CHANGED
@@ -154,11 +154,9 @@ Custom event published through MSE SDK:
154
154
 
155
155
  ```javascript
156
156
  mse.publish.custom({
157
- customContext: {
158
- customStrAttr: "cheetah",
159
- customNumAttr: 128,
160
- personalEmail: {
161
- address: "runs@safari.ke",
157
+ commerce: {
158
+ saveForLaters: {
159
+ value: 1,
162
160
  },
163
161
  },
164
162
  });
@@ -169,7 +167,7 @@ In AEP Edge:
169
167
  ```javascript
170
168
  {
171
169
  xdm: {
172
- identityMap = {
170
+ identityMap: {
173
171
  ECID: [
174
172
  {
175
173
  id: 'ecid1234',
@@ -183,8 +181,11 @@ In AEP Edge:
183
181
  }
184
182
  ]
185
183
  },
186
- customStrAttr: 'cheetah',
187
- customNumAttr: 128
184
+ commerce: {
185
+ saveForLaters: {
186
+ value: 1
187
+ }
188
+ }
188
189
  }
189
190
  }
190
191
  ```
@@ -195,53 +196,34 @@ In AEP Edge:
195
196
 
196
197
  Attribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.
197
198
 
198
- For any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.
199
+ For any event with a set `customContext`, the collector overrides joins fields set in the relevant contexts with fields in `customContext`. The use case for overrides is when a developer wants to reuse and extend contexts set by other parts of the page in already supporte events.
199
200
 
200
- Examples:
201
+ _Note_ when overriding custom events, event forwarding to AEP should be turned off for that event type in order to avoid-double counting.
201
202
 
202
- Product view with overrides published though MSE SDK:
203
+ Example:
203
204
 
204
- ```javascript
205
- mse.publish.productPageView({
206
- customContext: {
207
- customCode: "okapi",
208
- },
209
- });
210
- ```
205
+ Product view with Adobe Commerce overrides published though MSE SDK:
211
206
 
212
- In AEP Edge:
207
+ Product context (set by another script on the page):
213
208
 
214
209
  ```javascript
215
210
  {
216
- xdm: {
217
- eventType: 'commerce.productViews',
218
- identityMap = {
219
- ECID: [
220
- {
221
- id: 'ecid1234',
222
- primary: true
223
- }
224
- ]
225
- },
226
- customCode: 'okapi',
227
- commerce: {
228
- productViews: {
229
- value : 1
230
- }
231
- }
232
- }
233
211
  }
234
212
  ```
235
213
 
236
- Product view with Adobe Commerce overrides published though MSE SDK:
237
-
238
214
  ```javascript
239
215
  mse.publish.productPageView({
240
- customContext: {
241
- commerce: {
242
- customCode: "mongoose",
216
+ productListItems: [
217
+ {
218
+ productCategories: [
219
+ {
220
+ categoryID: "cat_15",
221
+ categoryName: "summer pants",
222
+ categoryPath: "pants/mens/summer",
223
+ },
224
+ ],
243
225
  },
244
- },
226
+ ],
245
227
  });
246
228
  ```
247
229
 
@@ -251,20 +233,28 @@ In AEP Edge:
251
233
  {
252
234
  xdm: {
253
235
  eventType: 'commerce.productViews',
254
- identityMap = {
236
+ identityMap: {
255
237
  ECID: [
256
238
  {
257
239
  id: 'ecid1234',
258
- primary: true
240
+ primary: true,
259
241
  }
260
242
  ]
261
243
  },
262
244
  commerce: {
263
- customCode: 'mongoose',
264
245
  productViews: {
265
- value : 1
246
+ value : 1,
266
247
  }
267
- }
248
+ },
249
+ productListItems: [{
250
+ SKU: "1234",
251
+ name: "leora summer pants",
252
+ productCategories: [{
253
+ categoryID: "cat_15",
254
+ categoryName: "summer pants",
255
+ categoryPath: "pants/mens/summer",
256
+ }],
257
+ }],
268
258
  }
269
259
  }
270
260
  ```