analytics.js-integrations
analytics.js-integrations copied to clipboard
[STRATCONN-27] Adobe Analytics Merch Events
JIRA: https://segment.atlassian.net/browse/STRATCONN-27 (Merch Events) JIRA: https://segment.atlassian.net/browse/STRATCONN-122 (Bump SDKs) CC: https://segment.atlassian.net/browse/CC-6316
NOTE: These changes were merged a few months ago by Brennan but because we received no feedback from Levis from UAT, and the changes were blocking the PR was reverted. Please see original PR here: https://github.com/segmentio/analytics.js-integrations/pull/231
What does this PR do? This PR adds support for:
Merchandizing events
- This is when we attach a custom Adobe event and a corresponding value to window.s.events, e.g. window.s.events='event23=30'
Product merchandizing variables
- e.g. window.s.products='Games;Monopoly: 3rd Edition;1;19.00;event5=2.5;event23=10' (event23 is a product merch variable)
Product eVars
- e.g. window.s.products='Games;Monopoly: 3rd Edition;1;19.00;event5=2.5;eVar33=1' (eVar33 is a product eVar)
Adobe documentation here: https://docs.adobe.com/content/help/en/analytics/implementation/javascript-implementation/variables-analytics-reporting/page-variables.html (see "products" heading)
Updates the AppMeasurement, VisitorAPI, and MediaSDK (previously VideoHeartBeat) libraries to be the latest versions:
- AppMeasurement - 2.20.0
- VisitorAPI.js - 4.4.0
- MediaSDK - 2.2.
This will be verified by a customer sometime in the next week or two. Tests will pass once the SDK is uploaded to our production buckets. These changes have been tested and validated in staging.
⚠️ Do not release this until the new SDKs are added to our production CDN bucket. ⚠️ The new SDKs have been added to our stage s3 bucket. The folder and objects must be copied over to the production and production backup buckets. You must assume the platform role to do so.
Are there breaking changes in this PR?
- No, this update does not change any existing functionality, and only adds support for the three variables mentioned above.
Any background context you want to provide?
- This is a Levi's request and will be concurrently deployed with https://github.com/segmentio/analytics.js-integrations/pull/451. Levis will have 4/13-4/24 for User Acceptance Testing and to provide feedback.
Is there parity with the server-side/android/iOS integration components (if applicable)? Yes, this PR ensures parity with server-side. Each function added has full parity with SS implementation. Merchandising events are not currently supported on mobile.
Does this require a new integration setting? If so, please explain how the new setting works
No the setting merchEvents already exists in metadata. We will need to expose it to the CDN in. order for it to work in A.js.
Links to helpful docs and other external resources
- Adobe documentation: https://docs.adobe.com/content/help/en/analytics/implementation/javascript-implementation/variables-analytics-reporting/page-variables.html (see "products" heading)
- Server side implementation: https://github.com/segmentio/integrations/blob/master/integrations/adobe-analytics/lib/mapper.js
@gpsamson I merged https://github.com/segmentio/analytics.js-integrations/pull/451 into this branch and updated HISTORY.md so we can deploy changes to Levis concurrently.
I fixed unit tests. If not Product Evars are present we still to append a ; per Adobe documentation.
We also should allow customers to not pass a Adobe Event/Segment Prop on product scoped events. This essentially will not pass an events string which is ok because it is option.
So the format of the s.products that we form is [category][item][quantity][total][incrementor][merchandising] . The incrementor is based off the Segment Property which is a required field on Product Scope. We set AdobeEvent= segmentProp.value as incrementor. Based off the implementation if the Segment Property is left as null the event will not be sent. If Levis adds a product.price their product string appears like so: 'Clothing|Men|Jeans;501® Original Fit Men's Jeans;1;69.50;null=69.5;eVar16=501® Original Fit Men's Jeans|eVar31=leviNAProductCatalog'. If they leave the Adobe Event and Segment Property blank it crashes and doesn't send anything.
Levis is the behavior to be able to leave Adobe Event and Segment Prop blank as to have the incrementor blank and have 'Clothing|Men|Jeans;501® Original Fit Men's Jeans;1;69.50;;eVar16=501® Original Fit Men's Jeans|eVar31=leviNAProductCatalog' . Recent changes committed fixed this behavior.