@adobe/alloy 2.32.1-beta.1 → 2.33.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 (264) hide show
  1. package/components.json +7 -2
  2. package/dist/alloy.js +11283 -11142
  3. package/dist/alloy.min.js +1 -1
  4. package/dist/alloyServiceWorker.js +1 -1
  5. package/dist/types/{core → browser}/src/components/Advertising/constants/index.d.ts +3 -0
  6. package/dist/types/{core → browser}/src/components/Advertising/handlers/createOnBeforeSendEventHandler.d.ts +4 -1
  7. package/dist/types/{core → browser}/src/components/Advertising/handlers/sendAdConversion.d.ts +3 -1
  8. package/dist/types/{core → browser}/src/components/Advertising/handlers/viewThroughHandler.d.ts +3 -1
  9. package/dist/types/{core → browser}/src/components/Advertising/identities/collectAllIdentities.d.ts +1 -1
  10. package/dist/types/browser/src/components/Advertising/identities/collectSurferId.d.ts +15 -0
  11. package/dist/types/browser/src/components/Advertising/identities/createHashedIpHandler.d.ts +9 -0
  12. package/dist/types/browser/src/components/Advertising/identities/initiateAdvertisingIdentityCall.d.ts +5 -0
  13. package/dist/types/{core → browser}/src/components/Advertising/utils/helpers.d.ts +14 -0
  14. package/dist/types/browser/src/components/Advertising/utils/murmurHash128GuavaHex.d.ts +2 -0
  15. package/dist/types/browser/src/components/Personalization/constants/surface.d.ts +4 -0
  16. package/dist/types/browser/src/components/Personalization/dom-actions/dom/isDomElement.d.ts +2 -0
  17. package/dist/types/browser/src/components/Personalization/utils/addRenderAttemptedToDecisions.d.ts +5 -0
  18. package/dist/types/browser/src/components/Personalization/utils/surfaceUtils.d.ts +3 -0
  19. package/dist/types/{core → browser}/src/components/PushNotifications/helpers/saveToIndexedDb.d.ts +1 -1
  20. package/dist/types/{core → browser}/src/components/PushNotifications/index.d.ts +6 -6
  21. package/dist/types/{core → browser}/src/components/PushNotifications/request/createSendPushSubscriptionPayload.d.ts +2 -2
  22. package/dist/types/browser/src/components/PushNotifications/request/createSendPushSubscriptionRequest.d.ts +6 -0
  23. package/dist/types/{core → browser}/src/components/PushNotifications/request/makeSendPushSubscriptionRequest.d.ts +6 -6
  24. package/dist/types/{core → browser}/src/components/PushNotifications/types.d.ts +1 -1
  25. package/dist/types/browser/src/components/componentCreators.d.ts +3 -0
  26. package/dist/types/browser/src/components/requiredComponentCreators.d.ts +1 -0
  27. package/dist/types/core/src/components/Identity/injectAddQueryStringIdentityToPayload.d.ts +2 -1
  28. package/dist/types/core/src/core/componentCreators.d.ts +0 -3
  29. package/dist/types/core/src/core/requiredComponentCreators.d.ts +0 -1
  30. package/dist/types/core/src/types.d.ts +0 -4
  31. package/package.json +2 -2
  32. package/src/components/Advertising/configValidators.js +32 -0
  33. package/src/components/Advertising/constants/index.js +80 -0
  34. package/src/components/Advertising/createComponent.js +24 -0
  35. package/src/components/Advertising/handlers/clickThroughHandler.js +94 -0
  36. package/src/components/Advertising/handlers/createAdConversionHandler.js +50 -0
  37. package/src/components/Advertising/handlers/createOnBeforeSendEventHandler.js +177 -0
  38. package/src/components/Advertising/handlers/sendAdConversion.js +74 -0
  39. package/src/components/Advertising/handlers/viewThroughHandler.js +107 -0
  40. package/src/components/Advertising/identities/collectAllIdentities.js +57 -0
  41. package/src/components/Advertising/identities/collectID5Id.js +133 -0
  42. package/src/components/Advertising/identities/collectRampId.js +265 -0
  43. package/src/components/Advertising/identities/collectSurferId.js +72 -0
  44. package/src/components/Advertising/identities/createHashedIpHandler.js +36 -0
  45. package/src/components/Advertising/identities/initiateAdvertisingIdentityCall.js +153 -0
  46. package/src/components/Advertising/index.js +109 -0
  47. package/src/components/Advertising/utils/advertisingCookieManager.js +92 -0
  48. package/src/components/Advertising/utils/helpers.js +190 -0
  49. package/src/components/Advertising/utils/murmurHash128GuavaHex.js +195 -0
  50. package/src/components/Context/createComponent.js +35 -0
  51. package/src/components/Context/implementationDetails.js +23 -0
  52. package/src/components/Context/index.js +56 -0
  53. package/src/components/Context/injectDevice.js +77 -0
  54. package/src/components/Context/injectEnvironment.js +38 -0
  55. package/src/components/Context/injectHighEntropyUserAgentHints.js +55 -0
  56. package/src/components/Context/injectOneTimeAnalyticsReferrer.js +61 -0
  57. package/src/components/Context/injectPlaceContext.js +38 -0
  58. package/src/components/Context/injectWeb.js +26 -0
  59. package/src/components/Personalization/constants/loggerMessage.js +14 -0
  60. package/src/components/Personalization/constants/scopeType.js +15 -0
  61. package/src/components/Personalization/constants/surface.js +16 -0
  62. package/src/components/Personalization/createApplyPropositions.js +136 -0
  63. package/src/components/Personalization/createClickStorage.js +56 -0
  64. package/src/components/Personalization/createComponent.js +133 -0
  65. package/src/components/Personalization/createFetchDataHandler.js +149 -0
  66. package/src/components/Personalization/createGetPageLocation.js +16 -0
  67. package/src/components/Personalization/createHandleConsentFlicker.js +22 -0
  68. package/src/components/Personalization/createInteractionStorage.js +104 -0
  69. package/src/components/Personalization/createNotificationHandler.js +49 -0
  70. package/src/components/Personalization/createOnClickHandler.js +102 -0
  71. package/src/components/Personalization/createOnDecisionHandler.js +98 -0
  72. package/src/components/Personalization/createPersonalizationDetails.js +138 -0
  73. package/src/components/Personalization/createSetTargetMigration.js +22 -0
  74. package/src/components/Personalization/createViewCacheManager.js +101 -0
  75. package/src/components/Personalization/createViewChangeHandler.js +53 -0
  76. package/src/components/Personalization/dom-actions/action.js +97 -0
  77. package/src/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +37 -0
  78. package/src/components/Personalization/dom-actions/appendHtml.js +42 -0
  79. package/src/components/Personalization/dom-actions/clicks/collectClicks.js +89 -0
  80. package/src/components/Personalization/dom-actions/clicks/collectInteractions.js +113 -0
  81. package/src/components/Personalization/dom-actions/collectInteractions.js +15 -0
  82. package/src/components/Personalization/dom-actions/createPreprocess.js +21 -0
  83. package/src/components/Personalization/dom-actions/createRedirect.js +23 -0
  84. package/src/components/Personalization/dom-actions/dom/createFragment.js +18 -0
  85. package/src/components/Personalization/dom-actions/dom/getAttribute.js +15 -0
  86. package/src/components/Personalization/dom-actions/dom/getChildNodes.js +23 -0
  87. package/src/components/Personalization/dom-actions/dom/getChildren.js +23 -0
  88. package/src/components/Personalization/dom-actions/dom/getElementById.js +21 -0
  89. package/src/components/Personalization/dom-actions/dom/getFirstChild.js +15 -0
  90. package/src/components/Personalization/dom-actions/dom/getNextSibling.js +15 -0
  91. package/src/components/Personalization/dom-actions/dom/getNonce.js +33 -0
  92. package/src/components/Personalization/dom-actions/dom/getParent.js +15 -0
  93. package/src/components/Personalization/dom-actions/dom/helperForEq.js +22 -0
  94. package/src/components/Personalization/dom-actions/dom/index.js +26 -0
  95. package/src/components/Personalization/dom-actions/dom/insertAfter.js +26 -0
  96. package/src/components/Personalization/dom-actions/dom/insertBefore.js +25 -0
  97. package/src/components/Personalization/dom-actions/dom/isDomElement.js +13 -0
  98. package/src/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +37 -0
  99. package/src/components/Personalization/dom-actions/dom/removeAttribute.js +15 -0
  100. package/src/components/Personalization/dom-actions/dom/selectNodesWithEq.js +101 -0
  101. package/src/components/Personalization/dom-actions/dom/setAttribute.js +15 -0
  102. package/src/components/Personalization/dom-actions/dom/setStyle.js +23 -0
  103. package/src/components/Personalization/dom-actions/dom/util.js +17 -0
  104. package/src/components/Personalization/dom-actions/images.js +34 -0
  105. package/src/components/Personalization/dom-actions/index.js +13 -0
  106. package/src/components/Personalization/dom-actions/initDomActionsModules.js +67 -0
  107. package/src/components/Personalization/dom-actions/insertHtmlAfter.js +43 -0
  108. package/src/components/Personalization/dom-actions/insertHtmlBefore.js +40 -0
  109. package/src/components/Personalization/dom-actions/move.js +28 -0
  110. package/src/components/Personalization/dom-actions/prependHtml.js +60 -0
  111. package/src/components/Personalization/dom-actions/rearrangeChildren.js +34 -0
  112. package/src/components/Personalization/dom-actions/remapCustomCodeOffers.js +33 -0
  113. package/src/components/Personalization/dom-actions/remapHeadOffers.js +63 -0
  114. package/src/components/Personalization/dom-actions/replaceHtml.js +20 -0
  115. package/src/components/Personalization/dom-actions/resize.js +28 -0
  116. package/src/components/Personalization/dom-actions/scripts.js +106 -0
  117. package/src/components/Personalization/dom-actions/setAttributes.js +21 -0
  118. package/src/components/Personalization/dom-actions/setHtml.js +27 -0
  119. package/src/components/Personalization/dom-actions/setStyles.js +23 -0
  120. package/src/components/Personalization/dom-actions/setText.js +16 -0
  121. package/src/components/Personalization/dom-actions/swapImage.js +32 -0
  122. package/src/components/Personalization/flicker/index.js +106 -0
  123. package/src/components/Personalization/handlers/createDecorateProposition.js +100 -0
  124. package/src/components/Personalization/handlers/createProcessDomAction.js +79 -0
  125. package/src/components/Personalization/handlers/createProcessHtmlContent.js +60 -0
  126. package/src/components/Personalization/handlers/createProcessInAppMessage.js +91 -0
  127. package/src/components/Personalization/handlers/createProcessPropositions.js +228 -0
  128. package/src/components/Personalization/handlers/createProcessRedirect.js +54 -0
  129. package/src/components/Personalization/handlers/createRenderStatusHandler.js +62 -0
  130. package/src/components/Personalization/handlers/injectCreateProposition.js +121 -0
  131. package/src/components/Personalization/handlers/processDefaultContent.js +20 -0
  132. package/src/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +309 -0
  133. package/src/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +18 -0
  134. package/src/components/Personalization/in-app-message-actions/utils.js +55 -0
  135. package/src/components/Personalization/index.js +223 -0
  136. package/src/components/Personalization/utils/addRenderAttemptedToDecisions.js +15 -0
  137. package/src/components/Personalization/utils/createAsyncArray.js +37 -0
  138. package/src/components/Personalization/utils/isAuthoringModeEnabled.js +15 -0
  139. package/src/components/Personalization/utils/metaUtils.js +27 -0
  140. package/src/components/Personalization/utils/surfaceUtils.js +120 -0
  141. package/src/components/Personalization/validateApplyPropositionsOptions.js +56 -0
  142. package/src/components/PushNotifications/helpers/constants.js +16 -0
  143. package/src/components/PushNotifications/helpers/getPushSubscriptionDetails.js +122 -0
  144. package/src/components/PushNotifications/helpers/readFromIndexedDb.js +50 -0
  145. package/src/components/PushNotifications/helpers/saveToIndexedDb.js +64 -0
  146. package/src/components/PushNotifications/helpers/serviceWorkerNotificationClickListener.js +84 -0
  147. package/src/components/PushNotifications/helpers/serviceWorkerPushListener.js +72 -0
  148. package/src/components/PushNotifications/index.js +128 -0
  149. package/src/components/PushNotifications/request/createSendPushSubscriptionPayload.js +66 -0
  150. package/src/components/PushNotifications/request/createSendPushSubscriptionRequest.js +35 -0
  151. package/src/components/PushNotifications/request/makeSendPushSubscriptionRequest.js +98 -0
  152. package/src/components/PushNotifications/request/makeSendServiceWorkerTrackingData.js +154 -0
  153. package/src/components/PushNotifications/types.js +104 -0
  154. package/src/components/componentCreators.js +3 -0
  155. package/src/components/requiredComponentCreators.js +13 -0
  156. package/src/createEventListeners.js +81 -0
  157. package/src/index.js +5 -1
  158. package/src/serviceWorker.js +2 -2
  159. package/dist/types/core/src/components/Advertising/identities/collectSurferId.d.ts +0 -2
  160. package/dist/types/core/src/components/PushNotifications/request/createSendPushSubscriptionRequest.d.ts +0 -6
  161. /package/dist/types/{core → browser}/src/components/Advertising/configValidators.d.ts +0 -0
  162. /package/dist/types/{core → browser}/src/components/Advertising/createComponent.d.ts +0 -0
  163. /package/dist/types/{core → browser}/src/components/Advertising/handlers/clickThroughHandler.d.ts +0 -0
  164. /package/dist/types/{core → browser}/src/components/Advertising/handlers/createAdConversionHandler.d.ts +0 -0
  165. /package/dist/types/{core → browser}/src/components/Advertising/identities/collectID5Id.d.ts +0 -0
  166. /package/dist/types/{core → browser}/src/components/Advertising/identities/collectRampId.d.ts +0 -0
  167. /package/dist/types/{core → browser}/src/components/Advertising/index.d.ts +0 -0
  168. /package/dist/types/{core → browser}/src/components/Advertising/utils/advertisingCookieManager.d.ts +0 -0
  169. /package/dist/types/{core → browser}/src/components/Context/createComponent.d.ts +0 -0
  170. /package/dist/types/{core → browser}/src/components/Context/implementationDetails.d.ts +0 -0
  171. /package/dist/types/{core → browser}/src/components/Context/index.d.ts +0 -0
  172. /package/dist/types/{core → browser}/src/components/Context/injectDevice.d.ts +0 -0
  173. /package/dist/types/{core → browser}/src/components/Context/injectEnvironment.d.ts +0 -0
  174. /package/dist/types/{core → browser}/src/components/Context/injectHighEntropyUserAgentHints.d.ts +0 -0
  175. /package/dist/types/{core → browser}/src/components/Context/injectOneTimeAnalyticsReferrer.d.ts +0 -0
  176. /package/dist/types/{core → browser}/src/components/Context/injectPlaceContext.d.ts +0 -0
  177. /package/dist/types/{core → browser}/src/components/Context/injectWeb.d.ts +0 -0
  178. /package/dist/types/{core → browser}/src/components/Personalization/constants/loggerMessage.d.ts +0 -0
  179. /package/dist/types/{core → browser}/src/components/Personalization/constants/scopeType.d.ts +0 -0
  180. /package/dist/types/{core → browser}/src/components/Personalization/createApplyPropositions.d.ts +0 -0
  181. /package/dist/types/{core → browser}/src/components/Personalization/createClickStorage.d.ts +0 -0
  182. /package/dist/types/{core → browser}/src/components/Personalization/createComponent.d.ts +0 -0
  183. /package/dist/types/{core → browser}/src/components/Personalization/createFetchDataHandler.d.ts +0 -0
  184. /package/dist/types/{core → browser}/src/components/Personalization/createGetPageLocation.d.ts +0 -0
  185. /package/dist/types/{core → browser}/src/components/Personalization/createHandleConsentFlicker.d.ts +0 -0
  186. /package/dist/types/{core → browser}/src/components/Personalization/createInteractionStorage.d.ts +0 -0
  187. /package/dist/types/{core → browser}/src/components/Personalization/createNotificationHandler.d.ts +0 -0
  188. /package/dist/types/{core → browser}/src/components/Personalization/createOnClickHandler.d.ts +0 -0
  189. /package/dist/types/{core → browser}/src/components/Personalization/createOnDecisionHandler.d.ts +0 -0
  190. /package/dist/types/{core → browser}/src/components/Personalization/createPersonalizationDetails.d.ts +0 -0
  191. /package/dist/types/{core → browser}/src/components/Personalization/createSetTargetMigration.d.ts +0 -0
  192. /package/dist/types/{core → browser}/src/components/Personalization/createViewCacheManager.d.ts +0 -0
  193. /package/dist/types/{core → browser}/src/components/Personalization/createViewChangeHandler.d.ts +0 -0
  194. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/action.d.ts +0 -0
  195. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/addNonceToInlineStyleElements.d.ts +0 -0
  196. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/appendHtml.d.ts +0 -0
  197. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/clicks/collectClicks.d.ts +0 -0
  198. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/clicks/collectInteractions.d.ts +0 -0
  199. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/collectInteractions.d.ts +0 -0
  200. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/createPreprocess.d.ts +0 -0
  201. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/createRedirect.d.ts +0 -0
  202. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/createFragment.d.ts +0 -0
  203. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getAttribute.d.ts +0 -0
  204. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getChildNodes.d.ts +0 -0
  205. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getChildren.d.ts +0 -0
  206. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getElementById.d.ts +0 -0
  207. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getFirstChild.d.ts +0 -0
  208. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getNextSibling.d.ts +0 -0
  209. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getNonce.d.ts +0 -0
  210. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getParent.d.ts +0 -0
  211. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/helperForEq.d.ts +0 -0
  212. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/index.d.ts +0 -0
  213. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/insertAfter.d.ts +0 -0
  214. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/insertBefore.d.ts +0 -0
  215. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/matchesSelectorWithEq.d.ts +0 -0
  216. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/removeAttribute.d.ts +0 -0
  217. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/selectNodesWithEq.d.ts +0 -0
  218. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/setAttribute.d.ts +0 -0
  219. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/setStyle.d.ts +0 -0
  220. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/util.d.ts +0 -0
  221. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/images.d.ts +0 -0
  222. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/index.d.ts +0 -0
  223. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/initDomActionsModules.d.ts +0 -0
  224. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/insertHtmlAfter.d.ts +0 -0
  225. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/insertHtmlBefore.d.ts +0 -0
  226. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/move.d.ts +0 -0
  227. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/prependHtml.d.ts +0 -0
  228. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/rearrangeChildren.d.ts +0 -0
  229. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/remapCustomCodeOffers.d.ts +0 -0
  230. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/remapHeadOffers.d.ts +0 -0
  231. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/replaceHtml.d.ts +0 -0
  232. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/resize.d.ts +0 -0
  233. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/scripts.d.ts +0 -0
  234. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setAttributes.d.ts +0 -0
  235. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setHtml.d.ts +0 -0
  236. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setStyles.d.ts +0 -0
  237. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setText.d.ts +0 -0
  238. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/swapImage.d.ts +0 -0
  239. /package/dist/types/{core → browser}/src/components/Personalization/flicker/index.d.ts +0 -0
  240. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createDecorateProposition.d.ts +0 -0
  241. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessDomAction.d.ts +0 -0
  242. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessHtmlContent.d.ts +0 -0
  243. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessInAppMessage.d.ts +0 -0
  244. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessPropositions.d.ts +0 -0
  245. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessRedirect.d.ts +0 -0
  246. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createRenderStatusHandler.d.ts +0 -0
  247. /package/dist/types/{core → browser}/src/components/Personalization/handlers/injectCreateProposition.d.ts +0 -0
  248. /package/dist/types/{core → browser}/src/components/Personalization/handlers/processDefaultContent.d.ts +0 -0
  249. /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/actions/displayIframeContent.d.ts +0 -0
  250. /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.d.ts +0 -0
  251. /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/utils.d.ts +0 -0
  252. /package/dist/types/{core → browser}/src/components/Personalization/index.d.ts +0 -0
  253. /package/dist/types/{core → browser}/src/components/Personalization/utils/createAsyncArray.d.ts +0 -0
  254. /package/dist/types/{core → browser}/src/components/Personalization/utils/isAuthoringModeEnabled.d.ts +0 -0
  255. /package/dist/types/{core → browser}/src/components/Personalization/utils/metaUtils.d.ts +0 -0
  256. /package/dist/types/{core → browser}/src/components/Personalization/validateApplyPropositionsOptions.d.ts +0 -0
  257. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/constants.d.ts +0 -0
  258. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/getPushSubscriptionDetails.d.ts +0 -0
  259. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/readFromIndexedDb.d.ts +0 -0
  260. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/serviceWorkerNotificationClickListener.d.ts +0 -0
  261. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/serviceWorkerPushListener.d.ts +0 -0
  262. /package/dist/types/{core → browser}/src/components/PushNotifications/request/makeSendServiceWorkerTrackingData.d.ts +0 -0
  263. /package/dist/types/{core → browser}/src/createEventListeners.d.ts +0 -0
  264. /package/dist/types/core/src/{components/Context → utils}/injectTimestamp.d.ts +0 -0
