From 398517d35f01912dc44ad79be958f8de89df0d9c Mon Sep 17 00:00:00 2001 From: bobbyatsegment Date: Tue, 7 Mar 2023 14:00:08 -0500 Subject: [PATCH 1/3] Update fetchDestinationForWriteKey to check for Amplitude (Actions) --- src/consent-manager-builder/fetch-destinations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/consent-manager-builder/fetch-destinations.ts b/src/consent-manager-builder/fetch-destinations.ts index 7fee3493..04e2fac2 100644 --- a/src/consent-manager-builder/fetch-destinations.ts +++ b/src/consent-manager-builder/fetch-destinations.ts @@ -21,7 +21,8 @@ async function fetchDestinationForWriteKey( // Rename creationName to id to abstract the weird data model for (const destination of destinations) { // Because of the legacy Fullstory integration the creationName for this integration is the `name` - if (destination.name === 'Fullstory (Actions)') { + // Adding Amplitude (Actions) here as well to account for session_id + if (destination.name === 'Fullstory (Actions)' || destination.name === 'Amplitude (Actions)') { destination.id = destination.name } else { destination.id = destination.creationName From 05d4acbc2cf26f59ad5b27c5d6fc8f57084804b5 Mon Sep 17 00:00:00 2001 From: bobbyatsegment Date: Tue, 7 Mar 2023 14:12:34 -0500 Subject: [PATCH 2/3] Add destination considerations section mentioning Amplitude Actions --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0e2d1c67..355ed8e4 100644 --- a/README.md +++ b/README.md @@ -919,6 +919,14 @@ _Note: Keep in mind that setting the anonymousId in Analytics.js does not overwr _There are other ways to override the anonymousID, you can find more information [here][]._ +### Destination Considerations + +##### Amplitude (Actions) + +When an Amplitude (Actions) destination is connected and enabled to your source, Analytics.js will automatically populate a session ID in `integrations.Actions Amplitude.session_id`. + +Because the Consent Manager overrides the `session_id` key with a boolean value, `session_id` will have to be directly passed in to event calls by retrieving the value for `analytics_session_id` in localStorage. The value can then be set in an event's `traits` or `properties` object. + ## Development To run our storybook locally, simply do: From 67eb931e8a0ac7c6a0f54a2d58081b76e9d63209 Mon Sep 17 00:00:00 2001 From: bobbyatsegment Date: Tue, 7 Mar 2023 14:15:40 -0500 Subject: [PATCH 3/3] Add link to destination considerations section --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 355ed8e4..128359c2 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ - [ConsentManagerBuilder Render Props](#consentmanagerbuilder-render-props) - [Utility functions](#utility-functions) - [Setting Custom Anonymous ID](#setting-custom-anonymous-id) + - [Destination Considerations](#destination-considerations) - [Development](#development) - [Publishing New Version](#publishing-new-version) - [License](#license)