This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
Fix integrations object key for Amplitude (Actions) #307
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for issue #296
Currently, when
integrations.All
isfalse
andintegrations.Actions Amplitude
istrue
, the latter field will be replaced by thesession_id
that is generated for this destination, resulting in events not reaching Amplitude (Actions).This can be replicated by enabling an instance of Amplitude (Actions), sending an event with
integrations.Actions Amplitude
set to true, and observing both the outbound request payload and how the event populates in the source's debugger:Invoking event from source:
Outbound request payload:
Event populating in Source Debugger:
This results in the event not sending to Amplitude.
When
integrations.Amplitude (Actions): true
is part of the event invoked from the client, it takes precedence overintegrations.Actions Amplitude.session_id
and the event will deliver to Amplitude as expected, albeit without the session ID:Invoking event from source:
Outbound request payload:
Event populating in Source Debugger:
Currently, when
fetchDestinationForWriteKey
is invoked, the destination name for Amplitude (Actions) is changed to the creation name Actions Amplitude, and thesession_id
will take precedence and override the boolean that is being set in theintegrations
object, as with the first example.Added an update to
fetchDestinationForWriteKey
so that the destination name is set asdestination.id
if the destination name is "Amplitude (Actions)". With this change, theintegrations
object should now get set tointegrations.Amplitude (Actions)
and deliver events to Amplitude as expected, as with the second example.session_id
can then be passed to an event’s payload by pulling the value fromlocalStorage.analytics_session_id
and setting it in theproperties
ortraits
object:Session ID as a property:
Both the event and Session ID get sent to Amplitude:
Added a section called "Destination Considerations" in the readme that mentions this process.