{"_id":"@adobe/commerce-events-collectors","_rev":"66-76281a6a0b34120f8608328f49df3cfc","name":"@adobe/commerce-events-collectors","dist-tags":{"latest":"0.0.0-b0e9ee788f86104fc458c6cba356cb515c3f1ba6","qa":"0.0.0-da39dfc5be75add99d570ea82dda8bd294301f8c"},"versions":{"0.0.0-b0e9ee788f86104fc458c6cba356cb515c3f1ba6":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-b0e9ee788f86104fc458c6cba356cb515c3f1ba6","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-b0e9ee788f86104fc458c6cba356cb515c3f1ba6","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"94924fc8bbaa6e63f7bf5a2ab4667873bd1729f5","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-b0e9ee788f86104fc458c6cba356cb515c3f1ba6.tgz","fileCount":106,"integrity":"sha512-9CRcDd9Dyue3B7nPiDKyXAcLOcR92Ex5b9esaf/NC2SEYUwgyZ7bXUAial8DXGx9zaqVruhxACrwRh9HVKM9jQ==","signatures":[{"sig":"MEUCIQD6d//UsC2qCWiJlRZ8FQk49i9U1FmIdC+ySTUwiLKagwIgb1eTqhrKlPoNchqlJatjwY2aR9zYU6AvW+tOIM7601c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":184176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuyO4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpglQ//YvP8EGyvlEOvXIcZZOmYPZHFHE3TdXzMp6MbNdfPnJhb7guz\r\no62RrhkHKbf0iPmlGXfMl6xKU6wtcuosxel8j1xJiMYM+b57Du9WHlvpzN+t\r\ng6rnEy52o1qurCe3Us698X/ca/OzMjwpSe7TXl2BnAaWljZwcjiEUvBe0dIs\r\nUjGCXzUntgkFJURuyw33vd4mKZzYrXW6EKhhWfmUjD3AGvWEhRtMTp3aVrVZ\r\nqA+6Dw5e+hjc0KgG9jexLJcZ4ZynCXhyB+T4tLpmbyKg6MIo9qhKoV+otjPM\r\nF42Fr38iFdbujK+xw4iKm2SBbtU+uIu8nE9kOg6a6N7kGIhf+Nvs+yMayXaf\r\n755xO+BGt6u1nHNiuiB8UnIHmxstOCJXgVjcT9BrU/efpCQ8z0c3DiN50UPA\r\nqttQ1CI4RObwZuEEc/IffeFKfrUaemvJZajrHUZYC4/LOmiz5XZTwoSBEhX9\r\nIvj7OIisYj4X9Xh+fXZButWsTlitABUuYqNeeRvYVlndvJAxMoW0TK9yz6iF\r\nphpRexHhqz9S6d0oMxup7st6NwWyYQIj6DoCTRAvbRDSPOaJrHPHfrC3imne\r\nvUFe2fB65m08kcMrVUNMUHiY0TGPtR0hnzSQMrTaHuL9MmSAF1/faFB5VNs6\r\nqLeTlT3C22kKehov+lpSA/mBH3DhuUveHkk=\r\n=DYgb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","scripts":{"lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.9.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^4.2.0","cz-conventional-changelog":"3.3.0","@typescript-eslint/eslint-plugin":"^4.2.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-b0e9ee788f86104fc458c6cba356cb515c3f1ba6_1656431544674_0.609902419595018","host":"s3://npm-registry-packages"}},"0.0.0-5b542c476741f10746bc22a62549fbae5a51a1fb":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-5b542c476741f10746bc22a62549fbae5a51a1fb","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-5b542c476741f10746bc22a62549fbae5a51a1fb","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"242c196cf616fab5a067ac9e77fbac901c7fe491","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-5b542c476741f10746bc22a62549fbae5a51a1fb.tgz","fileCount":106,"integrity":"sha512-erWFtq7oLmoWDHUPyBNWWdBxnXVbf8hD63iFDuT+i3+IZBHuqLefnATnBNxikvhQM/Qatto9pvuv/UCbfgFlyw==","signatures":[{"sig":"MEUCIQDapo/V7e+ttxMHq/uvMtxzJprPGTY0aLcm83xrGZF+CQIgT+4DHSwupcPbtifymB2nR9PCu75R3WlVP+iB5wYaA5g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":184176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuyihACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTLw/+LRRNl41CyqKvRCjBVNPtvvlERYaDtonVQ9Dv65QysJRBa5yU\r\nsN2gxMM8fea+z6P1Xx7y2xqyvTj2U9UcQRP9rvWO6tYMbY/6AaAEiga254CE\r\n3bSNTMYodQWzj68AOnPBoOAR1OnmwmhKHf35jhIrZy/Xue9xARdhhXtbh2xi\r\ncM/+NnA+u0eLwMqkDm046Kpg5Wj/mmnSMK4etQ1PttnLbRbomzEziTlbgDZF\r\nMdAxH8L5tow2qZsWKSQRzz0UiBW/HdIB6loYLt3CVqwuG2o67yDEwLdgNza5\r\nSJvRje6Vo13Bt01sAKyoND75lfMZvs76VVJY2cnUin8slXuoHQjiIxJgwgfv\r\nicSGXMqyg6G74bCvmiWASrVItoHPfX0UElk22Sdxb86xDGPczDYD8yxKm/of\r\nZgxF8ZJo0SrDo5Wkxl47IpNohZgPNAfOE88fd/ORDJdROQxJoQi6vQskiILq\r\nnkM6ugk06nWgTPx/dAhcXQggZUubz9KM6tRTS5D2EO3kVk3Csb8fNYPS3ok/\r\niGrZOmriQPWlhIhSpu9cPNdS1oO0iPoXpBP4WmXDMxv+xVDcaZXVjb35giNB\r\nIN7NpcecepN3W+txlcJ2Q94+F0Pk/uu71U4rUCK9GsHttbH+pv/sZWp7D4zT\r\nQIQx4jKHab2u1whWPI9oFf1+XKyV4n8sbzs=\r\n=ATb6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Magento Storefront Event Collector\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Magento Storefront Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the SDK as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/magento-storefront-event-collector/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/magento-storefront-event-collector\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/magento-storefront-event-collector\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://docs.magento.com/user-guide/stores/compliance-cookie-restriction-mode.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = $ => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\n        \"user_allowed_save_cookie\",\n    );\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/magento-storefront-event-collector\n[version-badge]: https://img.shields.io/npm/v/@adobe/magento-storefront-event-collector.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/magento-storefront-event-collector?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/magento-storefront-event-collector\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/magento-storefront-event-collector?style=flat-square\n[actions]: https://github.com/adobe/magento-storefront-event-collector/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/magento-storefront-event-collector/publish-latest?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fmagento-storefront-event-collector\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/magento-storefront-event-collector?style=flat-square\n[contributing]: https://github.com/adobe/magento-storefront-event-collector/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/magento-storefront-event-collector/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/magento-storefront-event-collector\n[issues]: https://github.com/adobe/magento-storefront-event-collector/issues\n","scripts":{"lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.9.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^4.2.0","cz-conventional-changelog":"3.3.0","@typescript-eslint/eslint-plugin":"^4.2.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-5b542c476741f10746bc22a62549fbae5a51a1fb_1656432801278_0.6327984340527579","host":"s3://npm-registry-packages"}},"0.0.0-a7a94d6fd08468c128f1887ecd8e2157eaaf4856":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-a7a94d6fd08468c128f1887ecd8e2157eaaf4856","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-a7a94d6fd08468c128f1887ecd8e2157eaaf4856","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"cf29d0634d7af10bb99847ea3b83550a97f3cb63","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-a7a94d6fd08468c128f1887ecd8e2157eaaf4856.tgz","fileCount":106,"integrity":"sha512-xphBONKJt5KcWpYKTwbvnVC4ETF2sE3lRiNeXIHgudqmclirCtfuDausWoiEknMSTRWz3HaysAeLMwM47zpfFg==","signatures":[{"sig":"MEUCIQD+q8i3jasyx3YPVZ7C15SCQZDzIodwNF3WtMYxx9nsVAIgdjbU588+rtvTswNiMSZ4V963JYpVOQPPwVbFeWkgQco=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":184038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiu3PaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVbA/8DjRlM0QYssNX/MfeM6qTrdgusKXp2iDlTpCgfe0PkRh4piLD\r\nsKnTbgjJ+4bWkoB7F0OWkPoOsnLjmI8tWxktV0IWAQecnsMGNtf2ajZvpFb+\r\n0isZc+wBk2pyhp5efPvNu7EbOWx7kLp/1ebWQK6peNMex2W7tC+tJ0gyvApN\r\nJb0T3DjW4q7iognxkEnjHmPcpRHZRGlXk8FDg+mlTXPVC0nuFss6UbDkQ/h4\r\nxTMzbw27I0/LLDAwhq18QOz+bMUiIdLWx7hMmqsGyFTV9y1X8KHtE+3puyGn\r\ndmdFgsmA+4whkuITYh5ml7qJAsMkGzdMjrtWncxoDdiVxgMe6ptrI6xefL4b\r\njc4REAbokX3nOkmIN4BQbPnkjyDjZ1oFPZ81t+GK3URIp8/qav56e96NcASk\r\ntx7hYzbTfN9lhJGlhfEMB1ckc31OmIWrPB+IjsIu/m4/seaw9+zOYx4AWvJS\r\noR773GLY0J283QL2wZ5CaaHSvCAPlnW/uJ2kN9ZX/Fi3vTUr7FaH+ZMfUFps\r\nrFkoKS7yNyiEprvRcrsX+U0DfnWV08gXNAUA4awV3CT9AofPa27aviXMsH7h\r\nPnwsyjc3FT8nWfO9ZreHNFTuLoUrDEd1fF6+DZwbOXM1gecO6P1zuavpXJMq\r\nvru+4dnUP0g1SV6GsaonUs2MKC7sAdLIOHE=\r\n=UBV2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = $ => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\n        \"user_allowed_save_cookie\",\n    );\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.9.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^4.2.0","cz-conventional-changelog":"3.3.0","@typescript-eslint/eslint-plugin":"^4.2.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-a7a94d6fd08468c128f1887ecd8e2157eaaf4856_1656452058384_0.878072402855139","host":"s3://npm-registry-packages"}},"0.0.0-b272aaffa8d0351753f4f37470429258d96ef46e":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-b272aaffa8d0351753f4f37470429258d96ef46e","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-b272aaffa8d0351753f4f37470429258d96ef46e","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"db8d990b499162cf90c05338f6119fb317ca0774","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-b272aaffa8d0351753f4f37470429258d96ef46e.tgz","fileCount":186,"integrity":"sha512-ixVEg0z81wk/sLFUVlNjO8Qdu+eZpjO7d2qACXRWu3+kIvRudLmwS25Bkl0glkjW1v55fl0j/fBlxmfe+T+8sQ==","signatures":[{"sig":"MEQCICmojMqIUSZY7/DjKWev8HeYSPDEqzWesFpHZGyjdc2aAiAunDl5P7K30wVuXKg07zdRWb0Riy1mKPZe9dgL6de/fg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":215203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivJQQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqiQQ/+IxmezmjT5R9RQUgcsqKJay5eD9GXIpB/nYO0GyKR7m+E5G3R\r\nLJXIB8T3XRnidnjvOmRY71WALISEZXlqJKyMft2ogR/fdVI7tQh2Z1v5cysZ\r\niKp1dBhl8j+igYwFpUbP452hOepRHq/+oQtVeq5aIoo28j3qAKfVzMpBsojm\r\nKxUZVeH3edPYoJ7LQUCnR/9Y35cm82kLrRLbAYRjcpxChZBamXxU8uLe4BrU\r\nt77ssjJdJOG+cMdoryZOOwAV/t6e9i94q0pM+fWOQz7Ozd5MUQgb2rcusK+9\r\nKcrOhbJ0l5FbenwX3/wrNDZNC+9Bq/w3MKJMD67f1nb5ScAT66nr8n2gpRWq\r\nWG1FdlnbCReKFyjGKJlOcUD+tWO4VXjh7Pic7HedW0Prk9Z9fg6uxIb6DHxd\r\nkbChzkTt51D2g71EO/cgn9vwnAXeu7fGVc1KFET8rWB4E1Gy0xhxNgihcX7P\r\nHG8V57wHGlLMZ79LILhZ8CK/dgiMfv6x5w4dl87WXKQpRsdLZqHlatmxufjL\r\nls9DjaJSCwO6zdyp4xHvH/93b2As36Xv/g2b4WH5VXSntdSwJ1DC70HArdBm\r\ngyQmAIx0TD2XWGUky2psA6YFWSr24sx71nkoXcmGrNPtdFX/9Q5jt9K4ObVE\r\nXJRDLoL1ejd+3WyqeK+BfdgfK4OZJeKAnL0=\r\n=R6LU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.9.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^4.2.0","cz-conventional-changelog":"3.3.0","@typescript-eslint/eslint-plugin":"^4.2.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-b272aaffa8d0351753f4f37470429258d96ef46e_1656525840012_0.29056382859641605","host":"s3://npm-registry-packages"}},"0.0.0-445610123d377edb9fe3238feea8b8effbd1dc2e":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-445610123d377edb9fe3238feea8b8effbd1dc2e","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-445610123d377edb9fe3238feea8b8effbd1dc2e","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"0f25b7b538495127845123c96110e4f4cbe20216","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-445610123d377edb9fe3238feea8b8effbd1dc2e.tgz","fileCount":186,"integrity":"sha512-aNoTfstY9OgWiuSot2xVlhx9qj7nNzVgUjiKJm1uPM++JT5d482l4t0iT4Qc9dl8w68j5QbjromHBvqf8G/CUg==","signatures":[{"sig":"MEUCIQCGK+SG1Olzz3n0G13KL057cGNBQ3AEC+IOeBqptmyRhwIgRn/Z1h+imWW6g6jY8Y9THJu+Hrdruxi6/T2CQK4p9As=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":215213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivJY+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/1BAAlDedWPfxnv6fzqjQofNIS4+N0a5NowRRLzITluW920cxHlqr\r\nRsz4N0DgEdOv6LaoP7wZpVX+Qq68Ug58iPLRTwBt1KficNsKvj+uAXCPcu1G\r\naXDUV3uTD3z1tNo+jq8e46p9TbqjmbzmIzkmua8JVaqI3eQ/E5XOu8ECbDtO\r\n1jEUUZzPTtQphyom0Tpo7j5vLIFMlDISH3uLrRGlugZPnnhCGipV6tKD8Npy\r\nUDgv/xw1Vjxmce8pSb48Hyx19MsuGpLPQQgvm9pYhN+gQqM5BBlqvAMpgwbl\r\nQp3kCmGAyPrnxOwMd6R43Kkgrgt/vqR1BrRRUq9w8guorZ6njTBNWqGr337Z\r\n6WMWj5vzAkDpGInqrxBoLtZqDc5CrL4wKlwl8hmtZeUj4pb802IbJFidSnEF\r\nCUIsC8Q2AwCR1Rb91hzuzJtQ7T5FfmptNJt9KRlYRYs96woRdiGBCkPavSv5\r\n5cu6xaFzt90j+U4X6IgiMFtWwh240PU/2qnw+LBmrolkW5Ei8Y2Sl3InR3yY\r\nNXzVqm9qHPg5nFhIzrhaNgQaYHCvoeh4GpQFSX34y+mCVhrzvzeiRBdkkpFT\r\nOwOBR+j0Rs3tQUGOzHXra6SwzvJAsvUPITVgDEkDKXCsVYj2LtBrhhLkqc3R\r\njGx6HYWrAy4xMbngtBY3yGa1F3oom4DEnBc=\r\n=inrr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.9.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^4.2.0","cz-conventional-changelog":"3.3.0","@typescript-eslint/eslint-plugin":"^4.2.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-445610123d377edb9fe3238feea8b8effbd1dc2e_1656526398628_0.9448662965991736","host":"s3://npm-registry-packages"}},"0.0.0-8fb54ed8430bedfed83efab09762c83d3d23b5bc":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-8fb54ed8430bedfed83efab09762c83d3d23b5bc","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-8fb54ed8430bedfed83efab09762c83d3d23b5bc","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"b65fa0c5bb44218eb9ccd6a8b0a87c4541701943","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-8fb54ed8430bedfed83efab09762c83d3d23b5bc.tgz","fileCount":186,"integrity":"sha512-JRF/X6DHw5W6aPsSWUu+eIw0IwjymyPQ/v2YhXG5nWFve+hAR6V4Zsn/oqGQwZmoTvYNqaPYvo6wyCBdRE2hag==","signatures":[{"sig":"MEUCIQDBsacbmhxmV63bhnuIagSAwLRpdn1PtrHmM65qJxE9sQIgBjHMVjXgz7McvuOKpDUznZbaWLhNOqbnSHgcPWXgN/I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":215269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizcizACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrj8RAAnBMYRynyHSq818MsGEohILRsjUYZslbThoOrctQz2sURV4o4\r\nj9BvINzhjXjzX6FPwbWery0T5uZcG1N1LVjj8apWtZBynHuY7eExjWCMX9bC\r\nzpPqEMEmkRB/IAJC5DfubYwvfdDDXb5Sx6zeL81GUpi/6Dbu02NlE9ru2RkS\r\noOlj/S2M86/6Lq0bRnAA6TM1Rvuhov5yL61LRt130VaUAhlMFyyNKOQOTn7j\r\nR7pfAXDenw+9rmZAhc09Ff6igvzx/fjX2A24rH1TLyGt0iGhUaVpuhppLJha\r\n/J0LGLs/MtGfex08vlSxZnY2oAFlxepDjYNl705OFZUdTa+utRbuJ8MfQ/Cm\r\nv4zWymb0p1sFED9AM74Ny8OVikinWfiHYJ3mYcZm2+s9FBTMCzwe/tjOC/kq\r\nrNq7iKTasruJHHi4conX+4oalYhhkjPaLJ1FlanKmI/UZ0y88HjwppthTF2T\r\nx/LhxATVH3PqKEVNn5GAqVzsSLKFyXG1DbTxE6umFb4st1a/RDkUkBa4jMtM\r\nkK5dwXpFjcDzztllLG082LhdZW3Jf+tJeNwDGlWwMkbDc+TDmGHJMnjNOsT6\r\nqWEgQQxFTQ+FdOjrscEtiXOq8fJRbNj5a9TU6TJsk10koszxTOGi2QCe3aDZ\r\nsfIQ+WiNxA1ogDmebk5/g4D/opfNVGPGi+g=\r\n=NzJa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.9.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^4.2.0","cz-conventional-changelog":"3.3.0","@typescript-eslint/eslint-plugin":"^4.2.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-8fb54ed8430bedfed83efab09762c83d3d23b5bc_1657653426896_0.11403822082172255","host":"s3://npm-registry-packages"}},"0.0.0-d974b558b86db36db72fcb7a172019b9eeac770e":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-d974b558b86db36db72fcb7a172019b9eeac770e","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-d974b558b86db36db72fcb7a172019b9eeac770e","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"4b8de4dddc4fd7e537a97f7ab29bcce28ef80910","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-d974b558b86db36db72fcb7a172019b9eeac770e.tgz","fileCount":186,"integrity":"sha512-2n1SvKb1XCFs4KRU8ir5NuXy+rr9yoJDlxvc1D004mkP4fSa5HlwH+ymUkmENBTFOMqcKoVNC0+MoFLiCzEiig==","signatures":[{"sig":"MEUCIQDtn2P47l/FwuH/YugX7Cl8uBXiR8YVyWwFxOrwJAreNgIgCXYCZ+lo+4Spbmoh1WGQita1mfU9f27VuCXKYqDy0gI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":215269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0FGCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsSg//QWoHdLqIyfE2rtMYPf9VN5V5MNKyqJ0V5lmvCUvqR8SjgcUo\r\ntaUkHJZJ4bjQXG+gwF/fV12+w4hAekNX0w6FAVDOr5s5BEdup/YHOL4+xdiJ\r\nwNk+uBIGf21Ni6mHoyicAd9mgGoDRzKBdP5jPKv5y1sVF+Zmeq/KeiwfpirS\r\nLbeOYF/djKfFa7EGNUh7nSGDF0jdNUjKFeroX1V9tix+7fnWDryyKHrKJfuy\r\n8tB97P57w2Gsd8TMpiS+p55qPRwWeLpxyWUfPkRd+sv+t4K3Y3jtsheUDKCn\r\nEllVSQRkcNCkgjbiuxmYduh4B2whOIBRQXexMiTHqcRiS9tKoqaZn2FPMy/d\r\nh7ZslFUEwiPx+kYKXOgOMehOf2s2Sb/haH3AGzwy7Y2lnSQis/4kMNHKOIFg\r\nL4hh90rUbKs+45901EmpGIBy9HKO982kpYvdRAVh/QqxqKwuwb99NHbygo58\r\n2O4OFYirOobSC8/+sGaKQJfTyHY55Vn57h/sEFwKruH7EVYEpeRIr315NGZu\r\n+T2j9ktk4nUdI4y6eDlIJCbbB7lq9enRDS3ut4DuqKPC6YZdcZ1QRB12i/y4\r\n6hRExauOJw/373/UT56EF0kUFuB7pi5nW39OmFzNiz5Q3c0uE9Dc1SAkkUTf\r\nccm48KRqU+O/D61mfHUjiOD7eriP+vcVvZ0=\r\n=savW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.9.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^4.2.0","cz-conventional-changelog":"3.3.0","@typescript-eslint/eslint-plugin":"^4.2.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-d974b558b86db36db72fcb7a172019b9eeac770e_1657819522320_0.36800904427361836","host":"s3://npm-registry-packages"}},"0.0.0-d8fba47d8e642308cc4ffe5f7c0f5191d1f300c7":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-d8fba47d8e642308cc4ffe5f7c0f5191d1f300c7","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-d8fba47d8e642308cc4ffe5f7c0f5191d1f300c7","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"f061ed7abcbbede6497a3740710efc8561c66666","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-d8fba47d8e642308cc4ffe5f7c0f5191d1f300c7.tgz","fileCount":186,"integrity":"sha512-ysaIWWUrGPyoXl/UYBfmptDKBNl4EX+tyw/HiPsMCyqZhIeTLwIhnzwNs/RtmHLT/VC81HXE94yj6S2U6OJx5Q==","signatures":[{"sig":"MEYCIQD/BwcSdq7br05Tmuokyzf34eKhQb/49mn8RFEWHtSY5QIhALAcv9c0R5uMBVn+AwKpPgHoaeUT+mBNnSWcjLeYrnKJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":215064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0NQ1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJSg/+N/DM+ggtqvaTCOyITIgpQO1CZZA1x22ZQlFcHILJe6P6sXyW\r\nmYs5Qo9KfZ7WCIP/rs3WbIDEBWX1JEG5eOzQ/x3nr8hGsAIytvXTLm+Mq3nd\r\nmnpy0qr+/+6+PEbEJ5myTPm7/91xroxkzDy0JayeCRBOT5xckzW0YgSckpHd\r\np6YBt+yRpypTvKy87t94qIAlG87vKXYrQrAVFlwa6m5ZZzlzHWRZukwGnxj4\r\nffm7IJJa4VGKX7zkZL+LUPYVyHb/SOiLzVaRg7beKNwXV0uQAK05aflUUgYh\r\njzZwe2n+aaWCv7bHj29y/NUeYG18BO2RbC4Rul5c1aF+KMtmXOgYVvdeYuma\r\nTp+MD9pUbr+hetc7oeSzUJhJQRNvzzc2Za2qL1nBHnyGrredCOgDru6D6fxg\r\nymkcbn4M6Vz7Cao+y2YLUyfrvMnSV+/s0yfoAtnHLwQe833OkRVdwQPUpc9p\r\nvNzKOW9rZziyID22FiVLvc+G6bbVfBKb84/DpQFma6z8JxxV1Yk3M0T5y4PR\r\n5cLKDCs2TYTDjifsELflVDfbxPcgvkRNTIBFYcm7EjxvIuMhx5m135NZc0nV\r\nnt3oYCRy71zfNQFsUQScvbA5lK6giJgiyFhYHhXI0MUkvSEJq1NmA6wawRQY\r\nO/zaYTWsSuqFT7M9RzuIQ8SM7CZY+SakouI=\r\n=7jFA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-d8fba47d8e642308cc4ffe5f7c0f5191d1f300c7_1657852980801_0.42820897468682584","host":"s3://npm-registry-packages"}},"0.0.0-32ddd83b7b870ad17a3965f8cc6fc6bd46145d64":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-32ddd83b7b870ad17a3965f8cc6fc6bd46145d64","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-32ddd83b7b870ad17a3965f8cc6fc6bd46145d64","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"5fe64f2471ac6be268cb97350a10c71bbcbf3c31","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-32ddd83b7b870ad17a3965f8cc6fc6bd46145d64.tgz","fileCount":185,"integrity":"sha512-hbWqJsjIaL2QfDYi9HvHNGzKadSag7YKpkHIadlfidka6olyg99C8iQVRLufZDb69KMVineIWHcNJAXrI3SqDA==","signatures":[{"sig":"MEUCIBm3CVNVDDExW3RCdSHKjqIBFYV+yxBxqaHDo/o3ATNuAiEA2/uDDhPBHMq+z9qZrlh1uSnkSe8yRWEwSDu+j5C0xic=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2587064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0cugACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQHw//SnnoBpuoXL8OYOKfKHUH9I8ZABBwI0SyAAjOtmKmO0xWDQOQ\r\nwen1TnXYAnQJh8bc0m6vqbpw16uX5JHkMo1Wa9Uvn4axCj/mX89Xhh6uHBxe\r\nVubrOVxL3A22UaHVPFYpXOGeUAQRgveRcuDnANVs7F8WL7LaNX1dvYtxvKra\r\nm7kVtyFlz1fsxjlE0+rwVQQym9z0F3VHCzdCKcwBnx31yIZwOFJgJn9ougtD\r\nOvqiT3gNuGEkXzyrjAwZDPQdv2nF6l6N3z2lRj3PzyGQ1TYcfpkx91RGrBId\r\nAsBnuV5qJIkW4X5hL5E6UUNzAznWHtkVWEh5aYjBIRdb+dS4B8pbBz3FZplC\r\nEaO2mWSaNcmR0Xz4vJQlE9uu1eWL5J18I/eQSr4DBkue3b3MkjtMwdsc1Vp6\r\nDHCOmPkPxxyIZwQTE3GTgFGDh5jqK8fkog7NjSe0mujMPHq8SPn90qNx6VHN\r\nd74tpZya2lmtxrtJSaA8WKss5zD64mVU8oGYXUF7U1d2+IREwaBUpBT/reQ5\r\nz7wB4i3j5g0TCTf0YpiXLsXgHwd3ytwTqS8xbRjriWmBXuT6atOreDABgUdI\r\nIfIE/+0eAiZDL8qvSVCKxDceADE7CFIikDYZ81ztYphxwwXsFalpZIpoG0pD\r\nQhw/DoHgN3wwfUOa2gWNdjv8KKDGnLifRsk=\r\n=cXlg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-32ddd83b7b870ad17a3965f8cc6fc6bd46145d64_1657916319857_0.6451870757519294","host":"s3://npm-registry-packages"}},"0.0.0-27995b9ed59f8a6940dd3ede9b88aa7a7b16e617":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-27995b9ed59f8a6940dd3ede9b88aa7a7b16e617","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-27995b9ed59f8a6940dd3ede9b88aa7a7b16e617","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"7c4595363cdaa3a613a111920b4d1445ce186873","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-27995b9ed59f8a6940dd3ede9b88aa7a7b16e617.tgz","fileCount":185,"integrity":"sha512-lmBdjFM9yNUif2nVkwa4sF6IHL4mfZsrT5A8bjpkim+Pet8W8Zc0nBIUsnX0Pxxms5GSHqqL77WEdlxTx+2qSQ==","signatures":[{"sig":"MEUCIQC7F2C2/78aqjPix3s8xYzrNsTgbCk5jKCQ1ODdBTQxcQIgKXWBKr1OIUb9TpSPBL4yTMG8Dbxf2pB501gOO0y+5Ss=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2Z2kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4ehAAnigFWAj08phACVwCUktD2Kskksdv6FR6WnUDkYlCNyL4KbNC\r\nPf6/13lGV+yel1RYb1OFX1C6PNs6/nPPeunLPc+pYA+WUM9EIMdiI3ZLW2Y8\r\n7zWBy78jl4l7ZWmKgDRMpGPOoPY4ySk5HpOGettNvGMalLVtTmCvuZ5saArS\r\nDjahiB6bczSE8381qTRsaNL3OcU+96XY89lCjuqNQDpu8OC18QnsA/i+5jFe\r\nJbV8QKSoI0tyJVWNluWVbP7xy1ammC+F3RP13FCtHc8GWnVyjJXN/erwcrCp\r\n8B2EBKpTiehVCJFLz+Mncn7cqIerOk/HM39Q5tz51fi72sZ+uy16Zio4bgCn\r\ndaMYDirWB97vXrOow+u7npoUBoFAcswioj+GBzTmtvoXR4rlJa3dJXdce6UY\r\nvINHqZG8qx8UWBYwTnBgwYs74Hrpv9BjWLIOJ22nMLPbVRtiIqfjoKIMGNhs\r\nnFJ0lqpq9lOqt/oQseLxY3/0Ad/bRwD/n9EGevNmnN2HkoOvI03WvpZPifaU\r\nDKK+evFTEoEn8J6t7LSlWO54GgoxB/xmBWEgHSLREMwSgX2zEBr0MODa1Ri6\r\n/+yyhcxG9HpP0/4fGflQ1xIA90VqvBb4RhxLvAQ9+4oiIVDVPl5T7UrdlGn+\r\ntudI/HKRXvNFrVzTSlOec2TW4/FSASxqe58=\r\n=nkHZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-27995b9ed59f8a6940dd3ede9b88aa7a7b16e617_1658428836326_0.4922566127685788","host":"s3://npm-registry-packages"}},"0.0.0-2eeca011f4ab84122d117ca5210506dc804d116d":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-2eeca011f4ab84122d117ca5210506dc804d116d","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-2eeca011f4ab84122d117ca5210506dc804d116d","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"dbd0102ab15fa74b92318463c171a8c3d605e998","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-2eeca011f4ab84122d117ca5210506dc804d116d.tgz","fileCount":185,"integrity":"sha512-2v2oZGrASt+mhwKF6XMZhPYwKOISDX4o9OODohb+GvtwoR/E6kDw+8kJxBeBqhuU8/fAJYO6G1jMRJdT8UHwdw==","signatures":[{"sig":"MEUCID3qS7EobOXR0a4wh+QIlAWiE2gPD+LsQ0zJI5vPvR52AiEA22IDeN7karHavxlUutDTgNfV84JB0kq/ovq8+uIvv7o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4ZRgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8IhAAgrFuG+sIagCONHq8/xdXysmvjjFhz9EwNgmzcH49velXEbWN\r\n5WAybZiNW0oKJNfb6TeUp6pku9WGcFvqxUvO0//3u3wIO9Zn/Bhe68xwLyi1\r\nw1CSLges1leENgkUGa5kyH/qi13yqV5+sSYrlC2Ze2F4YPmgaINkBp4AGHSR\r\nACZvUB7PioxV4YGbHaN1M0DWtfMfnVDYkoIBOxmjDjshTsYdts6mz+m+9iR/\r\n2AbebvYo8wuAwpm3CHZRl8Ta8nzzVCN8I+R0f3jOexYTKxnTgaOjFJypHeK4\r\nBXWBQjr7u1iM+0/a3IdzwJkmJuFDEumORFFj29/j08wIYWy1v0ax+sdTYmdk\r\n+U3WV/sAXfV4zpEZz+1S6dEQYPBhktW0PZT83rf5eGdvy1ySqkSpF0f6BEK8\r\nZNwwT5M+gbpKC3Yf8MRdDah6JsOKbv/bzzncTjXhhWwcxlV26mKC1j4sKhf4\r\n8PJtDipomcq191LYQAPx/I1NLTsYXRkH6MYxpUwte/7ZHNCNs5qDJT7kVURE\r\nshRH0iXq6QtY8y5zRY3vrkNo+qlFDrQWxtiJbfc09/cr22WZSmrOX4LpuoEK\r\nNRujcQJYVrf55RzIBT9HPGf/TFEfEg4Lo2rbAehsx1B7u6fXpwR4a2FmhCDF\r\ndQZVFfZZ0GC4ZElT0CMItXIf1UKEyoRNndQ=\r\n=mq+b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-2eeca011f4ab84122d117ca5210506dc804d116d_1658950752057_0.20561222293508252","host":"s3://npm-registry-packages"}},"0.0.0-9d20d0266cc42933fb7e3ecc99480ebe64561d29":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-9d20d0266cc42933fb7e3ecc99480ebe64561d29","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-9d20d0266cc42933fb7e3ecc99480ebe64561d29","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"09d4e9aa0c17b1a1cb3fddadacc24a787639654e","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-9d20d0266cc42933fb7e3ecc99480ebe64561d29.tgz","fileCount":185,"integrity":"sha512-5cHG1FBjtZtQqIc6Gjf9Sa6kl1LEUnNHn3ey+eSgvX2OsowNuDyTWUgHDiXsox8oBvhTtElf7LrqMqNpIFTKuw==","signatures":[{"sig":"MEQCIC0KxKZRfvk1xVXIsLzlfyJNYMvByLomPLXBAtez+hL3AiBKVhzy64LZe5k5THLj4ep0J0AZq+daHiwKoyg8p2FY5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4ZXQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOhxAAnS6Y/f7/XkMC11VbYug7c6rYSo/gDM4U7A5WOwTE01AVaNaz\r\n43WaibGiv0vvA4/0ULYj2GSjk2RTppk7W3RuJ7YaweAtcARTqneIiEDTmdAX\r\n/EfFcL7laIYHJYREiScTAQxG7EKnHg2jM0OV24bkTQG2KIqnYHbhjFqNjfgh\r\nil+26Qb1/Gxdy3RMGI/BK3rSSzE9LPJ2FVWnOK/CWDfjXORDOw3nl16ugoVD\r\nND1/sGrAiUMwrakUrGkJYXA3j4A7amiOCrG9AYXIGnVzcHTHA4xj2u1eYkE+\r\nduOpv2fkjL8+6s6BuPbzQaqGV+BTrq0pR0Yb1cOOpe1p3rnYmouVW95OWOVj\r\nMELye7QG5R12+Fw3Tv9RSDEfY5cRwdCAGeJY09LPaTdLSmrPxK/lbD8ESXfv\r\nM2BYp/yzPSKWwKyMB9uST4cRI8MC2lQVoqq7uMEftA+pBS/OBW6d5QPTJ887\r\nMlKJTq4D+0yMHE9PF3N8lCqS89grEhsRATo+bUfqeiim7TaF17aYTfcfC/E0\r\nJvBp5ZfcAqgv0Maf6HrXpIA+PjoZwpDQDYaEi/iwORUHU+OoXJAeigU64BWR\r\n+LWvEd1AG8D8gQCQ0SMXG+JfOriiNspLbulBj4NBpSojsH8IiUw/4Kav6SyF\r\nziEDeLC3WzhawazX5FwdYJBnNiSi7AhBfMY=\r\n=5oOB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-9d20d0266cc42933fb7e3ecc99480ebe64561d29_1658951119814_0.25972374382604047","host":"s3://npm-registry-packages"}},"0.0.0-9eae7f0e6cd9737faa74a7d7cfede697ae883ca3":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-9eae7f0e6cd9737faa74a7d7cfede697ae883ca3","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-9eae7f0e6cd9737faa74a7d7cfede697ae883ca3","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"de0235290fbf138cf8d6393e5404c5bc9c75cbf5","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-9eae7f0e6cd9737faa74a7d7cfede697ae883ca3.tgz","fileCount":185,"integrity":"sha512-Nhtlg7y6u/vCB6w+7tJQgJmMuQHhpgp04iSBJsaZFF2t2VRrJcK0cr067RbpPL9Gp2DAuGOl6e415lchNmiQfw==","signatures":[{"sig":"MEYCIQC5t36HUmyHbNiEYL1+LFBQ2uFs/G2ttoGPaBqY1u1G6gIhAI0xTTardKCfFgLsSyqSRkuyM7fqrM64IVSqL+aP650w","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4qGRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrO/w/+Jb/QsVmfKaEvj6CCgn+4mVhybIrwkt9pcim8qBGQd0KkTpeC\r\nTQikfwp9rd2vYUMNXE7Z+l33pPv9LZfPChktQQoq/snViD4IcCg7EceCKP4l\r\ntFvTGeVa8daqMd8E9mkJqZhBd1/hhTm8UvVBIGHM9bBi5OOMdmX5PAGVLo1I\r\nZOxRfjJW8GyEFimElx/DDktuusvPrp35jpMGswX8dy+yQYJP9xWb1P91aXc6\r\n674yEWHs0Swp1EJUyabjo85nfu5RdDmoOZgjHaka5YNsetBkKjm5cYlQnkud\r\nPakG6LprM4nq3QNJ86Q9LYKNT5ml2pKFrHODiJ2lmR5lVCQIjHb4tpOW8zPE\r\nfEyMmKnhdeiY/Dlys3g4SFdernqyrGEjQIqYWha/dBvuAijKaomKMibzcocV\r\nk5Tqq8w5szs5QM74qQ4UgbiLJDUlaL09T7QshmLbSdsMnoUv4Sk5rGVDiCq1\r\nR/fD9POxN4AK/Z3lukGADYu/A5EkyaWmbEzBnPjha4oxSh8oOPrBpO1mAOvH\r\n6oX+dQajUpGuZJm72Etw8yRKkReX1ZBChdJFtheNGISl6MD1sYnaB3qeRiRK\r\nUOJ7PmJCNPuEmg0WFeYq4xrp/fxJSss/hOTWhVdq0G4LGenjueZN5Qa3YGsF\r\neFlDiswhMx+NiRbdYZBX20A/g2LzWbayDDE=\r\n=mkB4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-9eae7f0e6cd9737faa74a7d7cfede697ae883ca3_1659019665260_0.5942633426828465","host":"s3://npm-registry-packages"}},"0.0.0-5b88c2dbc8584f8671c1eb255f964ec5822a0467":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-5b88c2dbc8584f8671c1eb255f964ec5822a0467","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-5b88c2dbc8584f8671c1eb255f964ec5822a0467","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"93883f83cc74eaa2d19de414a6cf1ef7cd0136a0","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-5b88c2dbc8584f8671c1eb255f964ec5822a0467.tgz","fileCount":185,"integrity":"sha512-Q6JtjceyjCwcb/pz2ZmhwbaqHigHBeygOPxN7bZ44Z5JIPQwM5m1IGSsh1PS5c49bhOH5ynjHmRdbPKJaBclfA==","signatures":[{"sig":"MEYCIQCEgFR7J7UXpAQY9KedsDuYxyrxlICwWxFqbu69TTclRgIhAORk9oPQquEXySv36LBBFNFVBkiQm70jc9l1geSXyHpU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4sfyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmovyw/9Hh6xX9I/NTCLa9oC9YmozcgcD2sw7uVn0TGSm8sjBeCnNb2w\r\nqiROpRf0CDaMW+O81EdckFN8p8K5Wliu0lembWNHqjs1ruxs9w8147+lWMN/\r\nEKIuSZ5ZABJYARP8EJ7a2XxsIlIkp3lTcV/WTZpj0VR6IMNbREzxioW6Mfzt\r\nC95Rv0+q3Ae20z+Ztdv6prrG/FO1UMea1S/HYOWLQfeC4MfGeij/QBKCNYY8\r\nWqHY/x//tc3ElPb+Hyw0iwDGx7Ai7aDn0ZFHjQuOJ8jBfq32TC+ne1GrlWNS\r\nr1EqJsQlnbdNmYdv2gl2dDPEyjExI8DnyCQqaeMg4Zjnj96wo69Q39Kvegxs\r\nnMfJXeJEWQpkfoXKye1jKZpXKiGicLPp6vgg9DnNrJPer/Iy9s8TSYeDaUmb\r\nZr9lNHfbfdasrJ9dLRaV38t0FAZ+mndqOCzV/53fgauwW41Z/d1WFRZHOlMC\r\nEIq8H9ytRxGVXQ+eCEUJc2DY58oSBwl2FrwsFIUO6kZDPIxeFIRWHIqpbjDo\r\n3Eck/KpCWX95wpSQtCB6ajn8rEht9SDHRceaqqWT4scn8o4DMOPoHsoWojRh\r\nW6cKCIP94sgZw+pUNmNJ3lJ7J2E5CSIBhXZRWvL3fb1p2xn9FAGjSCPc0Qpw\r\n3oDSjnlc2jY861hToPjmGoyEz/aeCm4C94M=\r\n=h4b7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-5b88c2dbc8584f8671c1eb255f964ec5822a0467_1659029490010_0.4022071878110114","host":"s3://npm-registry-packages"}},"0.0.0-7bc250ab7c83c211c4266221e95622ce73ec94e3":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-7bc250ab7c83c211c4266221e95622ce73ec94e3","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-7bc250ab7c83c211c4266221e95622ce73ec94e3","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"0be35e9e35f2e4271aa3f9258c662e928cdbab59","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-7bc250ab7c83c211c4266221e95622ce73ec94e3.tgz","fileCount":185,"integrity":"sha512-Rjon4B9y7BPIfyHWjNi17LFM1YitrFGzFk1g/XTFfTeRhuyS+g2UMfO78COVpMUIjLMCeN7oEgI31yMngU+2Tg==","signatures":[{"sig":"MEQCIE+iP9ZgnXSP9+AUpV2qdrRZS0mBWl/u77S1p5fLPRRqAiAS814fTOp/HbNd0/yenFqabszwbYcE90EuURBuAgLwig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6UxfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrkvxAAhcOttzBWlkm9bBzHCjfCPTWaDobixp8ujBybONXLCqSnk3Zf\r\nSEmSFtWX98x8FSeRQYnufPi/E8cchfqssL2dMicbMNMoqHVUI93idItrOr2K\r\nOimrlgWRDfDV5xRxVPR+aN7vxWLuTEsTV1cFsaNhhKLtT9uus4ojpxxiiONc\r\nSYhY6vvQqyz8Q9lJep6kByN0KPw5tvsjnNCU3xwGe7TUrB8zncPCxL7HaqzD\r\nqnisTt7qnkKyBUm9p+jzSXy7+pZOqKGHT7lALrS+VkuDIy3z2n4GchfEEpqz\r\n+M77Hv2oUVIvuzaqILDBPjw2eW+UgmW2vNIsa+z4hqwf1csa7I8/TArOBo3Q\r\nrXMWbDdA0eaMoPvgt1GubFmcdyI9uvSCH7R7oyBHlSqVqZY7/EwGInlLqM1B\r\n/ys1LSiynYxXtJL7vXuxClFnqyemsgw6xDI285SFnGy+47YyPuqqiPHUIbb/\r\n5Mqa6RtcgmmlJGtdbowzl6J0WQ82q0PLgOo8DFNH/jbWsSI/LeSJZigiP6AS\r\nI52zxuf8KTXvyeMjdQFNQZVylvqywTcrw0G00W3HbWiy/XNzAkLPRuquks/i\r\ncslRMFSrSiBBYE7iXit9cweYBgl+0NOY/2H4w9Izk3wgw23h7WlV3cWz92KL\r\njgrLxLONU80ouLuKt+uQCBwKEJeE9pC5yYo=\r\n=rqyu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-7bc250ab7c83c211c4266221e95622ce73ec94e3_1659456607346_0.5044972308983038","host":"s3://npm-registry-packages"}},"0.0.0-610bf9b098c89b94c07da8c09e202743c5583f5a":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-610bf9b098c89b94c07da8c09e202743c5583f5a","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-610bf9b098c89b94c07da8c09e202743c5583f5a","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"094f790caa378ce7409c23db662d9045ff0da67c","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-610bf9b098c89b94c07da8c09e202743c5583f5a.tgz","fileCount":185,"integrity":"sha512-zyGSY0hwweBJ82RfgF72qo67lsCDeJMOof6ANrkJtnBjzejtOBOAEKqCMS6ua+mJpP+qhJkDZfkVYsi4IB1yuQ==","signatures":[{"sig":"MEQCICcK5dFddxQbWeWRRNca7IICDIlucSIM5h7XNzElyEP4AiAVLTpGBG8GD6KEBP4WVF4JWdqDKIfV129i0xMeh/rr/g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6WE9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmouyw//eqMGPTvFCv2/3FAdY8JAKftKs1DGy+YhG6bAsZq9Pk+cgN97\r\nfZZmZzvdQ23r/tYSpXQhdOlI+soWrUcTpLnIej2QI/YoCIGRKeivz5naj9Ny\r\nl8fE0w8+Bwpnj9uhVNPqcEZx3wl/aOtlgUkprJbdZJKv0+3YuZIv6xmZWQQ0\r\nGAzPkjZtqDea15HiT+AMQXLOpoe0RCwmZQV5WtJxvdixYNdg9C/2bfntNCGQ\r\nE2jcraCfX1Mixqk49I+9ku2N1ALGW0p3nYehgG4pdrsI6QhsRLoxOlrf6VF7\r\n/DSdP6PRL2XEYp5fT6FWeg/69YZLDc0BQ7wz/Y6vPPoefNuLZMIlR+IDLBRL\r\nAV3Yw2vbeuknxlJJTIK7Kwp642Uei2ffYx/vK7sJXjLJbJ3JpSmuBC0ioXLn\r\nJFBsFQPzNdPxfLBcP5ItIvxeMCaxsNhWNHKfdyR1pc2MkyzYbDb/HBarTRQW\r\ng/SZDnJufHjaOcgg72Y4I21uPBX+AuwbsTWpyG7c7v3j7ys/npsW8gcH50Kz\r\nhh9dLQIQjLUwhsMSLCmUpfitoIBtZmjuAFLKLFfGeUVUZRrosfR7iAsLwEh8\r\nKw5q7mMqVEVd012Ycc3W52btTy6i/oylgBt/IsX0Gq3zrgrMY63Qt3x34RXs\r\nor+RSSk8ILXoGxCsfRLqfIhDocoI3Jx4A7g=\r\n=nAya\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-610bf9b098c89b94c07da8c09e202743c5583f5a_1659461948765_0.7222459347742787","host":"s3://npm-registry-packages"}},"0.0.0-99b7ec612d5657080719687f50b4f2e49cc84e8f":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-99b7ec612d5657080719687f50b4f2e49cc84e8f","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-99b7ec612d5657080719687f50b4f2e49cc84e8f","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"124bc55eef23801007a04f658f610bc425b819e8","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-99b7ec612d5657080719687f50b4f2e49cc84e8f.tgz","fileCount":185,"integrity":"sha512-RNKudLWIn1xrA5jeIkU+RkUiYx38kSqtlzP6wteqG7YiA3TGFXnvd7AnZLonx8wnZq3PARRu56Y+wRrroUtWgQ==","signatures":[{"sig":"MEUCIDk91f9bl9x6N/u7o+iMW2cYspUzUQz0NHiQp9C3u3qjAiEAzZyA5zo1g4tMRLU43PJ+ZHu1mHZBZ2ePZcoB1ZEBdNI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6Xh1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYHA//VTBC3sKdeUOTUYT2ZLT8mSD4xwaaZJbh7FbcuG/csj1u9XG+\r\nTUSybBawFlnaW2NAaTRhd6DMzhyRG1NsRjhnouhiTUTmPbYkCgrwdxPaB1uG\r\n1kas40Fjq9/1+C58rzv9R8o+Dv5xTzaW87imSxhoenM3O/KszRSZ22K1onmA\r\nkmKIA5HwDWUtJmgCzvooekyiduow5pVDpsVzRjr02quJ2u2CJNYheb33BBTt\r\nzo2aezfs9aQJ7ZtO1V72ACE4M4AI4LdNb+dnaX+hwNY3WI4c+R0pVLlMMp/c\r\nmjngVsM57qQR7C+lS5t5qBfogGeFaacf1sBcS7Zclyf9FBASnCEUtSGlC/yn\r\nmZHSvg14WEsyH/UmnzYP53FEnTl5/Iugr2iAEZqdqWx82vcl8mC4PkWRofqd\r\n9WvcPj4mCTsWPrCr5RmnuN84mC0Jg46XshusZcgBxHcqUVw2PiExWoRHqEPL\r\n6LuaC1JWvEhKjzStkzqcXPRYqEtDhXiO+OmWp9cxMt7T4OQ1bRQd+Nu00mWn\r\ngxXD6pIP1ddJuYps6FMuZG/0FFozG7xQwyPBLgx/nEH3wxCoorZ9GjtyzAh4\r\n6SHZbzW9s9NOm6HW9V6n3W1/bVm0p27tQQSbp1ZjCAHxzpDGbPDNzDZ1qpU7\r\nahblA17VwSFPNlP679rrGIw71FCY8NabvUQ=\r\n=Sn6C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-99b7ec612d5657080719687f50b4f2e49cc84e8f_1659467892909_0.17756069170606836","host":"s3://npm-registry-packages"}},"0.0.0-3416a6d5e4f1564f74d81bfc21c503b0835c3186":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-3416a6d5e4f1564f74d81bfc21c503b0835c3186","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-3416a6d5e4f1564f74d81bfc21c503b0835c3186","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"8e1f94ef68226da6b5e06d37a794207486e2b73c","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-3416a6d5e4f1564f74d81bfc21c503b0835c3186.tgz","fileCount":185,"integrity":"sha512-wRa16z95Y9TCQNuRvhOGvXFr8xNGSeNbn+UNB0zfJhhJDb82Q7wBP2QK0+vgsoPtTs6prK+Ppv8LozDVVi4NWQ==","signatures":[{"sig":"MEYCIQC5AIIBv4gEgTd9Z3tejvbETRxA4xej1j9xDUhyBX6kDQIhAPhqNSs90J/HzI64drqjCqxnMxhoIG2EsXcL3VtkE9JY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6X6vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSwg//d9kpXvijRKHDwL04sxGMYTH9SGCLUxVsRlyU2ctXO+HyWzIN\r\nywMJNFx/FAEAEQYsmcbquINL4q1XbFbj+cXGfsCNBQITAFdlMRolbwyyjCqA\r\nVwgMwvftqiMGEwQJUyzMMF6rFIVmXqRp/56tf1yThGK2whBoGfobncypjLJz\r\nHNw6nPayCdkj3NNId0Y4+tV7H8LTM9Mud3vG/RYHjXNiFFf5Vqrq0fC2gbdJ\r\nuEHvMlAxAfh33PquYVH4pZw3hEILHq4I2mvqgRslLe6Q4Wm9VSXs7/2Xo+mq\r\n6bSlhVuSxA/4Ube/YfAlxkRYP4Eim8XJFyU6t8gG4y9FbQmRsHd+HTfx8GSE\r\nZxvEE6uNAcL0jhkgIFKcNLPt2Ai4deniMItLdczkEw0iELwXz1WfWPk9W7W4\r\nT9hi0FBuO/qnKyuLa0vZgA3TOT8G2VClIq87pOz79+K7Pt4JiCF5Dw7NiprD\r\nXGYr5VoLFr+1vL21ej6GdHFqzQ4+ZLkSKKklhnvxWQ/l1hha1DaazU3VhP3T\r\nWmtS9HL3duwPT5FyiSOSSweudbvJwMB3mQzHEzazOWPJxV/SocRTWyBlbj5b\r\nhffcMnviSaMYJw8vWXiJKnFzIIBRnGThiCgiVcNFQLHDWk+Ev7JMjBnRamUb\r\n770zSBSs/E5lH51/gLAiFVdRY09lW0+yIqw=\r\n=0jrG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-3416a6d5e4f1564f74d81bfc21c503b0835c3186_1659469486748_0.8964117756586032","host":"s3://npm-registry-packages"}},"0.0.0-38a9ed06514792a2be772ca91abb5f4b78174b62":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-38a9ed06514792a2be772ca91abb5f4b78174b62","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-38a9ed06514792a2be772ca91abb5f4b78174b62","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"e376b30e14d5d70724b3c98df5c9358589276783","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-38a9ed06514792a2be772ca91abb5f4b78174b62.tgz","fileCount":185,"integrity":"sha512-qC1nEF7sIyRF4Idk/ggDRdaLnUJq1peq5OeRYV0vpavSyc7GTZY71XDINil3m86o4UskwujeLnCRn5KD4nOrLw==","signatures":[{"sig":"MEQCICuPsfLqqoniuYMWQrmEuBfBfqopfTFF2lSz46+k73C9AiAqTCreSn7wpsXVyIOvyFu1aJrUaUaYjbNRCkMkCFT02A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6o2WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7NBAAnVl6/heXbnfSTYRuH4Ha0MY/qjWKjCPp7kJIzOuQaHR32L9R\r\nx9co3HC5Q/EtDBQR0dbnWl31VNWWG/k7MyoTJdZuOvKrGuwA+Bfv41TLNAD9\r\nh9/hsk86ZgGVhZIb+HFXcR+Md82t76qu64QO0PjWyFC7fAgoMnAzC4IQMOCB\r\nwV8z4wEw3jvTIGv5aVEdH8d0R2Zv1fT3t6T5opFceay+y5IokzOh1xeThKMQ\r\nQ8F1aPe/PEleE4QOl+KMMXtzQi1scENX/kahQeUICp8UjXnjNvRYCdtC+8is\r\nzhh7wDMBZPdxg1BUlOfJ0FpKWDZREjUnfQqEeBStjNeUlC7aKYQ0274yJcBu\r\n3YNq/LikP8x+SRrwVJvS1zWvdeoo47kXPNKv5zuDkvT98bUV85LWoYakw7lZ\r\ngRVKEyWRUgTMPpKbGchn6qFe+Fj1ckTnQQPOM+/+soLuIaAQECfwLjF4PM/X\r\nHZ5wH33wEQOcl9Bsmq/NHV0uDymKD9EedpqlsWJY/QiN2tPCQazGlJKyoRNX\r\nDFYisDy/XPFzBwYHCSX2gfcinKTV1AV+fCPfiqs8YrzabwUffVx293pQmxmh\r\nCofPWoFPHFv1+COy7Rtl5MADrfl58W/3LRCIK2qm6petdSg6+d6IznelS/zA\r\n14bc1Af1JAelupHn/EqXS2dpPmnONz0Whjc=\r\n=ZNQL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-38a9ed06514792a2be772ca91abb5f4b78174b62_1659538838647_0.2515062932535468","host":"s3://npm-registry-packages"}},"0.0.0-0ea143fcc77f1966f2dc7cb31fc896aaf0a98aca":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-0ea143fcc77f1966f2dc7cb31fc896aaf0a98aca","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-0ea143fcc77f1966f2dc7cb31fc896aaf0a98aca","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"dbfec2175a80c14df819aa042b9f21c02ac8f230","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-0ea143fcc77f1966f2dc7cb31fc896aaf0a98aca.tgz","fileCount":185,"integrity":"sha512-BuHaCWLXn0x4dh8PEAIBzEvN15EmjVoUJII63sRFbuW9VFbFkLEo5obz0R4ad40PVnZQGnoZ+EQGXLVtfR0/Ug==","signatures":[{"sig":"MEQCICxd8i0caANFiBJ7LvGCz5pus5R9QDa2mTShQoPvGb9eAiBI4xJqr3P2QEXrFGKHTyBOiTaIvD/rg7gjdkxGZNGT+A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6pU6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoM6A//cp52m1qDWiJGrgDX+4UIemoEsoGFoeStVXCs001GtBBUTDjv\r\nKbkllVistiX3Qn2HDmHWhq7/rjIk09KVZ/Xmcxksj8Ev8rh6Q0lW6PyYx8/O\r\nicfEzb0fQ3+NwxlrKl+uRuIKgM8h6zBUpnZSufVD6UrxiQkyi0DJ7xH7LZmP\r\ncPrdl3Aabh93lT0j3QZtOe9YZrMUiJaDTmR/n0KgSdRhbm0DmHK9rUG/l+1m\r\nSgLszfTMR8hJNxZxAl+5VBZoUO9eObd5e2tekPjKibKoAPk6o2ZkXLLrq0+S\r\nZh/1971nYP2mbpfFTSvBJ/+xV5TvSwS2y2e0Nrqz26VT1SFnj4b5p4p/X4eG\r\nbGEp4jMrILnXKkmKW8oyAeE9TYBLVNpxkjPeHaIrT3NjIP2AolH2JRhvJUVB\r\n82N0UB2OHkcWnuEZ1A8W5o5pXJ9A727nKPtHpjf0ARhL5nM83rsIjNOZ84Ci\r\nuV1KFNB5g/JLCqldipTJ5ILjHwpOoyvBDYxl1NR++T4g3CEJClJQVCwAs3+m\r\nahcXD9W9c3m03crb7+nuzXb8HFg8QC4cDr0Ia5Ff8Nuo7d/YK5XcRDYl9l6L\r\nZEkJiG4H+z6/2xpVCIvM9IIBZe0xL7io/AGQqIVqfi2ktJMlFHxBH1vVe2Qw\r\njifVaKDIbaYkJc284ctAyaTEU9YfYnPN62s=\r\n=DFwt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-0ea143fcc77f1966f2dc7cb31fc896aaf0a98aca_1659540793730_0.7956078272574441","host":"s3://npm-registry-packages"}},"0.0.0-212c0d5bd4f63ca6bbfb51bb3029310fcd8993d2":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-212c0d5bd4f63ca6bbfb51bb3029310fcd8993d2","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-212c0d5bd4f63ca6bbfb51bb3029310fcd8993d2","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"b4fe692ea23810b312210d02ebfb69e6e5a0e6c4","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-212c0d5bd4f63ca6bbfb51bb3029310fcd8993d2.tgz","fileCount":185,"integrity":"sha512-niqEai1JJF5ikL6R0BANhdGiEK3v6RfhlFVJAaM/OHvx7Sq1U10RqTxNxaqsyAzN3r8LoIm6465ZN4tpGRHd7Q==","signatures":[{"sig":"MEUCIQC7q2bZxULlifKPhL4vqZhYZyMtkmajSz46hOtl11+12AIgErE634MuWnUE3DxXiePlDO0M+AyTt3cunju52XzwnmI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6phnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6PA/+KBCqJ4wVSOu1tXYwQOve7K616NNIxrfMAgrzfh2k36/WVKa1\r\nz9w9I5itX+C851nC9aJXUKlwIelnMxVKpVwcM+/Y/KLrFw/45aG7KWeb944y\r\nOL5Y9H2Qy4ThyUJeP7OZHbTfn54HPiYOb7uHKDldWfIjVpEwcWJpL2Dh/7E/\r\nR6Jt+u1qKYaHbLolWqMb21GffjkMAKbxGuSH1Lei1USSjbMZocjuv5J1kG7b\r\nmnafhQtlsTxwvOM3qJmOPoZ8C4dmlF0fGPYhum/h7f+ZBITnI5WfVxJTjwit\r\npb8BT++pPsLOURyIH8d0p0L2pJmlzbaEhmTCAPxq5gr4fBtwYYjllYDytnqi\r\nzQv6spb3c846eWLU4VHRMeH5hAVxuzWVI5AY6dDY1ciPn0skKmeLlo+FP6ga\r\n9Oz1uz2RWZlq9RA0KiNX/yapkmGtr7hIOlHEZ8xD2GcKjLBJqJOKM5C3fi8a\r\nWQmbENdZZHF9Nct25Ua3W10swJ3vzoQg9DX2Gcsj8W0aQZN9cwCQ3OTNjlOW\r\nNr75LPSdr5ox/uX+OZYvQ85DzUYlZ9L7XtgbOkWBHkOccXo9JMapdm5JlCzJ\r\nCWyQEmkp+tMaiD9oC/jfBjrs27pfcQ5yAFsB9SLGaGHBMHZS2Y6ag8QFD7UT\r\nTZr6c4jSaJzpfHP9Z/UyzWk431+nqjbOmO0=\r\n=GfER\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-212c0d5bd4f63ca6bbfb51bb3029310fcd8993d2_1659541606806_0.7402064718759802","host":"s3://npm-registry-packages"}},"0.0.0-735b4f789b74db78538d9965ff7af2da2c0a5e92":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-735b4f789b74db78538d9965ff7af2da2c0a5e92","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-735b4f789b74db78538d9965ff7af2da2c0a5e92","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"19cf66124a457fdd81759b5f810dd8d58a65d623","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-735b4f789b74db78538d9965ff7af2da2c0a5e92.tgz","fileCount":185,"integrity":"sha512-ZBfCXFCWAkh3uwTNch8cwVwuOqiab/fktpRpzJclN6QY341FN8wyy146xCI65DDCz+kV+PxrTcZc0N6ctFI58A==","signatures":[{"sig":"MEUCIF4fvgxUxUIYkOpZGl0U8IBbqQP0hS+9Jtyx9sZAQKEjAiEAgBdb3kfGRjdD464RS8dKNf48wRBgPLD7/rM0umruTYY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2588930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6qFtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoP3Q//drlhht2gY15Q61+HeDBr12aDOLCCGHGfzd0V4C/H2bsJqqYL\r\n5PI+rYpTnnUprYGwSNnDgdQ44KSC/Ke0BnQdERRmde7FYPcneC8nVw29gYRD\r\nwlpxVISGYzh3V1RMvyWn/a4gXZAMFjRideXoCZdCuipN1uEy67IxxWCC0OJy\r\n2F0sMP5dVzSaB953E7X9iWB+SxtEw3DLG6mfGAD5HpvBLw/VggIyxzdZ8aKQ\r\nLVeoQmfQIpfegAbUq+WmXH+Gx8F65AMuM8zw20l3oQHSBaSCzhWPu6vcHJBr\r\n0Z+ospCy/e0FFzENSlvZs2cQRuUZSLG+vUPthIpHdUYH9pKjFZ8iIsoetMo/\r\nA1KkmQpW5iEfzKB5/n+HNjBrLagweZNHjL3ue9aa5jmhaVNKsOqPKUpkKutq\r\nBhdhkbHvdUz+3W7ZHF06HvlTREvHem5rOJbQNWBVO+hLKq2jUfyrP1DN3g9W\r\n0yIbAx02Tss7tUdIX0FnDSj+tbX1oVsmRmNdAIwGpa8G9ACEs2bcEv8n9hJB\r\nEuRTwVtXUgxQVPo6pjea+4yWWgMtxh3ECwE+Bba9iEeIF7jrd5StWUBCA8FV\r\nfixYFP0UbdKA8rWWMjEdEpwx0Vsf6yDISPpu2gbA1GECiqL/7i9XU16Gn/Fx\r\n9BXYMGJghbHs4WJqrlVHDVhjNLLUEnC4qbk=\r\n=born\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-735b4f789b74db78538d9965ff7af2da2c0a5e92_1659543917326_0.7572294555121846","host":"s3://npm-registry-packages"}},"0.0.0-9a94583c87fc38d6750b5fbff3326f6c1a25e498":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-9a94583c87fc38d6750b5fbff3326f6c1a25e498","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-9a94583c87fc38d6750b5fbff3326f6c1a25e498","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"2a2731d31418d179b905c08609f0d3b6fb6b1607","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-9a94583c87fc38d6750b5fbff3326f6c1a25e498.tgz","fileCount":181,"integrity":"sha512-1VqeYb72HDjD0x7Oa7Ix3FmQ5iPC/qMd71E+auF7X8fOFPGoiIfYrEGXNVh3ZIs7IyKIsQ6ots8rcElFUlvQgw==","signatures":[{"sig":"MEUCIHYWLbSQN6CyFqooWXkI6E/znO/xHVk9mcXaQkUT3y+UAiEA/9JYb1001WUIhIlYTi4WtDhs7RtV/mK7b+46QStVoiY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2578514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9SjMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtZQ//bfPDawk8lHR54RBiJ+tJus3VPboUEhCfGAIsxIsm2sYV4/cd\r\n9Mr8+G0xfaiLTeod18wDtSr/+8V3VHNoiv7Ml+OQ8NiNn3SPY4B6DpWSOp9G\r\noiVvjRdoTiTuAaKix+y+3drKwIKPBTwyOb4OJrZk+U9KXwL7Trg+o6lDOmHS\r\nPRV/pYkbWKnn8Be5q8BqUBP2OKgnDWzszqzFlLogYG5cxG05MjLq+41def1S\r\nU3Cy6693STAmKqIpU09GTkXw4Onf2veyQoIIjhazoKWu2T6SJd96tyORekXR\r\nCI+yp5zW2y6hIga2RRwOcEcw3KNlRUa/wqkXv3pXwoVOrExiXf62qKG/ab58\r\n8U3tO/NB89RLgMsOKEvgNteAeqlBpGppiL80xOLzX6PdgVKV9BOcsqAKXe6y\r\ntkDI+/hvwcjizA3nBmLHXCjrKMihSGKUMi54iPOK1GtwNJnIP6uW1h0+3nWP\r\naQ5Mv6qoupash6Z4AXISQwAB1MUQAMOZc67m7hMwHklbo+sjfLLDM5CDdHNh\r\nlmeg4HHUpt5LssgJmpTzPfvy7+l5PR0d+9myiDyVOG/AbTG38i+HxSB30dlE\r\nfAXKDjbsjAAp9sVS6N6eCwT7CS5j1DwDtCA6s0cxmm7uKeuwi6cGz1ps8OZk\r\ncNvwdmVEd9X5qFlIs3J7MT9lsQC4cs/T0qs=\r\n=Zeuw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-9a94583c87fc38d6750b5fbff3326f6c1a25e498_1660233932391_0.7963106599653982","host":"s3://npm-registry-packages"}},"0.0.0-01fb35b52a036c00ce1c608125b568942dc67560":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-01fb35b52a036c00ce1c608125b568942dc67560","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-01fb35b52a036c00ce1c608125b568942dc67560","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"af9da1821e966ba5c142345b8b01c5a28eb3d12c","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-01fb35b52a036c00ce1c608125b568942dc67560.tgz","fileCount":181,"integrity":"sha512-/NlqYfeSZE6B0scL78sGzNewW/xMaSsMtXgpe9HIRlOkxi7qAMFSTupI/FEyfP64hjym4SZbh9cOV/6o36bzAA==","signatures":[{"sig":"MEUCIHp9PG2b1+BcuW24X/BAn73Bi6PsUVKzpAckg4ype5CuAiEA2z9pHlaDcbH1+/wclOnEcfljw5ELoOrLye9FJ5lS8/A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2579118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/kxhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLYBAAkbzDvIVQaAWJYrZ2SEiESGQVuoAc6wkXL9jzVOgAJQ8Q2R9b\r\nEJ/1ebAG53XQ20l8txoPlAYqCWrOyrYLIJTMwCz+O0voLTs66ND5l/Ozb/7s\r\nBgvJL/Gv4LhF+Pl36fAmTPvHGJzUhphSoUB0gq0FABv/+PCcRcQtAO/3O9eu\r\nTezu94FDYXiLa0FXJyToDJAvkCR3OI1Qiyvr1AB6wKVuqqtLFcPsdFm+NqLR\r\nfNygqFPz8k8wqziEulaJAHzhWHHgK3R8jeU7fmcqUxQAOv4sHOQ8Nsa/+3Yh\r\nbP+UgcfGW6Ehx9vUNnAdBQN/uP9Nwdb2mpUtC210r2YdXscpLLCvGROWQ/EP\r\nyGAdnzEkFlkDAGCeBdZiMKFpf0VWfoHfocuqyz2/9xC3SoUD9dFoAj3bcGGI\r\npFahfP4CZrzhMKPu5kGgTQbwDlcjiKaWP1vaOlb8i3BLRh5uKz5VEEczlBCy\r\n8ec0V1HtccnqGXp0AYUh3SZkrEQar5QH/Og93mnCKw2b3gn+j4iYlhv7QtyN\r\ntqMTikdhhCWGUbMQi2xcSQdPC7AYisDoledwGl2InWx6qxySTABNaMegljz3\r\nasP97oeQbQlsZS07qrbeywTCQhVT24TP/tc09PyxFl0U54dAWtSfQU7Kr8yA\r\nWjXxfU/UCE8yWaItF7PLFvf/MkYWw25fh0I=\r\n=TkUr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-01fb35b52a036c00ce1c608125b568942dc67560_1660832865660_0.13826539835797047","host":"s3://npm-registry-packages"}},"0.0.0-adb46651b1bb7b4611e62674f2755c312830d65d":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-adb46651b1bb7b4611e62674f2755c312830d65d","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-adb46651b1bb7b4611e62674f2755c312830d65d","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"f8f331ff050ee8b0b2ab2a386211de7a2685c055","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-adb46651b1bb7b4611e62674f2755c312830d65d.tgz","fileCount":181,"integrity":"sha512-vABcm57FyBBROc2Zssl8/Ew5+wLIIHuqqKV1IuNnRiHHx2sPGn198jb1GkMR2+Q9+J2IVJPcCe+H3aFt8zgK0A==","signatures":[{"sig":"MEUCIE5k+8qs4tY6JcllweUQnxI4BkqiGEOOxiLiOcPtk1tlAiEAmcTL4F4BSkEHFDg4ncsYzGMI/iOudd9HzEhdY7IbR1g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2579118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/kxpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBwhAAjGwO+5LL9yzzrt1f4rpNCcjO78YgMzfPY+i9kN51D1LMdifj\r\nWTErikg6Vg01q46LEpgDlBlf6tl9WFXYxKk9OvUJmiClbo62vbbYcwLlI3/V\r\nJ28AGSh26Q6P9sRUBN4orTQQ1G7OBnAGERjvMqM8TL1T2HvRZtpvmX5sN+3b\r\nrQtwnpcuYoZrj+MD9KTCLz++opnlydh7qDZ3+zzmD0m3alKjAGrE0KT9p/mT\r\nt7/YcDGI+klHh1acGDJS0+hIth6UqDMBrqDrU7mu0noEVm7amrI5rcUsGIi8\r\nmunTNmnGJBtw/rwPm/Kjp06RC8e35c81b8P47GyF7NySF0sQhFleHB0Kwmoq\r\n8CCfNX1UzL8KDRheK7ezro/5IWyYnNEHmxdIIE5KNC8bZBjcbXkn8UniztAR\r\nhJ0fGXq/jWjbRo4jA1GQdNDnRlbJYmmE7MSkqaslV2f3XijU68azLFi5lO03\r\nDcR3vrLBG8CzUjZoPsn6M88659533Rml63FEnsWAPM3l9FHzc8K04TlRR3LH\r\nAyGMmQDFgMsnhxTtlxAnMJ3XMm8ZruI92CIR+aAXQtfbfO+lSYr2WSI+wzyG\r\nW8C1tTYBjwnNcUt6XfEh/Pds53IiJK+D0Wq2ILUjunuv8rJg/7O1MnT8UNDy\r\nBI2i02zm82CYHi+1DX4Az9nvPkW/HHBSBBY=\r\n=hoLt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"./dist/types/index.d.ts","module":"./dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"dev":"webpack serve --config webpack.dev.js","lint":"eslint .","test":"jest --passWithNoTests","build":"webpack --config webpack.prod.js","start":"webpack serve --config webpack.dev.js","format":"prettier --check \"./**/*.{ts,tsx,js,css,json,md}\"","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"webpack --config webpack.qa.js","lint:fix":"eslint --fix .","build:dev":"webpack --config webpack.dev.js","build:prod":"webpack --config webpack.prod.js","format:fix":"prettier --write  \"./**/*.{ts,tsx,js,css,json,md}\"","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@adobe/adobe-client-data-layer":"^2.0.2","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.0.4","husky":"^4.3.8","eslint":"^7.32.0","ts-jest":"^27.0.2","webpack":"^5.26.0","prettier":"^2.2.1","tsconfig":"*","cross-env":"^7.0.3","ts-loader":"^9.1.1","typescript":"^4.0.3","@types/jest":"^26.0.23","webpack-cli":"^4.5.0","babel-loader":"^8.1.0","webpack-merge":"^5.7.3","standard-version":"^9.3.2","webpack-dev-server":"^4.0.0-beta.0","html-webpack-plugin":"^5.3.1","eslint-config-custom":"*","cz-conventional-changelog":"3.3.0"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-adb46651b1bb7b4611e62674f2755c312830d65d_1660832873487_0.33693592852846677","host":"s3://npm-registry-packages"}},"0.0.0-67c0d298a5826e4b23837ebec8f5a1ed13d3b505":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-67c0d298a5826e4b23837ebec8f5a1ed13d3b505","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-67c0d298a5826e4b23837ebec8f5a1ed13d3b505","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"2f4ca92ff34cdfacd7ab1d1e8269b2852023c511","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-67c0d298a5826e4b23837ebec8f5a1ed13d3b505.tgz","fileCount":10,"integrity":"sha512-Od5XVz7TI0phgeCPCxvDx++RAbTPBF7HJ8jkW6qX4i/gywuIXefW4gLd22saKBqFN4a4u0aY8lC5J39cMlIUag==","signatures":[{"sig":"MEUCIDtXXZfO5j6iO1qxRumZdsr5LrBzvBg2Fx2wA/moH8DgAiEA4P3+SDoefjJlS57g3xeZZREcLv7UVADhWtNVr1n6y+o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6040187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGk4pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrauA/8CGSdRNeoQVQynnYopCckfuPgb/4s9Z/1maJWoTTcxYUIQcSI\r\nd0ywlKL8RRGY7qvc3IVZ4ZL7qcwD8g7NZ9JZ8e+HfV4SZCtTpzTS53Z553IY\r\nO0FGjv225kx1vQ3w4ONC8Fcin6iUfyB0bQhbbtD/doJT/zL36B7+WFZaE/tZ\r\nQQuNMDrRCvOD8NBMUOy3toHEQCEq3rDboPA+p9fducLubcamD0Zo6s+uJzyZ\r\n3Y5YSdPEDxZz/3+sUbx4QZQumFgkBfRVwEJl1V2sks2kY1kAu/e8mubJ9VRA\r\ntfDzDLj6RVmr0CeaHXOf0o6iwJYdgWJDrnTge5ohnLA6khMrYD2RDrU18ykA\r\nXiPQbw1UMdl+lfMMGT9zxHTYE+yWHy0NAFe9YowHXwRjVnHKEJGV64M7RlCH\r\nUrUyZBBGubc95KHJKcOMzJ7XNeMiE/OEs1fFo01dwx0MZOBPKyYg7BJzq2j1\r\noM9xJ42wFv8lVAejcwA2szfVUWokwGm3IBShjDYti6d6ynHEfOb6His3zdsz\r\nVgIzucHOiX3g9hwVp5DsN9tCTqSkqELqDQA6E8a7dVfZUaxHtyiP4m2/liEr\r\nF8XDsxVXe/kTMg2P8pT9+T1K01LUgTQyRtuyL+ddkRh6aq1FeFS8IKTdcd48\r\nN2nicTlkIRIymGHj1d553NFwR8vUQSymX9k=\r\n=6w2I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-67c0d298a5826e4b23837ebec8f5a1ed13d3b505_1662668329452_0.37854893990356864","host":"s3://npm-registry-packages"}},"0.0.0-c9c1b4b52207f89bf0efa271582b5f488cf3d266":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-c9c1b4b52207f89bf0efa271582b5f488cf3d266","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-c9c1b4b52207f89bf0efa271582b5f488cf3d266","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"d2b96e7121c9ca1425a208bff7a388a7e2f0d90c","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-c9c1b4b52207f89bf0efa271582b5f488cf3d266.tgz","fileCount":10,"integrity":"sha512-RxHz9+oAF/Qp1+dQnZBGcHQZ93z4BreaU6qccpgB86/VkhzFjHnxFStzuom2IwSYO2yZblDLt10nF8CbeGiJ0A==","signatures":[{"sig":"MEUCIQCZvtOySXeyucST0zzkIujysr+WPF1o9ZHsvrxAQxfS6gIgXeZx7q4B9yf7Vgqz8j660OULiHkvaxN133fo1jvHDas=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6040187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHtLdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmonmg//UJWzceC+gX1vwMRFY4VjTsLcwKZAWs1aZDAgN4SP2jE4JKdV\r\n4g1ZxcsC0vF16mpSZhLeqtGTJW1jyoakMEFMYFLoNznfVLvWkWXpnwbZrv40\r\n+1kvfqKZFDcJdjIrHhto92C1TOWmjLnTHo6znvxs8Ifm9pWZfBWzqwzL7PTm\r\nyO0tlP6sHf/xwx3kWGaCpJWEM3cEmaMZe+75pfk3sWvbYLL8voaqmCpYhcNp\r\neduqQLr25A0xojbuJNeZvzAEEwKLUEl8y9P89NbNN4NFa4KFa4FQx6APpzVt\r\nLsKFxIA0ngHgx/nmkSHm6yNk751Won99kPc65n7OuAxuAbbXlN/Jv4XuV6j/\r\nxaBduBKA+PCr+gDPxjotmT/tC9vthDtJCClTF8cHh2i4vcQx7KN+5holwLvt\r\nPPsN3GPg6VtRTwZvS3ojAlu1Vo208h1DR3p3HYDRiGqQyJYo4Eyq7fVc58n+\r\nzrVrUavhorGnI9kQd/MKG0A3M7KtV7DkJO+P+qsGdgKS/j1HQYALIvmNKCXe\r\nSc0C/1g2greMzshEOEVGzPAQxFlKQYM0/tYNlRRf4JEI9n0veYdujrigbK4F\r\nl/zjYlf/GlPS/ZsMTW6FobRrMyqSuXEEsvKeeQIiiCWZwMnUFbEMT7IORqm/\r\noripc3BOtRGfK7NS+8h8N8D8qlvTqoSIpsY=\r\n=YGJ2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-c9c1b4b52207f89bf0efa271582b5f488cf3d266_1662964445686_0.28549381281882646","host":"s3://npm-registry-packages"}},"0.0.0-398d305da8d81f96f245689e93cfa53a6563b0a6":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-398d305da8d81f96f245689e93cfa53a6563b0a6","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-398d305da8d81f96f245689e93cfa53a6563b0a6","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"bbda9ce0292b4ca85eed5afc81152f03e6fdf209","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-398d305da8d81f96f245689e93cfa53a6563b0a6.tgz","fileCount":10,"integrity":"sha512-fGEJz4qIVhQbVZlNVpczRSkRu15QQZKzlGxBujKz7dd71jMa6zQBjeOsBfhTSEXpeOyqGkCGfekagp7ICTS5DQ==","signatures":[{"sig":"MEUCIQD45JF775OQovirdIHjzXGJLXYrAlh8RHzDPrFiazcjdwIgdvhVZNLEIZg2xxhn9eNwY/ryO97OPd9M9lS9b2ZpL10=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6058305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIKkqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpolRAAnDQiFfVwvBv58meynRZCKuXQi8XcGD35ivvRVx6OA9I17UUW\r\nemE9hrQOEKOzo1AviOfda+Y9ud8wzw8iqhgO1O/WIXdA7KEiAriDbl/nbzsH\r\nvswlMFpvRqMjGi4xCjaOqPw16RqTjaprH2HbB0dwKX3IujNH3a6YzJxaRh2b\r\numdHMgcsTkZmFEdcr1JPfDqMRk7s5q5KfXByxm0M21A3JD1jIhhssleekpKH\r\nRRuqELmhm6QXPgqWB0S2bkCoOeHXy8tKKEH0vf3yyIGQ+wTXLws+zjbML6uW\r\nUnEuNtMeWe8gkVP8AA0e5s2h/RekXggm1ufwq8Xjtav60ay3uAKlnhJFNllu\r\nZ9GTZXSdKLYI+x+qWvaXnc+lgCrKFIVBJO7dpJ8k1NTqjwyayC/ymLlZXTH6\r\n7J6qCbMeSKO5mS9Sjjn5Xxl4+KQ/goNYzRWGrpyyXnHk1VOykA3lCUDM+R1A\r\nSvmbG+FDT3ii6vYVy1sq0rUtdtF2BzEGLw9syJpkLaHedrMerPchFo7Ez5MT\r\nMkKtbXJdKB2EqOX739xGulKed8ocO6E3Lc7GWBOJpRJBfhy7WqyPihp4oYl6\r\npwtZn/u0UDrdZJcMTLO4OqsKY0RIa0FTfxYlucv3kKBPrq8wfznzOhdU3Tmd\r\ndDjVTN09WWtW5oB2SkRyUT8pbtWWacB9GdI=\r\n=4PiD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-398d305da8d81f96f245689e93cfa53a6563b0a6_1663084842472_0.11264115148358456","host":"s3://npm-registry-packages"}},"0.0.0-f0c05a055d83389581b5aa12e5217df4f3d0a057":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-f0c05a055d83389581b5aa12e5217df4f3d0a057","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-f0c05a055d83389581b5aa12e5217df4f3d0a057","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"d7c6709fe3a985a028f9889879becb7cfc7fbc41","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-f0c05a055d83389581b5aa12e5217df4f3d0a057.tgz","fileCount":10,"integrity":"sha512-/z/RcbhsSwut1te0oQIVQf2Dm7kAt5j6WfPi5Y8R/Ww09afGQJYIGtp44mZqUG11+EJ6UuUcs3bNfnrV9z1wEw==","signatures":[{"sig":"MEUCIQCI/IUV+53pFFuhrICTYfDvUAD16EfoqhQF7zSD01AONAIgZPolsp7IKgVEjwM/l7LuBafpk8U59zQMlGwBNSnMc84=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6058305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKMIqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNSg/5AXyX0TVNy5SrCyIyWARE7FyJk5z2G8f0xUi7HtVHLewMSSo7\r\nBVsGmodJgi3ngx0jgz06JR8+12gvxFhq9wK2zmHNt7lhqQxLzK9JFZFgD1yx\r\ngvK+6xCu8LlSLNcaUkxrdtSfIuYpI5dipxfMtR5J4qY9O3mKgE5EJLY4QNU6\r\n/yuLsiPQnMf6MihYuPJyvkP4RhDCMfZ0teqQna5G7XJK4r1P41IflrynQd1P\r\nO4+PbBu4hgP4slk6Q2YDBHy3UJUGiydm7emEDbhjoznNWlAuO4Om/m0w+P+k\r\njCGL81k4KBaOYFdftydDa/7MWM7kxSBK0HjRfgIJHlbSI2zT7xT5CySW3rRx\r\nQ9mc/IyZgwfjhx0355SCCqQ+N/jzQFU4EFpvmx7n17rn8u/JSRkug1aEiBzM\r\nOSeZ9jXk8sZWhdQfMSxlI+RIAYmWPM8854+iX+ghsYxGR9fg09kB/ECjmFPE\r\n2rqIpQf6K1tU9zsAVOwPIcQRwMw5N6I4m8wBZQdeX8VS7jTT/GCoUmRDQp6V\r\nALAH961femQEly5G+7P9jYjKhIPXAPsXzcWlzhp6KtJeWCj6aGmigHLbBaiw\r\nMeFsrRLjn8DGNbrFdXJeIgaiWO7ZNcuQzo5lDSs3o20ZsoZvGoNW+j2AYvlq\r\nQw7oRHO39JFNQhRrmFjWYY518MnFifXseUE=\r\n=aMBm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-f0c05a055d83389581b5aa12e5217df4f3d0a057_1663615530632_0.14892045796835207","host":"s3://npm-registry-packages"}},"0.0.0-6704b8e6445473ccf046eef692069c849bf4c564":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-6704b8e6445473ccf046eef692069c849bf4c564","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-6704b8e6445473ccf046eef692069c849bf4c564","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"f32336eac1b4deef8c44d409b706abdb660e11e8","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-6704b8e6445473ccf046eef692069c849bf4c564.tgz","fileCount":10,"integrity":"sha512-8cPjhg8qMMktd+rOzNoUTtM2lrD+riJuRY8eNxqmgBiVZbFg21Nhhl1EBQjx84Tqa1HAf/XY6Yu9oishFWkzuw==","signatures":[{"sig":"MEUCIQDU7jM7eIHnjWRQPBojU1wP2RIuzbb3yvc6Q5weUHoYHwIgJUkN5csrNGN1kF2q+pdrrYU0ZJGrW2+bfSMgDMSxjBI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6058319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKMqeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpB+w/9GIti5FAsN7+VsfcR96L1O4rURThNE5y/quCLlHLxjMNerfBr\r\nqukDavQVGHeB7ZSXMwbTXhIOSkGmd8yEcnnrMnanuihxzHiN04RsOKuIqxkd\r\nCdutygBleIOFdMNeZVTdDhZ2yUFBP2VRR1+c/8EE8/GlkDVCiTeo4HbASNSN\r\n7pMgr7zGq+jH2ep8ZJko9RWKdHVXrp156jh0xShcvvNCpCZG8HIYp2xn0yDl\r\nivutqN6Rqeruepwg0BSOQZRSySwGrC7BH4OypOkQ6oNj1gFkFCu7IGYMjHnO\r\nRlOLEMBTeqQInbwMM5teKMLr8jJl61rec0Ir+9PkeNKzxHOg4eaFYt3YKzhW\r\nj4E8W8lCBQf8yg1vVg/EDk3LeyRW23zHOqxd945cVKAt11n4khGgQ1B9GZDU\r\nXpZ6szDLL94MAXw8ux7dmv6T6rGjq6xgetNPwGZo80luIWRjfcuKwI2ZBfyE\r\nnvLrrqOwrLSAaMAGTpG1WGAKVo9bWk7vpP7quZ31x39hMH8fGsJc4TOojoMw\r\nQ2D8R+dl2WCeyn+r5A2AiYtWiKcwgM9ZBbkPtKPHshfTRjCzoUTEIMlGlVAy\r\nIUT809m9wCkQPFENOqvEc7BRxTKWSvIwqbwrZue/nFRa+BV5IGxFJ/Pp7wRt\r\niJmCtpjbLvG/hbdQu/pBtCPSXhqYWif0duI=\r\n=w4kq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-6704b8e6445473ccf046eef692069c849bf4c564_1663617694468_0.23544127999373465","host":"s3://npm-registry-packages"}},"0.0.0-9c2b80889a9b80940cdc2b6c1cac500374c953e9":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-9c2b80889a9b80940cdc2b6c1cac500374c953e9","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-9c2b80889a9b80940cdc2b6c1cac500374c953e9","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"b487ad719b74fc5c476b4e84a2bcebf771ed5e0a","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-9c2b80889a9b80940cdc2b6c1cac500374c953e9.tgz","fileCount":10,"integrity":"sha512-SINOHv3xuDoXPeJU8yIEk9z4FxbVR+LDgtRrX3G8yJI9ZmFafhP9FE11jhTaVOVxCUN4FRJQPDMgTvSH1hELAA==","signatures":[{"sig":"MEQCIBCBJcTDOT/iCvCtW8v9iZibfF9B7d5V7FVs5WxhNe55AiBC0uBPatBlkXMoT4OD2np0UZh0nQZi22fWN7+TQFk0Tg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6076119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKg6TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpaqw//W8EpOs5u95eMiMUF+7LTQIyENvHFlPP0tXOHdwiG15mlGlSa\r\nQ7yx+E4Coqe2j89XfnCrMwotTp4FBdAAAuji/mnxu7iWIXW84pkNHEtV0oBg\r\nVr4I11jHOjnHb4dHk5cIu3xxJ95Bl4oa+th0/TBiIi0tZRSlrNUsEOebPLDT\r\nydC1lx/lAVHVebcxh2PnaC7+Y1YzCzRXyAA9TB5DWTsekabtx+BsJPS8KA9M\r\ntjzSvVvjP3xzld47yckVeJJge5Bzs/AVamobaMC0ChIcKcuoJLUyxeI5VyMt\r\nmSL0ApVOdUzAZ05LMM785LmwTZ155xpN3Cx71Bc/KI+AjAAAvnMaiN6Hderq\r\nUcP0rjXumC2lIXDQjQG6U9zkdz7NkXEJhdwc5Gvcl491/VYVdTmcC0iqbr4a\r\nEGDiZda1a3N4xNfQWZvkPLEizL59mQ9hXlHE3K2OSjoYW6Mo80Sl/FpAP2O7\r\nQLUst15i/SX0LE9U5P8AoAtgsxoop64TYykYY5BzmBnP7Q7I7p3/nLohAXd4\r\nIq2nS0bzepvy9oFUfg09k6IjHVw+WiuiAo1DcalFm1pNasZVp770Ff0zadWT\r\nRMm5S68QjxjxaI27OCSxPDoxQqEokY5I5lDMaYtECyg4c1i1PLD/nXBjzMAj\r\nN+86ZiAfUK12n3hZRP4k8xFHXVtOzGYrbkU=\r\n=GIEK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-9c2b80889a9b80940cdc2b6c1cac500374c953e9_1663700627670_0.5029950072671547","host":"s3://npm-registry-packages"}},"0.0.0-bc9cf92ff5f90ad304cd227eb9d58274e3b9d86f":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-bc9cf92ff5f90ad304cd227eb9d58274e3b9d86f","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-bc9cf92ff5f90ad304cd227eb9d58274e3b9d86f","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"afb8d866e146d966c5ec9f4e585e24936b1f306a","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-bc9cf92ff5f90ad304cd227eb9d58274e3b9d86f.tgz","fileCount":10,"integrity":"sha512-TQ5Myk7WX9ey8ls0y7+RLaw788QXFOCmj6u5ZYJkDcF5cWlAkAjGALX50Zv/L7YzRplXiH2aBO75Lv/jFeJZ6Q==","signatures":[{"sig":"MEUCIBEp7LJufvYAkuzFvqYPOckrDAZXGrLYsg2ZNMsFN5zXAiEAtazNkY/olE3DVUc7iVHNkoJg983y9wB8RlXpV0QHDgg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6087269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKxuXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocAhAAg6h5NGuDYVqTw2ImjeYe5HrUjRWLzN2RTAHdud/8hbzno9yP\r\nw4S/gEcw3DHPYnC9tP1H6qWgRgXglPEMc1YSg0AScPWSuVXLlHk0hNzQMP+6\r\nkVmKiw8SihwB6B5auGIBZqSToIMEFtcs6auEhgt30egLlCyT4x8SOyX/e9qe\r\n8/mMiG23F8xoIC5MaFuSVleEJ7PsfqZf8nmPUiFhM4FiDlDtawJNEdTPm8T5\r\nETaR/SIXIQ1jQKUZc/sP9ZW9AsB9fIykzvnmHiyCBbJWmRmD0+q/Z+S8IbDN\r\nt+2PqYx8NLdhTuhdIl8KCaWYqVs+WzVDVjVCU9Q5JyTtCamshnVJ4BFA23vq\r\nM6OqPQngvCP1WalR30xc2ttQklHOJAd9aOCEKB2FvsZ+LEZkE7ZHsBtEAo2q\r\nhQvepXxwJ9xnO+9Bj5Sf4bmd/luDYSIEVWzO7g3H5fZHyAqAZRlDZ4qI4tnj\r\nXq5RYi50oViF3v5cQPAmXnUFpb6iJIKIAYd69DVMNQTxD5BATwrVn8FJC+w+\r\nMZ4o22yyo1gcJMEYw+KqYbiR0YmpoeO4ftzwEpD7vul3yvvhF6oLgG68gx7u\r\n0tnGCbg1jiOhHkrQbHjeTYblDSq6P6ifsRf0zHxyrHXwij4KeBAl2hA5cqnj\r\nCT8LiMRmrOuhzJnhgH3lmUBuZ+n5K694JSY=\r\n=FgKe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-bc9cf92ff5f90ad304cd227eb9d58274e3b9d86f_1663769494874_0.6301267959159218","host":"s3://npm-registry-packages"}},"0.0.0-2df0c4614bf7bf739cac8d273d5959548198c715":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-2df0c4614bf7bf739cac8d273d5959548198c715","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-2df0c4614bf7bf739cac8d273d5959548198c715","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"0b0ff14977423f08ec007f1855489fab7f4e65e7","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-2df0c4614bf7bf739cac8d273d5959548198c715.tgz","fileCount":10,"integrity":"sha512-9QmRrqFGPX3sgEGTp5ZLCBTv6bV5g37gyb4y5UY+FG+/bP7kzyG5iV7hk7NqB/+at1dVC69Qr44+24OhJpfxGw==","signatures":[{"sig":"MEYCIQCPvpynaMRJLbjccJAzq46OYcPIj7Gs/ZyQ8sYlmck5jwIhAPFSNLqdGKWACYFcseNeb+Gf23WC6Agfw+NNBxv+ZLmY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6087269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMcG5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiFg/+PHbe0cuD86GkN06W3+jsW8ivwcPhWR5mPsaqg/+GqIaRT2U9\r\nBqdnAHnzTS74uUgdcLXSFOut7E4u4SWiUXzIrEl7amWCHJ3XP94QSheYn4IU\r\nIIeRYfSghnlyf7BsamW9qYGlp6q+Qb/fzAfknNhaAE7pU+UTjd1aXHItTRdx\r\nDb9ry00KaGVIglr3A7IKWfeDrXTSgYtgdYOLOoP5XA2u0lCF5BOVwH3C3QbO\r\nq67rP0EHpOIeAs2/kBz+cVk8Uobl3aKeH4hsszsCMQPYcXDsctsH4oO4MD9B\r\nKfuyCMceM9938nOsgGAtlN7uKQKdhS/3fpcmKl7v3r0LgUn7glWu+g1TJSzt\r\nPMFd2ZOHaYIDjsmLejA8H5zj4JR7D/6ldjZxOB3C3JQ/AHTJtMkapKA8eq2y\r\nK4FqPLSMdkO4SGmASZk7ztIfv67VFwpFteT2/fzfLm9SfH2CXaQK3G7VKQF1\r\nJGjgyo1Y/lKDHzj53LPmdHEGg8XUAZddcYpVK3LqBKN/Qwc6Wb4QVomSglCL\r\ns8e/Irx9dyqKHOC8jOSBW7yVpRydBoNg0guXnZ5FimtP09UJRoclVNXtiJS5\r\nPpACtVqyx09rMDbU0/44R5FnmBJwKcSo6SDnhyfWSkI3EiUrUDPY96lS94G6\r\n0e1xUJ0OBktHaZPDGzOiqa6Rz7qiDn9WEPw=\r\n=2WKK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-2df0c4614bf7bf739cac8d273d5959548198c715_1664205241419_0.8075438619643809","host":"s3://npm-registry-packages"}},"0.0.0-0532edbccbf6127c783e80f3dce0585187546f7b":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-0532edbccbf6127c783e80f3dce0585187546f7b","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-0532edbccbf6127c783e80f3dce0585187546f7b","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"c757170110c2b139bd3827951e3d391e031057a8","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-0532edbccbf6127c783e80f3dce0585187546f7b.tgz","fileCount":10,"integrity":"sha512-D/PVqPCWI2GwIp033/I1Yp/Z65OycdQfIdgzg6Tq6l9qDH6CtopPxiPK5O4r1sJ7dyTdoRsEQTFWY/Sxef6e5g==","signatures":[{"sig":"MEUCIQC/fImBE2i3z22Pvf4rFSXAqDpi3h6L9JlnAST5XIdwdwIgZSAtdIWQc9s0B2uV2aSHgLNio9+yraUJyL242UXupYA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6087269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMc2bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpg0A//XxXALQJCgDm3cbzwpR8P0iIDsV1HPd5AmuAuCo2qfZFARcVA\r\nXmIWXzTWbcbwBDWInt4sirPtmXeA2asO++vUhSm8YK50rAu3idaeSMJQe0tX\r\nCyqqr2hog0xs4G/3maFjNy+Kgq6kFB0J50zlN3fwlXfG7nYpX782YllFKtBG\r\nclp5fMAdPUjfxEOzzt1gw9ADi9OF7rNbvljT7QTYc1JboEkQMz84h88DGMqj\r\nZDjFbdGrsBAnBx38NU+QyfeJX3TCLXdHiUEp7m7S2zc6UV/Lvi4EMw7A/WRO\r\no9gI9TPg0syO/QbCEKz+gyVhqzUfhCltfQD5QJRQfpon1OefjOVB3FEOXOqe\r\nrfM5to+7gFMhLADFX311zE3vWrK4QQBmq1+Mfq2+8f8YsQi4w7kGgq7oiERA\r\nenvN6RxyxcQMWRNnXwbKlZMhMdlQV9sJdCFbBGDGkmmRKQ7BOWfDz3PsVUUo\r\nDuhspkos7rqhMT6iBvPj25Uzxr2eNBaUA3ckTXhona5cQKHSn9BL/qTu7EC6\r\na1IQ6uwyF9L/UB9bXbKDfAyFsHv3pfb+s0N63nkGtaUO+JbVR8rm8Y3dn/fN\r\n6C08hTQe8UfBFaa+eXBi7ieTKXvYex8BqG8XKQJTAHFWhg92IAbJjsNkc1MT\r\nWhGGbA9TtYSU7lfJla/KY0mzoUkSqPQNHz4=\r\n=wvNP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-0532edbccbf6127c783e80f3dce0585187546f7b_1664208283393_0.3688892265213155","host":"s3://npm-registry-packages"}},"0.0.0-85bd07962a44a05f6f44988f4dbcc79b6517bcfe":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-85bd07962a44a05f6f44988f4dbcc79b6517bcfe","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-85bd07962a44a05f6f44988f4dbcc79b6517bcfe","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"7d7ce23928da7f2cc59d78e2a573b8dc72b3b601","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-85bd07962a44a05f6f44988f4dbcc79b6517bcfe.tgz","fileCount":10,"integrity":"sha512-cy7AMMEInFFdRbu2uHmM1/u91HsH+cr1XsJDSE6AUHxhuIbNrbTaZ2rRM8IROf8m7MYzvhTTl3MAkyvu9zsgpg==","signatures":[{"sig":"MEQCIBvqOT9JAukvYxKJo7Ffx3LYBBtkUO4ZXwtpdRiY2lihAiA2naK9udjtFdO0jZ7CLhcK55PLfw1FycaXOGmrAxBCPg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6090805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMhZlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3yw/+PtL99pQOmG3WUVCjDZ/ijz3ksSH875TYOUhFhCpN7fvsF4bK\r\nYkzOzt5IAcHOqnjzOiB7u0uHfXYgsMKzk1EX3dVo/w1ciMYxRoBo8yyrbgRG\r\ng7GkttORtsW7qyBK4jC4v9mpCX9iOpsjhxPXdIZBcB6YmZDQWFu0Ik85Gqsq\r\nETYYkZHcVESpswgM2qfAUpslsQWIPWXw7Nj8Nk4dpCCi3a/0qybRnFiL99p7\r\n7j0oPYanU6RPLSfUWUleMrFR+g3pI3sT+rkbM/vEqnJq7707QWfRC/mdwySh\r\nWL2wN+muWdkhoBwpSkDZ5pJ6KOY3y6U/WxS1qrIZRLl2G66Z8xkz7hTVVm/5\r\nbQvGpKKexlC9HZO6SWQYh1u7gg4keIy3bHbzTUOkpenKwO92IRgp7kJfc+65\r\nCw7Ond8kg3s8xw+IJ4F9XxJ3QvGzeMb1LAmB7T0HArAWguisdgrlfPCdu/MH\r\nfri8kReMyXaCIu8e9e9i4n0NwPGt3K3zfSJon/XtJwwtW2JdQwATAg7BASDZ\r\nL3EOKKMdDyJMf05ZuFBgLspCu+FDD8bChN3feANUzZrSeSXlQub1c1kH5mgI\r\n4IQnJssmbtPNdPHs4oKNIdDST0hh9s7nNTW8tkmdd2/eIxUyHdHUqHimdvZN\r\nT5gYJfSPTktIYZsfz6xNK25P2swdq3W2RYM=\r\n=hBjr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-85bd07962a44a05f6f44988f4dbcc79b6517bcfe_1664226917612_0.8562308112245651","host":"s3://npm-registry-packages"}},"0.0.0-6702428c4696ac1a2b6c2a40a49725c43767b68a":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-6702428c4696ac1a2b6c2a40a49725c43767b68a","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-6702428c4696ac1a2b6c2a40a49725c43767b68a","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"3336d85a78ce4c67934ebd9e318b8e80f0754d4d","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-6702428c4696ac1a2b6c2a40a49725c43767b68a.tgz","fileCount":10,"integrity":"sha512-o4qu+9cBRpXmjKg8OMfqfFwe5CW8dJlNE8Va3FcyaDlOqflUSftVDkseeI1tCoDbA0FsdX/YY+tBYzN4sIEFRA==","signatures":[{"sig":"MEUCIAhReu9JpzySWSrA33DoHc8enEEru5vymu1fTdoQz7UKAiEAq8p52sc2CAjEtUv7MGcDkxtp7g+19NR5VtFCCmZ/MR4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6101699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM2znACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVChAAg+q6a9V2th9A/FU0nmTcHmOeF6dJva6rZ5TW5mYgt0xZkfUe\r\nXckxxJrzdqHxwd5xx/Grs3Z/MZbvbD6zDAz7nSVtcpsfY4HVroujCMm3/IW7\r\niViThTWd/K9YlraTpVkilSnOpcQPmw3BrIO46yoxeinEHuGDx0tPTeBidZot\r\no63oPM+/xuwNT+C5iqN7smJ+IqnTxC8brMWsmSaNWSc+JnF8FZVGywqc69cN\r\nrMyq+MtHMAAFUzsuE28TiLe1k3nLQZr8YxPTVkuiTV5hQoGSB+9TaFXtNTNP\r\noLKre5lXEMMrl+D86AO/iTWNoa9vgPMIi2HKtMFmU/3xS0Xb+YqnQetbw+w5\r\n24eSaPx318VeZ6sgLKBHiL0cCNQ/YgvACQ7xDPMHjCAgDWDeOE1WiDOUysH/\r\nPxZn1YEjVNWGCDB+WfYIpcRFmcGShyCiroS+Q7euR2c4SaTNj+XXh91SCSn5\r\nkhmVoMOEvAYVKjtyeygG34Or/q501hsGthwYcAutnXDvtbR83Ouzet3YFIUO\r\nK5J4IkZtXYFu2+iVJz1fmxkOWynRb9Ta6JlTb4vUihFDe5vKAn97Kp3grN8b\r\nYKAONPcMApgK+AWlmjP0maszir3U4A+y4QgEFCBAcFlOSIX28tnPmjpvKkfR\r\n+J7Oik8iKih7K4cdQRlN5SNPspsUt1wwJ8U=\r\n=+OOv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c","dev":"NODE_ENV=development rollup -c","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-6702428c4696ac1a2b6c2a40a49725c43767b68a_1664314598742_0.042394357598030785","host":"s3://npm-registry-packages"}},"0.0.0-99cbc4e0583a69944fcf3d8abfce41b27b44cb40":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-99cbc4e0583a69944fcf3d8abfce41b27b44cb40","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-99cbc4e0583a69944fcf3d8abfce41b27b44cb40","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"2491f32694b7db0f5f0b9e983b054af96736ea5c","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-99cbc4e0583a69944fcf3d8abfce41b27b44cb40.tgz","fileCount":10,"integrity":"sha512-9x+0ZzPJ2UCol/gB3v8fC5GRijGAvPLr4SoQjMEUBy4VcIJGfjejnJ5E/A6BaIxhDBj8qbFkkw+kZfwWVVTX0A==","signatures":[{"sig":"MEQCICIRy/tpfT8kjxk6ycdgBfGTm03A4AmDKlbzAVwzVenkAiA7Wlzia37Bz0jblXSPEW9po4uk0nl942uDAHknoXRAlg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6110142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjParrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmroWg/+NO44y3desN5I4/nvCpzkj4ILILTpCR8CvFRgu8RacTZedq9E\r\nGJ77i4O6Pv4XMZzISerZ5WoRGHgaIfq5TiyJXReWG6jlx3TMt+PC+IgVVrto\r\nWm0D3xGsHH6vfWufB1pVEjgq3HMkY+otyPQa7XQMnzMtLGhiWXFNYb1cHBTe\r\nxu/G6rZ5DFj/cPLgVcWAwEtsyfUy30+1kcRl6rfHbRvXY+LfGNhnemh0qFNY\r\nzfx10W9X3Ydmu+ClNi9szh4n2yBOWmnrv6KyUdPqYAECpH8jToVErEvEhsc9\r\nblKt9jCEtnPmiFvGtYOIp3eLv0G7wS3v/sxbIASKuwmpJtrjol99lc6uIgab\r\na/BwIbleJCEXEqXwjm9Phk8trM/GB54pLlCeQYMW6LIHV+9mX6EBxdyOYtye\r\nf1HMu/IogWyAflZjb0xZbKNQP7bpdokIEqdy9XEj/BCrtKMs51Twb8lpJEJc\r\nbdjS4y4ilofJWWzPSq3aLkDzRyEZbbPfG6GboPMCUx1aXEcYmqUCpYZtJ+02\r\nqXBXE0u8kHwv4bmKLdpJWh89QNCCP9WOHBfppb00z0DkJFMY+GP0gDoNaHFV\r\nH9Caw6S8vzU/o5n1nG9U8rFqjsCrjmdEDuA9rGzfHUOLesQTEFD8Rs657V0M\r\nJgPRz9gl4X4f6O760x0yBcNxzaQ5xy5hutI=\r\n=Uxa4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-99cbc4e0583a69944fcf3d8abfce41b27b44cb40_1664985834694_0.7332275955012935","host":"s3://npm-registry-packages"}},"0.0.0-9bc3d2d7ee1b3ba7b27e195b5513c4a6587dbeaa":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-9bc3d2d7ee1b3ba7b27e195b5513c4a6587dbeaa","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-9bc3d2d7ee1b3ba7b27e195b5513c4a6587dbeaa","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"0e5c5d472f84d5a15cf394441e4e24381d3063fd","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-9bc3d2d7ee1b3ba7b27e195b5513c4a6587dbeaa.tgz","fileCount":10,"integrity":"sha512-JcKleDHY+NIy0CbAuur5jYaXODl2Td1ywqZ0R/sKRl8Zk/2ysyu0xiBz/AQwsVKtmNtU9ac+aBisnRbinr+Vwg==","signatures":[{"sig":"MEUCIQCdMEzs143r7HfUEIIoQJJwVkSRbT9QPkLqcc90DOEK2gIgLPsQMJ4PmKcY/1k32bZdg1YAWOWN3l/B1pcU+mwfOrc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6110413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRZVKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoeHA//eTYYrg/OF6KgGHOIUot2JRAHZ/LImqPk13hp1iT41Ij/aF3L\r\nTNvr1iNebaHZCVxgeji3VSexbYxCaFTHOtJLv/DPu14ec7HVKrOS4olisTQ6\r\nrRZiyv4iz/GtVC4oSYoHOYq7g6YbS789fOKKk5q8mvvt0kHIp4plDJBiux23\r\nWZk6ZwFiHhb94W05KaXISzCgTiuoPJAtKsB10H920+OXeZ4kun4HXLcQVAts\r\nFubHkbMMUgMMgTJJ4M8+t1EO5evq9WCiPgHJjUONqguefN0VaT5Si9Bqom4U\r\nU+pO8bZlti1vUzYUtVj1XhXZ+tvmpY6VsJkpVfChEU8REUiWSIy4Ugchfgl0\r\nza37Dm159Di2C2A0vBRsgUVWufd5gTXhje/OkQsRTiOVHtJaxAsCHETyo41i\r\n+PoZRzdOkGj3P8Ix9yc4SFvV/oz+0p2rdt+ZZBaLRkYtD0o+bbQN/eza62EB\r\nprwmdFxV1dIhS1PedjAXthcFvlaqeBClgU2h7gwRVKxKQW+FmprHLCrKejpi\r\nU8x+n7l+w7wjpz9VLY89fCnwOB2c/GsgU0mSzY3w/W+vPhsaheYrIuf3oc9r\r\nS8hXDSPHIkHDq7StJhOHJmRLKphMaV8t7Xb6XLjGk7puoujQAD9t/1nQ/xnM\r\n6aS1Lro1lsHBi0WODVWTNsJ1kfxZrLGlLG0=\r\n=UdsH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-9bc3d2d7ee1b3ba7b27e195b5513c4a6587dbeaa_1665504586075_0.4962574291755273","host":"s3://npm-registry-packages"}},"0.0.0-38fa293d4e508b66e14f79c18ce8126b5eef17aa":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-38fa293d4e508b66e14f79c18ce8126b5eef17aa","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-38fa293d4e508b66e14f79c18ce8126b5eef17aa","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"f24e54c7a216cf406a709b3fa5e4a0ae60e28fb4","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-38fa293d4e508b66e14f79c18ce8126b5eef17aa.tgz","fileCount":10,"integrity":"sha512-K7jKu/71k5WGmvEZ7d1DeQrLYnJcoS0cw3o1AHCRylx7PfcMy1S2n8vMCGsxaYXAVwB7Ryz8hEr8R+DDtXlU5g==","signatures":[{"sig":"MEUCIALCj5EZ3nd8tEIqYLKJ9DKSzzzz5+tKyAyy3+WV31x/AiEAmUNcDjtaMb40yEUcZpuXiTnKTTFN8qBfrhXexNVR0cg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6110413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRcySACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoR6BAApANxxvlEeuGVhsgJCzWT5kCTAJ6gJUdOV320Sld4uFQ6QhyP\r\n/Elo9VaWzTah7mnKXBR6SXRknLdpLo0nB7qhEYf7bMnc22udE45SNApwHLS2\r\n1AQTeSjtcLzsMdy/dXZ3JMF3BuXC5E01sqJ+mzaAcTCmETOYb22NytdfnnAS\r\ngT5vA4hF/Kh+Euoh3vKNX/bWkVJMan/tQ+py7V7cL2AQwQHR2hekPZbwU93w\r\nM4FXMe3U+pxkvqoCipQXcc9KP3vpVAiW415mHOInJg84eXufDmr4Swf2FBb5\r\ny8WXcBLpfWpsxfvrqBUNF9KofzU5X4KK7dCiV5c4vx8g9TvAYuVMgLRktCnk\r\n29xEiKDu7D6EeDuFSHEDsWjoALx/69pjz86G6iqeJWGwLaqO2BWUOjS5Srse\r\nJ7Zv0s4z5rcCwQK1T4I5mnXhZ0IxWOhBqM/gyqL7YgbVq+iO+J7z+BK66gN5\r\nctWiH9c6NcV1j8mUvnsmRKTvzm1VEcMTvvIB6vq2ANnUay6+PpTNRMfnVHQq\r\nL61eLb94GwS9u8ej4PRuxHe3m3jO+dLKozNLKXilxFdZxHHv3nUwFhV3SLlP\r\nK5CSyy4ljROrB7v0TdLlHunFee9V3oze/0pEatZi4gWKIrXNvFHMjlRRjrN3\r\nLbomtuU6TKnEssx540kPavcJIT9jcTDq9OQ=\r\n=VGQp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-38fa293d4e508b66e14f79c18ce8126b5eef17aa_1665518738546_0.5120856476493094","host":"s3://npm-registry-packages"}},"0.0.0-05de9ab2cc7559530e4d60779ae766ffad15f419":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-05de9ab2cc7559530e4d60779ae766ffad15f419","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-05de9ab2cc7559530e4d60779ae766ffad15f419","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"c3e343e5a677f1877501b7ccfacf31e96cb2a562","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-05de9ab2cc7559530e4d60779ae766ffad15f419.tgz","fileCount":10,"integrity":"sha512-BZj5jxY6CF9BZvogo8vWuHm+iRlqvHQkjgFnumjrgQ4bN+bnMqiqT+OOudWwElqQmBN1igtIvYrrToPLdLyF0A==","signatures":[{"sig":"MEQCIHskbfeiLIm97kG41a+Cj9Cbzpz9ldVQJ5XN0DKGNkQYAiAXmyMycEuTZ3hHPOcEb5FdMziZaUSC+tgPvTBpqo1OZg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6110413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRtDUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmprXg//SjQFOybNiodQUqg65m55LqXsxDDSt/gaiSeMB8FQDdBmpoGD\r\n6TBl9f4J23N5DDefn/0j32A7vgn/mYmHPg2o1dqzT2LJDVy0ZI5ABxxUjclv\r\n5O1bRCQbNzdrHAkBICHquoyZXal9gXsznlkDb40LS2sV3s7+HMaNwf/0GzGX\r\nJc4WupSyZCfq6+c8g7SWzWrIMgMK/3jG6zamsSNFvRiN1N98Q188phYaTZKX\r\nnh7IESTF9NwDxGMyaoCeec4WUm7mVqTdyeFh3vrr32colaRWwAMysvpx0L3z\r\nmJ5i+bFotNMF7+fp2f79RMJ+6s7IzodNMEMhYYPWGEkheq7DXU0uidwDc1Sz\r\nN6ITJl4a3WG36tFNXaso7VlN6qi/c6DLlotKORp3pYcqjGZW77zhzDiKBPUS\r\nLqB2p1sWgBhh0YJpUsLCb0Z2+ZBSGRg2KEJ+xqetC4iKltnVrDQcIiHt99zZ\r\nBY1DYPsjzbSLp2drBkztjbGmLSXE+6RovQgzHGjwbZoktoDATJoH0MEthr9T\r\ncY18sT3jrJqrQ/wwYaVquO9Q3ahF3tj5FhnGL8nL7mmN22WP5Ba9a8yu2X/i\r\ngm4/EUcQqrqiE8nR0f/+Zouhqj+1AcwikR+rnFATBCF7TsedSOzf32aciL6h\r\nZAUiiu8hehycAXdwCnlbz7P7eNn+LsYx2cQ=\r\n=zuwD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `abandonCart`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-05de9ab2cc7559530e4d60779ae766ffad15f419_1665585363938_0.7360079067908167","host":"s3://npm-registry-packages"}},"0.0.0-0d8a0ae7bb8aac6ce5509dd4185a971cdb3ebab1":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-0d8a0ae7bb8aac6ce5509dd4185a971cdb3ebab1","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-0d8a0ae7bb8aac6ce5509dd4185a971cdb3ebab1","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"4d8d5e36b4585fd49f90585f77ee4ff0068d7bb9","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-0d8a0ae7bb8aac6ce5509dd4185a971cdb3ebab1.tgz","fileCount":10,"integrity":"sha512-KuMlA0zChg9G1BFdWg17T1GG2fQJf3RE2dImAY50g+RXa06OnMzJ7x0ZdK19xan+ZRdMb/qx4qi7s25XDlp5yQ==","signatures":[{"sig":"MEYCIQDfDWbvfg6S9+JPaDFSvkYJDVO8tCSiOrta1+FpO6iqTgIhAL+7iCc+PzmyJGM+q9wdQu9NUupFnOrx69jzhnSVtDAq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6110395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTrktACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZhhAAitZxvR8ydn9oWF0UMmurpFueJOQZfE62yUqSmWFy1TYOS/Ut\r\nN1zOSQmKkmEFsx39gsnblQ6Yxo8K+kGgWJMmvN1rPnRAH2g7sH/6fTTpTMfh\r\nB8lcOXbTej0yoPswokB8D60ACr99E5xN3vrVUr2aWAMyKikHv1nBZ8c0ekK9\r\nGmqDY0OMtX7ljrlxfgQGyYYSW++3S+nHDW7TM2rH0dyTisNf16/WGypW7963\r\nsbvAu/zKDciPXjb/FjeKTDclYZWXq2jJQ69T2JWHlsSrwXqzUIKdnPF5d5Kw\r\ngbCJZpmrnrfji93mhjIg3DX8PV88Ut9qZYAWHibUePOC1sswZj8LXVXfrWlZ\r\nftDBII/bvUO4ZnUWLbVs8nS43BP2ZdTX6P5DHa1fcw9pbRR2XKbUqjPQEchD\r\njNvuXPHA/JQYr0DzMNdITOIQr7RN6Zl26QUcusdxlJf5/iyEgJt6PO+fnk1f\r\nflWpaqt1AcrS0z2xDBz+fY6AZiXPhsmVZxAKj0E/2n3GrVulrPCK3hkIS7PY\r\nRM5OPTIJYtPSFufq2EVZkvUl7HZ4sByGHyxGIVbIUlxa7y9cD0+/9zlYgXWa\r\nioobXNCvCU30zgZ1AKLKu4vZzAg/RyR/MuVwTFK60bkoaN4XMXtaJJpl5YF4\r\na8ncYToWGuBi+YPdCjNnyFFcgOnf1aiHXXc=\r\n=AkwL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-0d8a0ae7bb8aac6ce5509dd4185a971cdb3ebab1_1666103596880_0.7863542607021599","host":"s3://npm-registry-packages"}},"0.0.0-3df58da9a48ddbc777a227ebc026cd87ea6f1bcf":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-3df58da9a48ddbc777a227ebc026cd87ea6f1bcf","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-3df58da9a48ddbc777a227ebc026cd87ea6f1bcf","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"7419723c5e58d739df0a2d63be0cd8d607adf12a","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-3df58da9a48ddbc777a227ebc026cd87ea6f1bcf.tgz","fileCount":10,"integrity":"sha512-d9p+gKviwti3P3rEcRjIE1H6CWfZn2zG5w7zKFAINdt9OuKUAa/mBtqak7YCtYt0XDFwxFLSdI5XtL/yHkHSLA==","signatures":[{"sig":"MEUCIQCJ9suljlqCYi4EAgtRkx4imaScoFwfIOcZlqU0siRXaAIgem7i3fMbV8L7rDrvGEVeGEz+HuQbrx0UI+aAfd0/zZE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6110395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUBGfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoqLA//WffgEeZ9PNkoLn/GdbPp5IFJMZXCoeRRWKJSJh8XXHGrDJoU\r\neEtMaByTuhFNHZjsXxyoYSR/FaLMu2X5SnCAGXHVTmt5or5+7ipprwxfIwAx\r\n0LmzsbfCymnAV8VTScS8HeR8mZD77ZEX8UwwfzheAXWKjzdkQYBJdoCoMApG\r\nwX53PIHLTumV8fsbOxhvvW2f2/IS387oO0xLcp9PWCPUEtCwwJEkj8FLc8Tq\r\nTDw7Wh+o3Ye6Gn2vD9n9PG5/h4dBSMqT6MoY6OL3lO0FGuyOQniHlg1bHtlq\r\nLS8aAQdD8E2JhdkqrkdTS6tDCgxCGrgVCIWM1y5R57clgCprwMeUI4O3vWDa\r\nqVRcn/XaBiPqTA43Nkc2nES22UA/hu40FhhpriqUzvSG/3JORN89pyM7regX\r\ntz4r0EE1Y0uwKkfKd6ESbS5oYjAhRowSnB7n4tU0nFnRFmSV3lpyrbmSU3z8\r\nTe0SQ0Kz3adiiR34KkgTG58bTb40AMZ0Hdyy17KC10Mj7N9+4U48PimMUGQe\r\nC7R9X14D1xlWJuNrgt0OcLtczSZuHmtNklZHU0xnL8DrxHqOP4W5voBLOzMH\r\n93LCOuQfig1oSiXW2yd9shB13l1XvbquOXsXvPks7361H1SGzpj0NYVRqJ7w\r\nDGVMqSb/Mi8IqQHfCr68RUBcqEBgL2UNjxQ=\r\n=N0ps\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-3df58da9a48ddbc777a227ebc026cd87ea6f1bcf_1666191775205_0.2684172282072437","host":"s3://npm-registry-packages"}},"0.0.0-287d65ef03f46abcc395a0ca9bfce606ef5d7fdc":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-287d65ef03f46abcc395a0ca9bfce606ef5d7fdc","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-287d65ef03f46abcc395a0ca9bfce606ef5d7fdc","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"d82ac9db448f089f32801306140461bb5839ed0a","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-287d65ef03f46abcc395a0ca9bfce606ef5d7fdc.tgz","fileCount":10,"integrity":"sha512-ycmNUOhl33bmMU0FX6nQ+BJathV5r0umWJW3Qnm2t8dB7U+InDkABqFHh9My7Qqf0z/h6qVDQ6YBh1LL2JmUvQ==","signatures":[{"sig":"MEQCIEUF/GcNUy2KmT/67jVRdb+Q/mdiiMWpWVe/vg1JzRp5AiBH288xhkm6xqppX5xCr08f0aA322J4CPF3w0tFgZVqRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6116553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtZMSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYSw/+NkTANN/yLJmCHHK6I3/23ktzNbowGC3HGx9zfmV0h9V6gPcT\r\n6nTWf+ChzHD5VWTXVNQakrLBN47eofUdsGW1Z1+T2TlO/GeBTpm6CrAa8nrF\r\n8A469WEvBDEWp1i2zyXCUMHLFC9vqpDWCCqxT2UygphcZrqMiWH6ZVvzfPSa\r\nQmhr+RLZtx622E0azpdq97WNuWABE522AG1PRx4yabwmzfohL3AIq6EEPXqo\r\nHNAB3Gh5HVo1anN2eC3w2ybouVA4mp/j9iJS3adEaBiiys5jxUPvcdlPaWfI\r\nkDjhc8wFX/RN7VD0aOmXz9rs6meLbH0tEDZCTFeHOdnCFYkdLcYwPPYWBfcn\r\n5twTO7OX2X57cpCO8+9wyNHpJQEVEMRSey21/mvc8Ww4T+EdKdAyQMl2vTB0\r\nV0fISoi32y9a0kioPxgwOfDBDmiOZnPdKqsg3cijVveaOZvR6S7ya8H0Thj0\r\ncscQVp0vWuppfeFk8ZHORz4rhdvkDy7QYUEu1ljkS5EqycR4h3+oAogGguNb\r\naJmVbat3XZm842VzmjfGeLbzJe7XgtZLyS9PBbNNNn8szn0wq8qS96sxYBtE\r\nTmygZZ7Zy5F6GXSMhaqAeJFtN3YcXAJm4vCtQCvF575NPdXK8kBnZlE/nHLU\r\nkgGpIc6K5d7vYM+caBu1G/LOT18tPrJFFtE=\r\n=XaeN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-287d65ef03f46abcc395a0ca9bfce606ef5d7fdc_1672844050396_0.6124867914878727","host":"s3://npm-registry-packages"}},"0.0.0-0a1eafe77160f498ebf36cd41d6dc0dfddcacc35":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-0a1eafe77160f498ebf36cd41d6dc0dfddcacc35","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-0a1eafe77160f498ebf36cd41d6dc0dfddcacc35","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"d47c96147757295cdf88750e065e5fa4b309fd73","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-0a1eafe77160f498ebf36cd41d6dc0dfddcacc35.tgz","fileCount":10,"integrity":"sha512-p7unZx0vIUNcTNi50vtpKnyaEO8Kzulv9wrLgoTakZlsOhmrliDQOs1BPnjlbr3QOw+DxpuFcRuwkCb2H64UmQ==","signatures":[{"sig":"MEUCIQDOVlNud4daO3QEfCKWVNsyw5OGCLfjKA8iRFsQcGG6EAIgPBgem+78tvRPA2uyw0By1Z1pIe5omVgUXyWi5TbJCNQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6116842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/7QMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpr1A//YOcCKNUmrTKPlB1XTi4EtGvdI/IV2k4dJfBnZL/e8uzZaXX7\r\njwOgHXmRFycKC/9Lg381gdRsJbS7kjUiG+GxJrTkmDP49w11Xn/GqY76+E8v\r\nDg03BipTZSGWD23XZnUWAhMybKfwrhicZSK9/hh42SKFGzwpU8iTZQEBwFAp\r\nVuxI2dz4nRvnv9VstMcUVQ6Ncgfyv+5i6/uwjMwNgiXEqdr/JwLY/cTUlR20\r\nWcgcfR3Zk7Pi8bfGs7ZHszm0Gp7OQ/J6LLMb+vb6kkFvs5+MLy7OEJM9pZIV\r\n43C8fzu+Wupd7KdgfFae9VVi2FVZWl6ow1/XYuy+s209VEtOdEIPJLlCOSL0\r\nV8Y/HpJlVKc2sTzaVA51frs6F1BWG7rHgAM1JRPR6+Xg0T0PVaTfZ8rB/Xp5\r\ndkCsDaED2l7E5hqgos0/qecVi/ZRGE9JaArBFBS/IoA64VbtnhDkDxd4IVOP\r\nQDbYrJir06gmPu6hqRv49VPqxJ1H98//phDU16IZUK2nbDCsUnaPeLWBV7cz\r\nqbzI/GIZgKaYwigQghvW8ti2nfhCHbyh/LddWrNhTixcOFGmGmkQAQk18aNh\r\nfjBu6c1SPVSmcoEqk1A+/2MbCgZMy5Sk2Y9CrTHAltYXvxo+86jFA4i0lN4I\r\nGca19axCPxg2eIU/jZoACO4kWyN9NzjNacQ=\r\n=+Xfp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-0a1eafe77160f498ebf36cd41d6dc0dfddcacc35_1677702155890_0.854045490890238","host":"s3://npm-registry-packages"}},"0.0.0-5f544538cd1e6239aded804f5230a0011c8bf48a":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-5f544538cd1e6239aded804f5230a0011c8bf48a","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-5f544538cd1e6239aded804f5230a0011c8bf48a","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"ca507dd5afd526cfcfcd10432b915003f85127e1","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-5f544538cd1e6239aded804f5230a0011c8bf48a.tgz","fileCount":10,"integrity":"sha512-lk604RF5+0aDLSdhYZjQDtvXGlM3Xree7+7vJSOs2B9UxvTgmbKjoHSTCIC7/ZBRQ8zOhz+iSKQCU6UAqNCKAQ==","signatures":[{"sig":"MEQCIBbTnV0vbDHd5Wf7D8xqsHNHDb0qcEmZ481ItLYN73knAiBuQk4cpHUIKDFUqcytWa1fbnKvXh0NLK5VUoaJjrPudQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6116842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEPKmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDEg//UVXOHRqaGKJnFMPx1FeBCskNgDqkrtqe2Cpt6TeqqofVl91V\r\n+W0Cn9qj1IPXIoQd/evl7L1ksh9866V068HfoUFPqjFpcxGdLdeFFNo7rjSO\r\nrLYPNjzkUlgcEeX3XNWdMi9ReWgQoL/ym4MdfwkXCYsyugCBbyDADldNZIu6\r\nuVu2XYiYcRaFAq5zXIyc2Oz/5auvFSd80nEcvKZAgw9ionPOHzX9XkiOtEla\r\nwYhdbEQWy2mAUPH0c5vlqfWPGElRCs5KHIKxmd1WZe3/HUqoGD4VDKJWajwk\r\nnCO3RK7YEjWa0jU0Dd73ihm2tP8N0UxocXGzN1fqEyhcVUgm2fJBdY+6J0qd\r\nVaiD+pnYL2Be7YvUudY3VLlOsrwz7NnteombXDpEpI/M19ZpAQ+mmo3zekeh\r\nM3xUKmh9XeNbPirGWgz41dKiGOtmN2Zj1Lp7PuQXda+oAu3PdrStA6I87AZO\r\nGNy8or3JKC6WhhYfpHWmaYkoUebQI/Mc6dkX9Jbq/Er3GoVVl7qCVjqKgpu8\r\nZI4PmOBEXRrSEPwzaHHVhpdPmFrVsv8AVB9Mzdd1AjvSzFhOeK09d4Iw28o5\r\ni4jgruEvNU+xA6fytySA/2kzUUr92MUeiDGkYwXOp+/fuk9NXTFMmCrhvjHQ\r\ntAGMUMCYpMj3I+KmEdJ/RImt/7/19bfv4jc=\r\n=t/r3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-5f544538cd1e6239aded804f5230a0011c8bf48a_1678832294255_0.48287040740569376","host":"s3://npm-registry-packages"}},"0.0.0-1ca7412c31f009cc1474136e18c3507a7e66b751":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-1ca7412c31f009cc1474136e18c3507a7e66b751","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-1ca7412c31f009cc1474136e18c3507a7e66b751","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"2bea409aef73ddc7c25a37fac3e022c8aae9638e","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-1ca7412c31f009cc1474136e18c3507a7e66b751.tgz","fileCount":10,"integrity":"sha512-SHnpJ8Mzym0eNmvhJYg35HeKP9U3RxKwtSWK/mzsGatfllJxvNTSYyb2HQWgBC1vJMOF0XI7+bhFJImrUcYwwQ==","signatures":[{"sig":"MEQCICHU1w3IhsCDLZG2ME8kdCuoIOIlZcjCcokBApwtNMgWAiAzPnE4Qj3tHzrLbU7IMnv0IN/mo4MJj+LG5OHJpOeaQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6117791,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkK2ShACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohMA//aEJ+VwS/R26KDISGxCfRxsEDRyAH/3M9h8sEJmEuGihExfUt\r\nNpfl+vknWgUCAZg72TQ0LfxGxWOuutpuetfwwoOUAta3r8ZRkuOVpvhsALJ6\r\n/PIsbmlzScuzyW48tehb3m0cqQXW5xwKk4XXLpFULGs2QMw5ia3vO0EcgSuL\r\nMWYn9i2iw9BG6Ryi4dYpGBwN8xO/bt5jyjfotGaXZ781K398MseGiOlP5coi\r\nUGHuMgoDZyN//wdMw2nCju44n7UBF+5LW+ZfQf4CUaxJILcmB8mr074tIVRC\r\nfR5utkydm2W73OsRDB8kB4nxGYWUdyd9o9nPKdbutXnjSOJd/Ka+xO7aolJZ\r\nQ5sx453yKBvxRtrn91dnqLBHISyNX0ukx7zyH5wFodW1KzXLJDH99Ui1LUpS\r\nUQ+oOfojRwYP0Ofb6KK0gnM6/JUmXZIUPkCJo3QEXf46VYjbQQ7+Kautmesi\r\nVfhn1klCWWkOg3XORedS5LEaAYZ4kpS60RHAhRXGH3qLbdBH3KK5gfpbMTlY\r\n+XfkPNVD+f5fPZ0lZ+hL7VHjyTjNWJHt96+sVdJbh1lvKZYuuHUSGy0W/kiG\r\nn1qJzFd5LAxXExEYIIBtoJ4l04XQHztEgK3VGfyzk2OgSm4gPAp+vJBtUGkn\r\nU1e2B8KExH5cs1zNx/Ht7tJ3vwTInnRthU8=\r\n=q8N6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-1ca7412c31f009cc1474136e18c3507a7e66b751_1680565409453_0.5223598603995685","host":"s3://npm-registry-packages"}},"0.0.0-da39dfc5be75add99d570ea82dda8bd294301f8c":{"name":"@adobe/commerce-events-collectors","version":"0.0.0-da39dfc5be75add99d570ea82dda8bd294301f8c","keywords":[],"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","_id":"@adobe/commerce-events-collectors@0.0.0-da39dfc5be75add99d570ea82dda8bd294301f8c","maintainers":[{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"}],"homepage":"https://github.com/adobe/commerce-events/tree/main/packages/commerce-events-collectors#readme","bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"dist":{"shasum":"2d2c0b962aaefdf9206863656ccd493a4e0d865c","tarball":"https://registry.npmjs.org/@adobe/commerce-events-collectors/-/commerce-events-collectors-0.0.0-da39dfc5be75add99d570ea82dda8bd294301f8c.tgz","fileCount":10,"integrity":"sha512-r+woEPK3ahJ7+LFjitYolOMRZ4gfpZhMra6Pi1uqnKI2gj6yOsVw0IrrO1pZv6yoKpBAMRijje9t5FVbRnyIKA==","signatures":[{"sig":"MEUCIFJEgVp/bYTw1mBK4wuxkZUsO2VVCMKbUrrBBXz3kIZsAiEA+f+KjzjrlnTEfL+oPF9zru/8o+qtLN/eVabKn7KPY6c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6114224},"main":"dist/index.js","husky":{"hooks":{"prepare-commit-msg":"exec < /dev/tty && git cz --hook || true"}},"types":"dist/index.d.ts","module":"dist/index.js","readme":"# Adobe Commerce Events Collectors\n\n[![version][version-badge]][npm]\n[![downloads][downloads-badge]][npm]\n[![size][size-badge]][bundlephobia]\n[![build][build-badge]][actions]\n[![typescript][typescript-badge]][typescript]\n[![contributing][contributing-badge]][contributing]\n\n## Overview\n\nThis package listens for and handles events published by the [Adobe Commerce Events SDK][sdk] to the adobeDataLayer[acdl]. It runs as a side effect and is meant to be a convenience for users who want to send event data to Adobe Commerce.\n\n## Installation\n\nThe collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on [unpkg][unpkg], and the bundled version is hosted on [npm][npm].\n\nTo load the Collector as a script, use the following snippet.\n\n```\n<script src=\"https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\"></script>\n```\n\nTo install the script as a dependency, run this command.\n\n```shell\nnpm install @adobe/commerce-events-collectors\n```\n\n## Quick start\n\nAfter loading the collector script, or importing the package as shown below, there is nothing else that needs to be done.\n\n```javascript\nimport \"@adobe/commerce-events-collectors\";\n```\n\n## Usage\n\nThe collector listens for the following events.\n\n-   `pageView`\n-   `addToCart`\n-   `productPageView`\n-   `shoppingCartView`\n-   `initiateCheckout`\n-   `openCart`\n-   `placeOrder`\n-   `recsItemAddToCartClick`\n-   `recsItemClick`\n-   `recsRequestSent`\n-   `recsResponseReceived`\n-   `recsUnitRender`\n-   `recsUnitView`\n-   `removeFromCart`\n-   `searchCategoryClick`\n-   `searchProductClick`\n-   `searchRequestSent`\n-   `searchResponseReceived`\n-   `searchResultsView`\n-   `searchSuggestionClick`\n-   `createAccount`\n-   `editAccount`\n-   `signIn`\n-   `signOut`\n-   `custom`\n\nThe handlers forward events to two edges:\n\n-   Adobe Commerce Data Services (maintained by Adobe Engineering and used to power merchant performance dashboards)\n\n    Required contexts:\n\n    `StorefrontInstance`\n\n    Events not forwarded to Adobe Commerce:\n\n    `createAccount`\n\n    `editAccount`\n\n    `openCart`\n\n    `removeFromCart`\n\n    `signIn`\n\n    `signOut`\n\n    `custom`\n\n-   [Adobe Experience Platform (AEP)](https://business.adobe.com/products/experience-platform/adobe-experience-platform.html) (requires a subscription and additional merchant [setup](https://experienceleague.adobe.com/docs/experience-platform/edge/fundamentals/datastreams.html?lang=en); data can be used by merchants inside the Adobe Experience Platform for detailed analytics, targeted merchandising, real time customer data profiles, and more)\n\n    Required contexts:\n\n    `AEP`\n\n    `EventForwarding.aep: true`\n\n    Events not forwarded to AEP Edge:\n\n    `recsItemAddToCartClick`\n\n    `recsItemClick`\n\n    `recsRequestSent`\n\n    `searchResponseReceived`\n\n    `searchCategoryClick`\n\n    `searchProductClick`\n\n    `searchResultsView`\n\n    `searchSuggestionClick`\n\n### Turning off collection per edge\n\nEvents are sent to Adobe Commerce Data Services by default. To turn collection off collection, set `EventForwarding.commerce: false`.\n\nEvents are not set to AEP Edge unless explicitly configured (`EventForwarding.aep: true`);\n\n### Handling custom events\n\nCustom events are supported for the Adobe Experience Platform only. Custom data will not be forwarded to Adobe Commerce dashboards and metrics trackers.\n\nFor any `custom` event, the collector adds a `personId` (`ecid`) to `customContext` and wraps an `xdm` object around it before forwarding to the Edge.\n\nExample:\n\nCustom event published through MSE SDK:\n\n```javascript\nmse.publish.custom({\n    customContext: { customStrAttr: \"cheetah\", customNumAttr: 128 },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        personId: 'ecid1234',\n        customStrAttr: 'cheetah',\n        customNumAttr: 128\n    }\n}\n```\n\n**note** Using custom events may affect OOTB Adobe Analytics reports.\n\n### Handling event overrides (custom attributes)\n\nAttribute overrides for standard events are supported for the Experience Platform only. Custom data will not be forwarded to Commerce dashboards and metrics trackers.\n\nFor any event with a set `customContext`, the collector overrides `personId` and Adobe Analytics counters, and forwards all other attributes set in `customContext`.\n\nExamples:\n\nProduct view with overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { customCode: \"okapi\" },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        customCode: 'okapi',\n        commerce: {\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\nProduct view with Adobe Commerce overrides published though MSE SDK:\n\n```javascript\nmse.publish.productPageView({\n    customContext: { commerce: { customCode: \"mongoose\" } },\n});\n```\n\nIn AEP Edge:\n\n```javascript\n{\n    xdm: {\n        eventType: 'commerce.productViews',\n        personId: 'ecid1234',\n        commerce: {\n            customCode: 'mongoose',\n            productViews: {\n                value : 1\n            }\n        }\n    }\n}\n```\n\n**Note** Overriding events with custom attributes may affect OOTB Adobe Analytics reports.\n\n## Shopper Consent and Data Collection Opt out\n\nThe \"mg_dnt\" cookie is used by Product Recommendations to restrict data collection.\n\nwhen the [cookie restriction mode](https://experienceleague.adobe.com/docs/commerce-admin/start/compliance/privacy/compliance-cookie-law.html) is enabled, data services will set the \"mg_dnt\" cookie to true.\n\n```javascript\nconst listenForCookieEvents = ($) => {\n    const DNT_COOKIE = \"mg_dnt\";\n    let userAllowedSaveCookie = !!$.mage.cookies.get(\"user_allowed_save_cookie\");\n\n    if (userAllowedSaveCookie) {\n        $.mage.cookies.clear(DNT_COOKIE);\n    } else {\n        $.mage.cookies.set(DNT_COOKIE, true);\n    }\n};\n```\n\nBy default, the user consent preference in AEP is set to \"opt in\", unless the cookie restriction mode is enabled and the \"mg_dnt\" cookie is present.\n\nThe script will keep polling to check for any changes and send the updated preference to AEP.\n\n```javascript\nconst doNotTrackCookie = document.cookie.indexOf(\"mg_dnt\") !== -1;\nalloy(\"setConsent\", {\n    consent: [\n        {\n            standard: \"Adobe\",\n            version: \"1.0\",\n            value: {\n                general: doNotTrackCookie ? \"out\" : \"in\",\n            },\n        },\n    ],\n});\nsetInterval(setConsent, 1000);\n```\n\n## PII Data Collection\n\nThe following events forward a user's email as PII data to AEP:\n\n`createAccount`\n\n`editAccount`\n\n`signIn`\n\n## Support\n\nIf you have any questions or encounter any issues, please reach out at these locations.\n\n-   [GitHub][issues]\n\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[version-badge]: https://img.shields.io/npm/v/@adobe/commerce-events-collectors.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dt/@adobe/commerce-events-collectors?style=flat-square\n[bundlephobia]: https://bundlephobia.com/result?p=@adobe/commerce-events-collectors\n[size-badge]: https://img.shields.io/bundlephobia/minzip/@adobe/commerce-events-collectors?style=flat-square\n[actions]: https://github.com/adobe/commerce-events-collectors/actions\n[build-badge]: https://img.shields.io/github/workflow/status/adobe/commerce-events/merge-to-main?style=flat-square\n[typescript]: https://typescriptlang.org/dt/search?search=%40adobe%2Fcommerce-events-collectors\n[typescript-badge]: https://img.shields.io/npm/types/@adobe/commerce-events-collectors?style=flat-square\n[contributing]: https://github.com/adobe/commerce-events/blob/main/.github/CONTRIBUTING.md\n[contributing-badge]: https://img.shields.io/badge/PRs-welcome-success?style=flat-square\n[sdk]: https://npmjs.com/package/@adobe/commerce-events-sdk\n[acdl]: https://github.com/adobe/adobe-client-data-layer\n[unpkg]: https://unpkg.com/@adobe/commerce-events-collectors/dist/index.js\n[npm]: https://npmjs.com/package/@adobe/commerce-events-collectors\n[issues]: https://github.com/adobe/commerce-events/issues\n","scripts":{"ace":"NODE_ENV=development rollup -c --watch","dev":"NODE_ENV=development rollup -c --watch","lint":"eslint .","test":"jest --passWithNoTests","build":"NODE_ENV=production rollup -c","start":"NODE_ENV=development rollup -c","release":"cross-env HUSKY_SKIP_HOOKS=1 standard-version","test:ci":"jest --passWithNoTests --ci","build:qa":"NODE_ENV=testing rollup -c","lint:fix":"eslint --fix .","build:dev":"NODE_ENV=development rollup -c","build:prod":"NODE_ENV=production rollup -c","test:watch":"jest --passWithNoTests --watch"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","directories":{},"dependencies":{"@adobe/alloy":"^2.9.0","@snowplow/browser-tracker":"^3.0.1","@adobe/commerce-events-sdk":"*","@snowplow/browser-plugin-performance-timing":"^3.0.1","@snowplow/browser-plugin-link-click-tracking":"^3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","eslint":"^7.32.0","rollup":"^2.78.0","ts-jest":"^26.5.6","tsconfig":"*","cross-env":"^7.0.3","typescript":"^4.7.2","@types/jest":"^26.0.24","standard-version":"^9.5.0","rollup-plugin-dts":"^4.2.2","@rollup/plugin-json":"^4.1.0","rollup-plugin-serve":"^2.0.1","@testing-library/dom":"^7.31.2","eslint-config-custom":"*","rollup-plugin-esbuild":"^4.9.3","rollup-plugin-license":"^2.8.1","@rollup/plugin-commonjs":"^22.0.2","rollup-plugin-sourcemaps":"^0.6.3","cz-conventional-changelog":"^3.0.1","@rollup/plugin-node-resolve":"^13.3.0","@adobe/adobe-client-data-layer":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/commerce-events-collectors_0.0.0-da39dfc5be75add99d570ea82dda8bd294301f8c_1691509813091_0.9653953897944691","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-06-28T15:52:24.608Z","modified":"2026-10-01T01:32:55.601Z","0.0.0-b0e9ee788f86104fc458c6cba356cb515c3f1ba6":"2022-06-28T15:52:24.961Z","0.0.0-5b542c476741f10746bc22a62549fbae5a51a1fb":"2022-06-28T16:13:21.508Z","0.0.0-a7a94d6fd08468c128f1887ecd8e2157eaaf4856":"2022-06-28T21:34:18.637Z","0.0.0-b272aaffa8d0351753f4f37470429258d96ef46e":"2022-06-29T18:04:00.180Z","0.0.0-445610123d377edb9fe3238feea8b8effbd1dc2e":"2022-06-29T18:13:18.851Z","0.0.0-8fb54ed8430bedfed83efab09762c83d3d23b5bc":"2022-07-12T19:17:07.146Z","0.0.0-d974b558b86db36db72fcb7a172019b9eeac770e":"2022-07-14T17:25:22.494Z","0.0.0-d8fba47d8e642308cc4ffe5f7c0f5191d1f300c7":"2022-07-15T02:43:01.022Z","0.0.0-32ddd83b7b870ad17a3965f8cc6fc6bd46145d64":"2022-07-15T20:18:40.105Z","0.0.0-27995b9ed59f8a6940dd3ede9b88aa7a7b16e617":"2022-07-21T18:40:36.530Z","0.0.0-2eeca011f4ab84122d117ca5210506dc804d116d":"2022-07-27T19:39:12.308Z","0.0.0-9d20d0266cc42933fb7e3ecc99480ebe64561d29":"2022-07-27T19:45:20.065Z","0.0.0-9eae7f0e6cd9737faa74a7d7cfede697ae883ca3":"2022-07-28T14:47:45.472Z","0.0.0-5b88c2dbc8584f8671c1eb255f964ec5822a0467":"2022-07-28T17:31:30.276Z","0.0.0-7bc250ab7c83c211c4266221e95622ce73ec94e3":"2022-08-02T16:10:07.665Z","0.0.0-610bf9b098c89b94c07da8c09e202743c5583f5a":"2022-08-02T17:39:09.103Z","0.0.0-99b7ec612d5657080719687f50b4f2e49cc84e8f":"2022-08-02T19:18:13.221Z","0.0.0-3416a6d5e4f1564f74d81bfc21c503b0835c3186":"2022-08-02T19:44:47.076Z","0.0.0-38a9ed06514792a2be772ca91abb5f4b78174b62":"2022-08-03T15:00:38.951Z","0.0.0-0ea143fcc77f1966f2dc7cb31fc896aaf0a98aca":"2022-08-03T15:33:14.066Z","0.0.0-212c0d5bd4f63ca6bbfb51bb3029310fcd8993d2":"2022-08-03T15:46:47.053Z","0.0.0-735b4f789b74db78538d9965ff7af2da2c0a5e92":"2022-08-03T16:25:17.536Z","0.0.0-9a94583c87fc38d6750b5fbff3326f6c1a25e498":"2022-08-11T16:05:32.659Z","0.0.0-01fb35b52a036c00ce1c608125b568942dc67560":"2022-08-18T14:27:45.947Z","0.0.0-adb46651b1bb7b4611e62674f2755c312830d65d":"2022-08-18T14:27:53.745Z","0.0.0-67c0d298a5826e4b23837ebec8f5a1ed13d3b505":"2022-09-08T20:18:49.734Z","0.0.0-c9c1b4b52207f89bf0efa271582b5f488cf3d266":"2022-09-12T06:34:05.894Z","0.0.0-398d305da8d81f96f245689e93cfa53a6563b0a6":"2022-09-13T16:00:42.737Z","0.0.0-f0c05a055d83389581b5aa12e5217df4f3d0a057":"2022-09-19T19:25:30.839Z","0.0.0-6704b8e6445473ccf046eef692069c849bf4c564":"2022-09-19T20:01:34.693Z","0.0.0-9c2b80889a9b80940cdc2b6c1cac500374c953e9":"2022-09-20T19:03:47.932Z","0.0.0-bc9cf92ff5f90ad304cd227eb9d58274e3b9d86f":"2022-09-21T14:11:35.056Z","0.0.0-2df0c4614bf7bf739cac8d273d5959548198c715":"2022-09-26T15:14:01.720Z","0.0.0-0532edbccbf6127c783e80f3dce0585187546f7b":"2022-09-26T16:04:43.653Z","0.0.0-85bd07962a44a05f6f44988f4dbcc79b6517bcfe":"2022-09-26T21:15:17.826Z","0.0.0-6702428c4696ac1a2b6c2a40a49725c43767b68a":"2022-09-27T21:36:39.025Z","0.0.0-99cbc4e0583a69944fcf3d8abfce41b27b44cb40":"2022-10-05T16:03:54.982Z","0.0.0-9bc3d2d7ee1b3ba7b27e195b5513c4a6587dbeaa":"2022-10-11T16:09:46.245Z","0.0.0-38fa293d4e508b66e14f79c18ce8126b5eef17aa":"2022-10-11T20:05:38.726Z","0.0.0-05de9ab2cc7559530e4d60779ae766ffad15f419":"2022-10-12T14:36:04.110Z","0.0.0-0d8a0ae7bb8aac6ce5509dd4185a971cdb3ebab1":"2022-10-18T14:33:17.268Z","0.0.0-3df58da9a48ddbc777a227ebc026cd87ea6f1bcf":"2022-10-19T15:02:55.505Z","0.0.0-287d65ef03f46abcc395a0ca9bfce606ef5d7fdc":"2023-01-04T14:54:10.644Z","0.0.0-0a1eafe77160f498ebf36cd41d6dc0dfddcacc35":"2023-03-01T20:22:36.073Z","0.0.0-5f544538cd1e6239aded804f5230a0011c8bf48a":"2023-03-14T22:18:14.507Z","0.0.0-1ca7412c31f009cc1474136e18c3507a7e66b751":"2023-04-03T23:43:29.777Z","0.0.0-da39dfc5be75add99d570ea82dda8bd294301f8c":"2023-08-08T15:50:13.430Z"},"bugs":{"url":"https://github.com/adobe/commerce-events/issues"},"author":{"url":"https://www.adobe.com/","name":"Adobe"},"license":"MIT","homepage":"https://github.com/adobe/commerce-events/packages/commerce-events-collectors#readme","keywords":[],"repository":{"url":"git+https://github.com/adobe/commerce-events","type":"git"},"description":"Event Collectors for Adobe Commerce storefronts","maintainers":[{"email":"mabecker@adobe.com","name":"marbec"},{"email":"tripod@bocanegra.ch","name":"tripod"},{"email":"garthdb@gmail.com","name":"garthdb"},{"email":"lazdnet@gmail.com","name":"lazd"},{"email":"grp-opensourceoffice@adobe.com","name":"adobe-admin"},{"email":"patrickfulton@gmail.com","name":"patrickfulton"},{"email":"lars@trieloff.net","name":"trieloff"},{"email":"krisnye@gmail.com","name":"krisnye"},{"email":"dcpfsdk@adobe.com","name":"dcpfsdk"},{"email":"natebaldwindesign@gmail.com","name":"natebaldwin"},{"email":"devongovett@gmail.com","name":"devongovett"},{"email":"danniintheus@gmail.com","name":"aspro83"},{"email":"symanovi@adobe.com","name":"symanovi"},{"email":"dominique.pfister@gmail.com","name":"dpfister"},{"email":"sg@adobe.com","name":"stefan-guggisberg"},{"email":"npm@rofe.com","name":"rofe"},{"email":"kptdobe@gmail.com","name":"kptdobe"},{"email":"halls@adobe.com","name":"adobehalls"},{"email":"bradjohn@adobe.com","name":"fullcolorcoder"},{"email":"djaeggi@adobe.com","name":"djaeggi"},{"email":"dylandepass@gmail.com","name":"dylandepass"},{"email":"mhaack@adobe.com","name":"mhaack"},{"email":"amol@adobe.com","name":"amol-anand"},{"email":"stopp@adobe.com","name":"stopp-adobe"},{"email":"namarora@adobe.com","name":"namarora"},{"email":"doten@adobe.com","name":"doten"},{"email":"schmidt@adobe.com","name":"duh_schmidt"},{"email":"astha.bhargava23@gmail.com","name":"asthabh23"},{"email":"aljoseph@adobe.com","name":"aljoseph"},{"email":"zouhir.dahbi@outlook.com","name":"zdahbi"},{"email":"tuicu@adobe.com","name":"tuicu"},{"email":"fmeschbe@adobe.com","name":"fmeschbe"}],"readme":"","readmeFilename":""}