Skip to content

Add gitlab_tier cookie for marketing use

Javier Garcia requested to merge 2875-eng-add-user-tier-to-marketing-cookie into master

What does this MR do and why?

Adds GitLab Tiers to gitlab_tier cookie. I am also updating the handbook with docs here: gitlab-com/content-sites/handbook!5117

In a previous MR, we added a gitlab_user cookie that would show true if a user is authenticated and in SaaS. If a user isn't authenticated, the cookie will not be present.

We want to keep that existing behavior and return user-identifiable tier information onto a new cookie whether they fall into Free, Premium, or Ultimate on SaaS only. If a user is in multiple namespaces, the cookie should reflect the unique namespace tiers that they are a part of (The maximum being an array holding value ["free", "premium", "ultimate"])

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot 2024-04-29 at 3.44.07 PM.png Screenshot 2024-05-14 at 4.24.06 PM.png

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

The gitlab_tier cookie is set up when a user logs into .com

  1. Locally, authenticate to .com GitLab as the root admin user and make sure you are simulating a SaaS instance.
  2. Create a few groups and change their plans under the admin -> groups -> edit that group. Change the plan for a few groups. That cookie should not be present.
  3. Sign out of GitLab in your local dev environment. Verify that the cookie is not present.
  4. Log in again to that same root user. You should see the correct tiers for the group's billing that you changed. Free/Premium/Ultimate should be reflected in that cookie.

Related to gitlab-com/marketing/digital-experience/buyer-experience#2875

Edited by Javier Garcia

Merge request reports