fix: custom mapping to transaction attributes not to be null-ed for e… #141
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.
…com events
Summary
M&S noticed that when they custom map the purchase to another eCom event (Checkout in their case) in their AppsFlyer connection config. The revenue that is mapped to the total amount is not being forwarded. After a thorough investigation, I was able to find the issue within our Apple SDK and not the AppsFlyer kit. When testing locally, I noticed that when a transaction attribute is mapped but no product attribute is mapped, it overrides the existing mapping to the transaction attribute (Revenue/Total Amount in this case) and replace it with a nil projectedDictionary and thus never be forwarded to AppsFlyer (or any integration kit that use the same settings with custom mapping). The fix provided here is instead of overriding the projectedDictionary to a nil one, it just returns it to itself with existing correctly mapped transaction attributes.
Testing Plan
Tested with different scenarios locally and they all worked as expected: