[Part 2] Track upgrade button clicks on group billing page
What does this MR do and why?
continuation of !211734 (merged)
This MR implements cart abandonment tracking for the billing page upgrade buttons. It adds client-side tracking that fires a POST request whenever users click on the "Upgrade to Premium" or "Upgrade to Ultimate" buttons.
This enables cart abandonment event tracking for the billing/subscription flow. When users click an upgrade button but don't complete the purchase, GitLab can:
- Track which users showed purchase intent but didn't convert
- Send follow-up communications to encourage completion
- Improve conversion rates through targeted interventions
The tracking is implemented as a fire-and-forget mechanism (silently fails on error) to ensure it doesn't interfere with the user's upgrade journey - even if the tracking request fails, users can still proceed to the upgrade page.
References
#577574
Screenshots or screen recordings
There are no UI changes
How to set up and validate locally
Setup
- Make sure simulate SAAS is enabled.
- Ensure you have a group with owner permissions in your GDK
- Navigate to your group's billing page:
http://gdk.test:3000/groups/<your-group>/-/billings
Validation
- Open your browser's Developer Tools (Network tab)
- On the billing page, click either "Upgrade to Premium" or "Upgrade to Ultimate" button
- Verify in the Network tab:
- A POST request is made to
/-/gitlab_subscriptions/hand_raise_leads/track_cart_abandonment?namespace_id=<namespace_id>&plan=<plan_name> - The request returns 204 No Content
- Navigation to customers portal happens at the same time as tracking call
- A POST request is made to
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #577574