Skip to content

[MKT-1057]fix/no purchase event triggered when new user purchase - #2183

Merged
internxt-yu merged 4 commits into
masterfrom
fix/google-tracking-problem
Oct 5, 2026
Merged

internxt-yu merged 4 commits into
masterfrom
fix/google-tracking-problem

Conversation

@internxt-yu

@internxt-yu internxt-yu commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

We noticed that lot of purchase tracking event didn't arrive to Google Analytics and Google ads. After investigation i see that in the checkout page, the build-in Signup function clears all localStorageItems including which are needed for sending the purchase tracking event, so this event is not triggered with the following warning.
warning
The change was when in sigunup calls clear which remove allo localstorageItems, replace it with a clearExcept function that leaves the needed items for tracking, and remove them when the tracking events are sent.

And also when user already is logged in a account, if they want to change a account in purchase page, the onLogout also clears all the localstorage, so i included the change in onLogOut as well.

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

The test process was:

  1. Enter a checkout page, with the link
    https://fix-google-tracking-problem-i414.drive-web.pages.dev/checkout?planId=<price_id>&couponCode=<couponCode>, replacing the price_id and couponCode with one available in the Stripe.
  2. Open the inspect page of dev tool of the browser, and go to network, filter by "collect".
  3. Change to create account instead of log in and do the purchase with the new user, and complete the purchase.
  4. In the network section of inspect tool see if appears event purchase, the event name is in the payload, in parameter en.

Using preview mode in Google Tag Manager and Debug View in Google analytics we can see the signup and purchase event arriving:
new
event

Additional Notes

@internxt-yu internxt-yu self-assigned this Sep 25, 2026
@internxt-yu internxt-yu added the bug Something isn't working label Sep 25, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: a765433
Status: ✅  Deploy successful!
Preview URL: https://ed0e682a.drive-web.pages.dev
Branch Preview URL: https://fix-google-tracking-problem-i414.drive-web.pages.dev

View logs

@internxt-yu
internxt-yu marked this pull request as ready for review September 25, 2026 12:22
@internxt-yu
internxt-yu added this pull request to stack #2197 September 30, 2026 16:04
Comment thread src/services/auth.service.ts Outdated
Comment thread src/app/analytics/ga.service.ts
Comment thread src/views/Checkout/hooks/useAuthCheckout.test.ts Outdated
Comment thread src/services/local-storage.service.ts
@internxt-yu
internxt-yu force-pushed the fix/google-tracking-problem branch from e1f2ef6 to 1f9c198 Compare October 1, 2026 12:55
@internxt-yu
internxt-yu requested a review from CandelR October 1, 2026 13:34
@internxt-yu
internxt-yu force-pushed the fix/google-tracking-problem branch 2 times, most recently from 9097bf7 to e066f0c Compare October 2, 2026 09:52
@internxt-yu
internxt-yu force-pushed the fix/google-tracking-problem branch from e066f0c to a765433 Compare October 5, 2026 07:04
@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

@internxt-yu
internxt-yu merged commit cd7c2d4 into master Oct 5, 2026
11 checks passed
@internxt-yu
internxt-yu deleted the fix/google-tracking-problem branch October 5, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants