Skip to content

Add sales call to action when onboarding without purchase

Elwyn Benson requested to merge 438049-product-analytics-sales-cta into master

What does this MR do and why?

Add sales call to action when onboarding without purchase

When onboarding product analytics to a GitLab-managed analytics provider, the group must have purchased the product analytics add-on. We now show a call-to-action to contact sales when a customer tries to onboard before purchasing.

Scenarios

Self managed GitLab instance

Previous onboarding flow shows. product_analytics_billing feature flag not used, no mention of GitLab managed provider, no sales CTA.

gitlab.com

:product_analytics_billing enabled for group? Purchased PA addon? Expected:
false impossible to purchase when FF disabled? Previous onboarding flow shows, as per above
true true Setup using GitLab managed provider button available
true false Contact sales team button shows

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
image image (Add-on has been purchased, same onboarding view displayed)
image image (Add-on has NOT been purchased, sales CTA shows)

How to set up and validate locally

  1. Follow these instructions to setup Product Analytics in GDK.
  2. echo "Feature.enable(:product_analytics_billing)" | gdk rails c and run as .com
  3. View the onboarding page for a new project at Project > Analytics > Analytics dashboards > Set Up [product analytics].
  4. Verify "Contact our sales team" button shows
  5. Add a product analytics addon purchase to the group:
  • Using an admin API token, add 3+ of the product_analytics add-ons to the namespace using the REST API.
api deets
POST /api/v4/namespaces/{GROUP NAME}/subscription_add_on_purchase/product_analytics

{"quantity":"3","expires_on":"2025-01-01","purchase_xid":"ANY STRING"}

Or, from your browser console while logged in as an admin, if you prefer:

fetch("http://gdk.test:3000/api/v4/namespaces/REPLACEME_YOUR_GROUP_NAME/subscription_add_on_purchase/product_analytics", {
  "headers": {
    "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
    "cache-control": "no-cache",
    "pragma": "no-cache",
    "x-csrf-token": "REPLACEME_WITH_ACTUAL_CSRF_TOKEN_FROM_ANOTHER_REQUEST",
    "x-requested-with": "XMLHttpRequest"
  },
  "referrer": "http://gdk.test:3000",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": JSON.stringify({"quantity":"3","expires_on":"2025-01-01","purchase_xid":"wow-so-cool"}),
  "method": "POST",
  "mode": "cors",
  "credentials": "include"
}).then(console.log).then(r => r.json()).then(console.log).catch(console.error);
  1. Visit the onboarding page again, and verify "Setup GitLab-managed provider" button is now available

Related to #438049

Edited by Elwyn Benson

Merge request reports