github internxt/drive-web v1.0.744

4 hours ago

Description

Implemented logic to distinguish between new sales and returning customers during checkout to optimize Impact conversion tracking.

Key Changes:

  • checkIsFirstPurchase: Added a new function in useUserPayment.ts that retrieves the user's invoice history to determine if the purchase is their first. The isFirstPurchase state is now stored in localStorage during the payment process for retrieval on the success page.

  • Impact Service: Updated trackPaymentConversion to ensure conversion events are only sent to Impact if:
    The purchase is confirmed as the user's first.

Related Issues

Related Pull Requests

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

Testing Process

Simulated the checkout flow in development environment using new and existing user accounts.

Scenarios Tested:

  • New Customer (First Purchase):
    - Step: Logged in with a user who has no previous invoice history.
    - Observed:
    - The invoices API call returned an empty array.
    - isFirstPurchase was correctly set to true in localStorage after clicking "Pay".

  • Returning Customer (Repeat Purchase):
    - Step: Logged in with a user who already has a paid invoice.
    - Observed:
    - The invoices API call returned at least one record.
    - isFirstPurchase was correctly set to false in localStorage.

Additional Notes

Video attached of the testing process attached on the task

Don't miss a new drive-web release

NewReleases is sending notifications on new releases.