Description
Updated trackPaymentConversion so that conversions are also sent when a couponCode is present, even if the source is 'direct' or missing.
The couponCode is now included in the event payload as order_promo_code.
Reason & Context
Previously we relied only on the referrer to decide whether to send events to Impact, which meant direct visits were not tracked.
Each affiliate already has a coupon code assigned in Impact, so we can attribute conversions using the coupon instead of the referrer.
This allows us to track redemptions in both Stripe and Impact, even when the visit comes directly.
The downside is that if a coupon is leaked or shared between users, the conversion would still be attributed to the affiliate. However, this is already mitigated with fraud detection and monitoring of leaked coupons.
Related Issues
Related Pull Requests
https://github.com/internxt/impact-radius-integration/pull/1
Checklist
- Changes have been tested locally.
- Unit tests have been written or updated as necessary.
- The code adheres to the repository's coding standards.
- Relevant documentation has been added or updated.
- No new warnings or errors have been introduced.
- SonarCloud issues have been reviewed and addressed.
- QA Passed