@@ -590,7 +590,7 @@ governing permissions and limitations under the License.
590
590
  // @ts-check
591
591
  /// <reference lib="webworker" />
592
592
 
593
- /** @import { ServiceWorkerLogger } from '@adobe/alloy-core/types.js' */
593
+ /** @import { ServiceWorkerLogger } from './components/PushNotifications/types.js' */
594
594
 
595
595
  /** @type {ServiceWorkerGlobalScope} */
596
596
  // @ts-ignore
@@ -10,6 +10,8 @@ export const LAST_CONVERSION_TIME_KEY_EXPIRES: "lastConversionTimeExpires";
10
10
  export const SKWCID_PARAM: "s_kwcid";
11
11
  export const EFID_PARAM: "ef_id";
12
12
  export const SURFER_ID: "surferId";
13
+ export const HASHED_IP: "hashedIp";
14
+ export const HASHED_IP_ADDR: "hashedIPAddr";
13
15
  export const RAMP_ID: "rampId";
14
16
  export const ID5_ID: "id5Id";
15
17
  export const UNKNOWN_ADVERTISER: "";
@@ -30,6 +32,7 @@ export const SURFER_USER_ID: "1";
30
32
  export const SURFER_TIMEOUT_MS: 5000;
31
33
  export const SURFER_TRUSTED_ORIGIN: "www.everestjs.net";
32
34
  export const SURFER_PARAM_KEY: "gsurfer";
35
+ export const SURFER_IP: "clientIp";
33
36
  export const ERROR_ID5_PARTNER_ID_REQUIRED: "ID5 partner ID is required";
34
37
  export const ERROR_RAMP_ID_MAX_RETRIES: "Failed to retrieve RampID after maximum retries";
35
38
  export const LOG_AD_CONVERSION_START: "Processing ad conversion";
@@ -1,4 +1,4 @@
1
- declare function _default({ cookieManager, logger, componentConfig, getBrowser, consent, collectSurferId, getID5Id, getRampId, appendAdvertisingIdQueryToEvent, getUrlParams, isThrottled, }: {
1
+ declare function _default({ cookieManager, logger, componentConfig, getBrowser, consent, collectSurferId, getID5Id, getRampId, appendAdvertisingIdQueryToEvent, appendAdCloudIdentityToEvent, collectHashedIPAddr, getUrlParams, isThrottled, normalizeAdvertiser, }: {
2
2
  cookieManager: any;
3
3
  logger: any;
4
4
  componentConfig: any;
@@ -8,8 +8,11 @@ declare function _default({ cookieManager, logger, componentConfig, getBrowser,
8
8
  getID5Id: Function;
9
9
  getRampId: Function;
10
10
  appendAdvertisingIdQueryToEvent: Function;
11
+ appendAdCloudIdentityToEvent: Function;
12
+ collectHashedIPAddr: Function;
11
13
  getUrlParams: Function;
12
14
  isThrottled: Function;
15
+ normalizeAdvertiser: Function;
13
16
  }): ({ event, advertising }: {
14
17
  event: any;
15
18
  advertising?: any;
@@ -1,4 +1,4 @@
1
- declare function _default({ eventManager, cookieManager, adConversionHandler, logger, componentConfig, getBrowser, consent, }: {
1
+ declare function _default({ eventManager, cookieManager, adConversionHandler, logger, componentConfig, getBrowser, consent, collectSurferId, collectHashedIPAddr, }: {
2
2
  eventManager: any;
3
3
  cookieManager: any;
4
4
  adConversionHandler: any;
@@ -6,5 +6,7 @@ declare function _default({ eventManager, cookieManager, adConversionHandler, lo
6
6
  componentConfig: any;
7
7
  getBrowser: any;
8
8
  consent: any;
9
+ collectSurferId: any;
10
+ collectHashedIPAddr: any;
9
11
  }): () => Promise<any>;
10
12
  export default _default;
@@ -1,8 +1,10 @@
1
- export default function handleViewThrough({ eventManager, cookieManager, logger, componentConfig, adConversionHandler, getBrowser, }: {
1
+ export default function handleViewThrough({ eventManager, cookieManager, logger, componentConfig, adConversionHandler, getBrowser, collectSurferId, collectHashedIPAddr, }: {
2
2
  eventManager: any;
3
3
  cookieManager: any;
4
4
  logger: any;
5
5
  componentConfig: any;
6
6
  adConversionHandler: any;
7
7
  getBrowser: any;
8
+ collectSurferId: any;
9
+ collectHashedIPAddr: any;
8
10
  }): Promise<PromiseSettledResult<any>[]>;
@@ -1,5 +1,5 @@
1
1
  export default collectAllIdentities;
2
- declare function collectAllIdentities(logger: any, componentConfig: any, cookieManager: any, getBrowser: any): {
2
+ declare function collectAllIdentities(logger: any, componentConfig: any, cookieManager: any, getBrowser: any, collectSurferId: any): {
3
3
  surferId: any;
4
4
  id5Id: any;
5
5
  rampId: any;
@@ -0,0 +1,15 @@
1
+ export default createCollectSurferId;
2
+ /**
3
+ * Factory for surferId collection. Cache lives at closure scope — no module-level state.
4
+ *
5
+ * @param {Object} deps
6
+ * @param {Function} deps.initiateAdvertisingIdentityCall
7
+ * @param {Object} deps.cookieManager
8
+ * @param {Function} deps.getBrowser
9
+ * @returns {Function} collectSurferId(useShortTimeout?)
10
+ */
11
+ declare function createCollectSurferId({ initiateAdvertisingIdentityCall, cookieManager, getBrowser, }: {
12
+ initiateAdvertisingIdentityCall: Function;
13
+ cookieManager: any;
14
+ getBrowser: Function;
15
+ }): Function;
@@ -0,0 +1,9 @@
1
+ declare function _default({ cookieManager, hash }: {
2
+ cookieManager: any;
3
+ hash?: (str: string, seed?: number) => string;
4
+ }): {
5
+ captureFromIframe: (clientIp: any) => void;
6
+ get: () => any;
7
+ collect: (initiateCallFn: any) => any;
8
+ };
9
+ export default _default;
@@ -0,0 +1,5 @@
1
+ export function createInitiateAdvertisingIdentityCall({ appendNode: appendNodeFn, awaitSelector: awaitSelectorFn, createNode: createNodeFn, }?: {
2
+ appendNode?: Function;
3
+ awaitSelector?: Function;
4
+ createNode?: Function;
5
+ }): Function;
@@ -16,6 +16,20 @@ export function normalizeAdvertiser(advertiserSettings: any[]): string;
16
16
  */
17
17
  export function createManagedAsyncOperation(operationName: string, workerFn: Function): Function;
18
18
  export function appendAdvertisingIdQueryToEvent(idsToInclude: any, event: any, cookieManager: any, componentConfig: any, addEventType?: boolean): any;
19
+ /**
20
+ * Appends AdCloud identity data to the event XDM as _experience.adcloud.stitchId.
21
+ * @param {{ surferId?: string, hashedIp?: string, id5Id?: string, rampId?: string, adfId?: string }} idsToInclude
22
+ * @param {{ mergeXdm: (xdm: Object) => void }} event
23
+ */
24
+ export function appendAdCloudIdentityToEvent(idsToInclude: {
25
+ surferId?: string;
26
+ hashedIp?: string;
27
+ id5Id?: string;
28
+ rampId?: string;
29
+ adfId?: string;
30
+ }, event: {
31
+ mergeXdm: (xdm: any) => void;
32
+ }): void;
19
33
  export function isAnyIdUnused(availableIds: any, conversionCalled: any): boolean;
20
34
  export function markIdsAsConverted(idTypes: any, conversionCalled: any, cookieManager: any, logger: any): void;
21
35
  export function isThrottled(idType: any, cookieManager: any): boolean;
@@ -0,0 +1,2 @@
1
+ export function murmurHash128GuavaHex(str: string, seed?: number): string;
2
+ export default murmurHash128GuavaHex;
@@ -0,0 +1,4 @@
1
+ export const WEB: "web";
2
+ export const WEBAPP: "webapp";
3
+ export const SURFACE_TYPE_DELIMITER: "://";
4
+ export const FRAGMENT_DELIMITER: "#";
@@ -0,0 +1,2 @@
1
+ declare function _default(element: any): element is Element | HTMLDocument;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ declare function _default({ decisions, renderAttempted }: {
2
+ decisions: any;
3
+ renderAttempted: any;
4
+ }): any;
5
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export function buildPageSurface(getPageLocation: any): string;
2
+ export function isPageWideSurface(scope: any): boolean;
3
+ export function normalizeSurfaces(surfaces: any[], getPageLocation: any, logger: any): string[];
@@ -5,4 +5,4 @@
5
5
  * @returns {Promise<void>}
6
6
  */
7
7
  export default function saveToIndexedDB(data: any, logger: Logger): Promise<void>;
8
- import type { Logger } from '../../../core/types.js';
8
+ import type { Logger } from '@adobe/alloy-core/core/types.js';
@@ -42,9 +42,9 @@ declare namespace createPushNotifications {
42
42
  let namespace: string;
43
43
  let configValidators: any;
44
44
  }
45
- import type { StorageCreator } from '../../utils/types.js';
46
- import type { EventManager } from '../../core/types.js';
47
- import type { Logger } from '../../core/types.js';
48
- import type { ConsentManager } from '../../core/consent/types.js';
49
- import type { IdentityManager } from '../../core/identity/types.js';
50
- import type { EdgeRequestExecutor } from '../../core/edgeNetwork/types.js';
45
+ import type { StorageCreator } from '@adobe/alloy-core/utils/types.js';
46
+ import type { EventManager } from '@adobe/alloy-core/core/types.js';
47
+ import type { Logger } from '@adobe/alloy-core/core/types.js';
48
+ import type { ConsentManager } from '@adobe/alloy-core/core/consent/types.js';
49
+ import type { IdentityManager } from '@adobe/alloy-core/core/identity/types.js';
50
+ import type { EdgeRequestExecutor } from '@adobe/alloy-core/core/edgeNetwork/types.js';
@@ -5,5 +5,5 @@ declare function _default({ ecid, eventManager, serializedPushSubscriptionDetail
5
5
  appId: string;
6
6
  }): Promise<DataCollectionRequestPayload>;
7
7
  export default _default;
8
- import type { EventManager } from "../../../core/types.js";
9
- import type { DataCollectionRequestPayload } from "../../../utils/request/types.js";
8
+ import type { EventManager } from "@adobe/alloy-core/core/types.js";
9
+ import type { DataCollectionRequestPayload } from "@adobe/alloy-core/utils/request/types.js";
@@ -0,0 +1,6 @@
1
+ declare function _default({ payload }: {
2
+ payload: DataCollectionRequestPayload;
3
+ }): Request;
4
+ export default _default;
5
+ import type { DataCollectionRequestPayload } from '@adobe/alloy-core/utils/request/types.js';
6
+ import type { Request } from '@adobe/alloy-core/utils/request/types.js';
@@ -12,9 +12,9 @@ declare function _default({ config: { vapidPublicKey, appId }, storage, logger,
12
12
  window: Window;
13
13
  }): Promise<void>;
14
14
  export default _default;
15
- import type { Storage } from '../../../utils/types.js';
16
- import type { Logger } from '../../../core/types.js';
17
- import type { EventManager } from '../../../core/types.js';
18
- import type { IdentityManager } from '../../../core/identity/types.js';
19
- import type { EdgeRequestExecutor } from '../../../core/edgeNetwork/types.js';
20
- import type { ConsentManager } from '../../../core/consent/types.js';
15
+ import type { Storage } from '@adobe/alloy-core/utils/types.js';
16
+ import type { Logger } from '@adobe/alloy-core/core/types.js';
17
+ import type { EventManager } from '@adobe/alloy-core/core/types.js';
18
+ import type { IdentityManager } from '@adobe/alloy-core/core/identity/types.js';
19
+ import type { EdgeRequestExecutor } from '@adobe/alloy-core/core/edgeNetwork/types.js';
20
+ import type { ConsentManager } from '@adobe/alloy-core/core/consent/types.js';
@@ -1,4 +1,4 @@
1
- /** @import { Identity } from '../../utils/request/types.js' */
1
+ /** @import { Identity } from '@adobe/alloy-core/utils/request/types.js' */
2
2
  /**
3
3
  * @typedef {Object} PushSubscription
4
4
  * @property {string} endpoint - The push service endpoint URL
@@ -1 +1,4 @@
1
1
  export { default as activityCollector } from "./ActivityCollector/index.js";
2
+ export { default as advertising } from "./Advertising/index.js";
3
+ export { default as personalization } from "./Personalization/index.js";
4
+ export { default as pushNotifications } from "./PushNotifications/index.js";
@@ -0,0 +1 @@
1
+ export { default as context } from "./Context/index.js";
@@ -1,5 +1,6 @@
1
- declare function _default({ locationSearch, dateProvider, orgId, logger }: {
1
+ declare function _default({ locationSearch, locationHash, dateProvider, orgId, logger, }: {
2
2
  locationSearch: any;
3
+ locationHash: any;
3
4
  dateProvider: any;
4
5
  orgId: any;
5
6
  logger: any;
@@ -2,9 +2,6 @@ export { default as audiences } from "../components/Audiences/index.js";
2
2
  export { default as consent } from "../components/Consent/index.js";
3
3
  export { default as eventMerge } from "../components/EventMerge/index.js";
4
4
  export { default as mediaAnalyticsBridge } from "../components/MediaAnalyticsBridge/index.js";
5
- export { default as personalization } from "../components/Personalization/index.js";
6
5
  export { default as rulesEngine } from "../components/RulesEngine/index.js";
7
6
  export { default as streamingMedia } from "../components/StreamingMedia/index.js";
8
- export { default as advertising } from "../components/Advertising/index.js";
9
- export { default as pushNotifications } from "../components/PushNotifications/index.js";
10
7
  export { default as brandConcierge } from "../components/BrandConcierge/index.js";
@@ -1,4 +1,3 @@
1
- export { default as context } from "../components/Context/index.js";
2
1
  export { default as dataCollector } from "../components/DataCollector/index.js";
3
2
  export { default as identity } from "../components/Identity/index.js";
4
3
  export { default as libraryInfo } from "../components/LibraryInfo/index.js";
@@ -1,9 +1,5 @@
1
1
  /**
2
2
  * @typedef {import("./core/types.js").AlloyMonitor} AlloyMonitor
3
3
  */
4
- /**
5
- * @typedef {import("./components/PushNotifications/types.js").ServiceWorkerLogger} ServiceWorkerLogger
6
- */
7
4
  export const Types: {};
8
5
  export type AlloyMonitor = import("./core/types.js").AlloyMonitor;
9
- export type ServiceWorkerLogger = import("./components/PushNotifications/types.js").ServiceWorkerLogger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/alloy",
3
- "version": "2.32.1-beta.1",
3
+ "version": "2.33.0",
4
4
  "description": "Adobe Experience Platform Web SDK",
5
5
  "type": "module",
6
6
  "repository": {
@@ -68,7 +68,7 @@
68
68
  "commander": "^14.0.2",
69
69
  "rollup": "^4.52.5",
70
70
  "rollup-plugin-license": "^3.6.0",
71
- "@adobe/alloy-core": "^1.1.2-beta.1"
71
+ "@adobe/alloy-core": "^1.1.2"
72
72
  },
73
73
  "devDependencies": {
74
74
  "glob": "^11.0.3",
@@ -0,0 +1,32 @@
1
+ /*
2
+ Copyright 2023 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {
14
+ objectOf,
15
+ string,
16
+ arrayOf,
17
+ boolean,
18
+ } from "@adobe/alloy-core/utils/validation";
19
+
20
+ export default objectOf({
21
+ advertising: objectOf({
22
+ id5PartnerId: string(),
23
+ rampIdJSPath: string(),
24
+ dspEnabled: boolean(),
25
+ advertiserSettings: arrayOf(
26
+ objectOf({
27
+ advertiserId: string().required(),
28
+ enabled: boolean().required(),
29
+ }).noUnknownFields(),
30
+ ),
31
+ }).noUnknownFields(),
32
+ });
@@ -0,0 +1,80 @@
1
+ /*
2
+ Copyright 2025 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ // Cookie Keys
14
+ export const ADVERTISING_COOKIE_KEY = "advertising";
15
+ export const SURFER_ID_COOKIE_KEY = "surfer_id";
16
+ export const RAMP_ID_COOKIE_KEY = "ramp_id";
17
+ export const ID5_COOKIE_KEY = "id5_id";
18
+ export const LAST_CLICK_COOKIE_KEY = "_les_lsc";
19
+ export const LAST_CONVERSION_TIME_KEY = "lastConversionTime";
20
+ export const DISPLAY_CLICK_COOKIE_KEY_EXPIRES = "displayClickCookieExpires";
21
+ export const RAMP_ID_EXPIRES = "rampIdExpires";
22
+ export const LAST_CONVERSION_TIME_KEY_EXPIRES = "lastConversionTimeExpires";
23
+ // URL Parameters
24
+ export const SKWCID_PARAM = "s_kwcid";
25
+ export const EFID_PARAM = "ef_id";
26
+
27
+ // Identity Types
28
+ export const SURFER_ID = "surferId";
29
+ export const HASHED_IP = "hashedIp"; // logical key — matches surferId/id5Id/rampId casing
30
+ export const HASHED_IP_ADDR = "hashedIPAddr"; // cookie key only
31
+ export const RAMP_ID = "rampId";
32
+ export const ID5_ID = "id5Id";
33
+
34
+ // Default Values
35
+ export const UNKNOWN_ADVERTISER = "";
36
+ export const DEFAULT_THROTTLE_MINUTES = 30;
37
+ export const DEFAULT_COOKIE_EXPIRATION_MINUTES = 527040; // 365 days
38
+
39
+ // Event Types
40
+ export const AD_CONVERSION_CLICK_EVENT_TYPE = "advertising.enrichment_ct";
41
+ export const AD_CONVERSION_VIEW_EVENT_TYPE = "advertising.enrichment";
42
+
43
+ // XDM Paths
44
+ export const XDM_AD_CLOUD_PATH = "_experience.adloud";
45
+ export const XDM_AD_ASSET_REFERENCE = "adAssetReference";
46
+ export const XDM_AD_STITCH_DATA = "adStitchData";
47
+ export const XDM_AD_ASSET_DATA = "adAssetData";
48
+ export const XDM_ADVERTISER = "advertiser";
49
+ export const TRACKING_CODE = "trackingCode";
50
+ export const TRACKING_IDENTITIES = "trackingIdentities";
51
+
52
+ // Script URLs
53
+ export const ID5_SCRIPT_URL = "https://www.everestjs.net/static/id5-api.js";
54
+
55
+ // Surfer ID Configuration
56
+ export const SURFER_PIXEL_HOST = "pixel.everesttech.net";
57
+ export const SURFER_USER_ID = "1";
58
+ export const SURFER_TIMEOUT_MS = 5000;
59
+ export const SURFER_TRUSTED_ORIGIN = "www.everestjs.net";
60
+ export const SURFER_PARAM_KEY = "gsurfer";
61
+ export const SURFER_IP = "clientIp";
62
+
63
+ // Error Messages
64
+ export const ERROR_ID5_PARTNER_ID_REQUIRED = "ID5 partner ID is required";
65
+ export const ERROR_RAMP_ID_MAX_RETRIES =
66
+ "Failed to retrieve RampID after maximum retries";
67
+
68
+ // Log Messages
69
+ export const LOG_AD_CONVERSION_START = "Processing ad conversion";
70
+ export const LOG_COOKIE_WRITTEN = "Ad tracking data saved";
71
+ export const LOG_CONVERSION_TIME_UPDATED = "Conversion timing recorded";
72
+ export const LOG_SENDING_CONVERSION = "Submitting ad conversion data";
73
+ export const LOG_ALL_IDS_THROTTLED =
74
+ "Ad conversion paused to prevent duplicate submissions";
75
+ export const LOG_ALL_IDS_USED = "Ad conversion already processed";
76
+ export const LOG_ID_RESOLVED = "Ad identity available";
77
+ export const LOG_ERROR_RESOLVING_ID = "Unable to obtain ad identity";
78
+ export const LOG_ID_CONVERSION_SUCCESS = "Ad conversion submitted successfully";
79
+ export const LOG_AD_CONVERSION_FAILED = "Ad conversion submission failed";
80
+ export const DISPLAY_CLICK_COOKIE_KEY = "ev_lcc";
@@ -0,0 +1,24 @@
1
+ /*
2
+ Copyright 2023 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ export default ({ handleOnBeforeSendEvent, sendAdConversionHandler }) => {
14
+ return {
15
+ lifecycle: {
16
+ onComponentsRegistered() {
17
+ // Fire-and-forget: don't return the promise so we don't block
18
+ // the configure command from resolving while waiting for consent.
19
+ sendAdConversionHandler();
20
+ },
21
+ onBeforeEvent: handleOnBeforeSendEvent,
22
+ },
23
+ };
24
+ };
@@ -0,0 +1,94 @@
1
+ /*
2
+ Copyright 2023 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {
14
+ LAST_CLICK_COOKIE_KEY,
15
+ LAST_CONVERSION_TIME_KEY,
16
+ LOG_AD_CONVERSION_START,
17
+ LOG_AD_CONVERSION_FAILED,
18
+ AD_CONVERSION_CLICK_EVENT_TYPE,
19
+ TRACKING_CODE,
20
+ TRACKING_IDENTITIES,
21
+ LAST_CONVERSION_TIME_KEY_EXPIRES,
22
+ } from "../constants/index.js";
23
+
24
+ /**
25
+ * Handles click-through ad conversions
26
+ * @param {Object} params - All required parameters
27
+ * @param {Object} params.eventManager - Event manager for creating events
28
+ * @param {Object} params.cookieManager - Session manager for cookie operations
29
+ * @param {Object} params.adConversionHandler - Handler for sending ad conversion events
30
+ * @param {Object} params.logger - Logger instance
31
+ * @param {string | string[]} params.skwcid - Search keyword click ID
32
+ * @param {string | string[]} params.efid - EF ID parameter
33
+ * @param {Object} params.optionsFromCommand - Additional options from command
34
+ * @returns {Promise} Result of the ad conversion tracking
35
+ */
36
+ export default async function handleClickThrough({
37
+ eventManager,
38
+ cookieManager,
39
+ adConversionHandler,
40
+ logger,
41
+ skwcid: rawSkwcid,
42
+ efid: rawEfId,
43
+ }) {
44
+ const skwcid = Array.isArray(rawSkwcid) ? rawSkwcid[0] : rawSkwcid;
45
+ const efid = Array.isArray(rawEfId) ? rawEfId[0] : rawEfId;
46
+
47
+ logger.info(LOG_AD_CONVERSION_START, { skwcid: skwcid, efid });
48
+
49
+ const event = eventManager.createEvent();
50
+ if (
51
+ typeof skwcid !== "undefined" &&
52
+ typeof efid !== "undefined" &&
53
+ skwcid.startsWith("AL!")
54
+ ) {
55
+ const clickData = {
56
+ click_time: Date.now(),
57
+ skwcid,
58
+ efid,
59
+ };
60
+ cookieManager.setValue(LAST_CLICK_COOKIE_KEY, clickData);
61
+ }
62
+
63
+ const xdm = {
64
+ _experience: {
65
+ adcloud: {
66
+ conversionDetails: {
67
+ ...(typeof skwcid !== "undefined" && {
68
+ [TRACKING_CODE]: skwcid,
69
+ }),
70
+ ...(typeof efid !== "undefined" && {
71
+ [TRACKING_IDENTITIES]: efid,
72
+ }),
73
+ },
74
+ },
75
+ },
76
+ eventType: AD_CONVERSION_CLICK_EVENT_TYPE,
77
+ timestamp: new Date().toISOString(),
78
+ };
79
+
80
+ event.setUserXdm(xdm);
81
+
82
+ cookieManager.setValue(LAST_CONVERSION_TIME_KEY);
83
+ cookieManager.setValue(
84
+ LAST_CONVERSION_TIME_KEY_EXPIRES,
85
+ Date.now() + 91 * 24 * 60 * 60 * 1000,
86
+ ); //expires in 91 days
87
+
88
+ try {
89
+ return await adConversionHandler.trackAdConversion({ event });
90
+ } catch (error) {
91
+ logger.error(LOG_AD_CONVERSION_FAILED, error);
92
+ throw error;
93
+ }
94
+ }
@@ -0,0 +1,50 @@
1
+ /*
2
+ Copyright 2023 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ /**
14
+ * Creates a specialized handler for ad conversion events.
15
+ * This follows a similar pattern to the media event handling in the StreamingMedia component.
16
+ */
17
+ export default ({
18
+ sendEdgeNetworkRequest,
19
+ consent,
20
+ createDataCollectionRequest,
21
+ createDataCollectionRequestPayload,
22
+ logger,
23
+ }) => {
24
+ /**
25
+ * Tracks an ad conversion event by sending it directly to the Edge Network
26
+ */
27
+ const trackAdConversion = ({ event }) => {
28
+ const dataCollectionRequestPayload = createDataCollectionRequestPayload();
29
+ dataCollectionRequestPayload.addEvent(event);
30
+ event.finalize();
31
+ const request = createDataCollectionRequest({
32
+ payload: dataCollectionRequestPayload,
33
+ });
34
+
35
+ return consent.awaitConsent().then(() => {
36
+ return sendEdgeNetworkRequest({ request })
37
+ .then(() => {
38
+ return { success: true };
39
+ })
40
+ .catch((error) => {
41
+ logger.error("Failed to send ad conversion event", error);
42
+ throw error;
43
+ });
44
+ });
45
+ };
46
+
47
+ return {
48
+ trackAdConversion,
49
+ };
50
+ };