Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add premium paywall conversion telemetry - #28425

Merged
jeremyruppel merged 1 commit into
mainfrom
dfraley/premium-paywall-telemetry
Aug 21, 2026
Merged

feat: add premium paywall conversion telemetry#28425
jeremyruppel merged 1 commit into
mainfrom
dfraley/premium-paywall-telemetry

Conversation

@david-fraley

@david-fraley david-fraley commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

TLDR: When someone using free Coder taps a "Start trial for free" button, we now write down which page they tapped it on, and whether they went on to actually start the trial. That tells us which locked features make people want Premium.

Brief summary

  • Records two things: the button being clicked, and a trial actually being started.
  • Each click gets a random ID that travels with the person to the trial form, so we can tell who finished from who walked away.
  • Records a short label for the page (like appearance or audit_log), never the web address, so no customer names are collected.

#28226 added the trial form and has since merged, so this now targets main.

Description

Today the "Start trial for free" button just moves you to the Premium page and nothing is recorded, so there is no way to know which feature convinced someone.

This adds two events:

Event Happens when
cta_click Someone clicks "Start trial for free"
trial_signup A trial licence is actually issued

The click generates a random ID. It rides along to the trial form and gets saved on the signup, so a click and a signup can be matched up later. Clicks with no matching signup are the people who gave up. Trials started without a paywall (for example straight from the sidebar) are labelled direct, so "no label" never gets confused with "broken".

A few small choices worth knowing:

  • The ID is kept in browser session storage, not in the web address, so the URL stays clean. It expires after 30 minutes.
  • The trial signup event is recorded by the server, not the browser, so nobody can fake a signup.
  • The browser cannot say which kind of event it is sending. It can only report a click; the server labels it.
  • Only people allowed to start a trial are counted. The server rejects the rest, which matters because a few paywalls show their button to everyone.
  • Nothing is recorded at all when telemetry is turned off.

There is deliberately no "paywall was shown" event. Every admin page visit would report one, which is a lot of noise for little insight.

Every paywall in the Premium Copy Updates table has a label. The rows that do not are badges and alerts with no button to click.

Proof

Ran a local Coder with no licence and clicked the paywall button on the Appearance page.

What the browser sent, and the reply:

POST /api/v2/deployment/premium-funnel-events  ->  204 No Content
{"id":"92d96afa-f975-4789-b8a7-b1fd19d4df85","source":"appearance","variant":"premium"}

What the browser saved for the trial form, same ID:

{"id":"92d96afa-f975-4789-b8a7-b1fd19d4df85","source":"appearance","createdAt":1787268520857}

The click then landed on the Premium page with the trial form. Screenshots of the network panel, the saved value, and the Premium page are attached below. The form itself was not submitted, since that would contact the real licence server.

Testing

  • Backend tests: a click is recorded with the server's own label, an unknown page label is refused, and a normal member is refused.
  • Storybook tests: button clicked and ID saved on all three paywall styles, plus the case where the viewer only sees guidance text and has nothing to click.
  • Unit tests for the saved ID: expiry, bad data, unknown page label, and the direct fallback.
  • make gen is clean, and lint, types, and formatting pass.

Two stories fail on main today and fail the same way here: ExternalAuthSettingsPageView > Page and PremiumPageView > No License. Neither file is touched by this branch; both were verified failing on main with this branch checked out elsewhere.

Follow-up

coder/coder-telemetry-server#45 saves these events for reporting. It merges after this one.

Plan and decisions

Goal: find out which Premium paywall drives trial signups, and tell abandons apart from completions.

Options considered and dropped:

  1. Put ?from=appearance in the URL. Rejected: messy for users.
  2. Use router state. Rejected: lost if the page is refreshed.
  3. Let the browser report the signup. Rejected: it could be faked or lost during the redirect.
  4. Work out the page from the URL. Rejected: URLs contain organization and template names.
  5. Report every paywall impression. Rejected: one event per admin page visit is noise, and the click is the signal.
  6. Separate event types and tables. Rejected: makes the matching query harder for no gain.

Event shape:

type PremiumFunnelEvent struct {
	ID            uuid.UUID // event ID; for a click this is also the matching ID
	EventType     string    // cta_click | trial_signup, set by the server
	Source        string    // appearance, audit_log, ..., direct
	Variant       string    // which paywall design was shown
	AttributionID uuid.UUID // the click this signup came from
	UserID        uuid.UUID
	CreatedAt     time.Time
}

Where the code lives: nothing under components/ imports from modules/, so the paywall components stay presentational and only gain an onCTAClick prop. New wrappers in modules/paywall/ own the reporting, one per paywall style, each taking a fixed source.

Self-review: the frontend-review skill caught that reading permissions inside the wrapper forced an auth context into presentational page views, which broke their stories. Every call site already passes canViewPremium={permissions.viewAllLicenses} and the button only renders when that is true, so the wrapper no longer reads permissions and the server stays the gate. It also flagged one unattributed paywall on the Security page, now wired up as browser_only.

Generated with Coder Agents on behalf of @david-fraley

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

Comment thread codersdk/premiumfunnel.go Outdated
Comment thread site/src/modules/paywall/usePremiumFunnelTelemetry.ts Outdated
@david-fraley
david-fraley force-pushed the dfraley/premium-paywall-telemetry branch 2 times, most recently from d52d44e to 3cdb6d1 Compare August 20, 2026 23:46
Comment thread site/src/modules/paywall/usePremiumFunnelTelemetry.ts Outdated
@david-fraley
david-fraley force-pushed the dfraley/premium-paywall-telemetry branch from 3cdb6d1 to 3f37813 Compare August 21, 2026 00:07
Comment thread site/src/components/Paywall/PaywallAIGovernance.tsx Outdated
Comment thread site/src/modules/paywall/premiumFunnelAttribution.ts Outdated
Comment thread site/src/api/typesGenerated.ts
@david-fraley
david-fraley force-pushed the dfraley/premium-paywall-telemetry branch from 3f37813 to c4c2042 Compare August 21, 2026 00:27
@david-fraley
david-fraley force-pushed the dfraley/premium-paywall-telemetry branch from c4c2042 to c378378 Compare August 21, 2026 00:50
@david-fraley
david-fraley marked this pull request as ready for review August 21, 2026 13:39
stack merge was automatically disabled August 21, 2026 13:52

Pull Request is not mergeable

stack merge was automatically disabled August 21, 2026 13:52

Pull Request is not mergeable

stack merge was automatically disabled August 21, 2026 13:54

Pull Request is not mergeable

Base automatically changed from feat/DEVEX-752-premium-page to main August 21, 2026 13:54
Report which premium paywall a user clicked through, and report the
trial signups that follow, so the funnel from paywall to trial can be
measured.

Clicks are reported by the browser and carry a UUID that is stored in
sessionStorage. The premium page sends that UUID with the trial request,
and coderd emits the trial_signup event itself once a license is
actually issued, so a conversion cannot be forged by a client. Joining
signups back to clicks on the attribution ID separates completed trials
from abandoned ones, and trials started without a paywall report the
"direct" source.

Sources are a fixed enum rather than page URLs because paywall routes
embed organization and template names.
@david-fraley
david-fraley force-pushed the dfraley/premium-paywall-telemetry branch from 1a7fc64 to cad94f1 Compare August 21, 2026 14:13
@jeremyruppel
jeremyruppel merged commit a2afb45 into main Aug 21, 2026
35 checks passed
@jeremyruppel
jeremyruppel deleted the dfraley/premium-paywall-telemetry branch August 21, 2026 14:31
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants