3 min read

How we measure conversion attribution without a cookie banner

How we forward contact-form and affiliate events to GA4 on top of Vercel Analytics, without requiring a cookie banner to measure basic product usage.

attributionanalyticsga4privacyutm

Vercel Analytics has been the site's measurement foundation since day one: zero-config, no cookie consent banner required, because it doesn't rely on a tracking cookie. That decision solves basic product telemetry with zero friction. But marketing needs more: knowing which campaign a lead came from, and how a click on an affiliate link turns into a contract. This is the layer we built on top, without giving up the cookie-free foundation.

The foundation doesn't change: Vercel Analytics stays cookie-free

Choosing Vercel Analytics over Plausible or plain Google Analytics was already a documented architecture decision: zero-config, no cookie banner required, because it doesn't depend on a tracking cookie to work. That foundation stays exactly the same. What we added doesn't replace it, it forwards specific events from the contact funnel and the affiliate program out to Google Analytics 4 (GA4), in the environments where that integration makes sense.

Forwarding to GA4 without breaking anything where it doesn't apply

GA4, the Google Ads tag (which reuses the same gtag as GA4), and the Meta Pixel are three optional integrations. Each one depends on an environment variable being set. If the variable doesn't exist, the corresponding pixel or script simply doesn't load: nothing breaks, no unresolved dependency. That matters in practice because none of these integrations make sense in local development, and the site keeps working exactly the same without them.

Capturing UTMs on the first page, not just on /contato

Before, campaign parameter capture (utm_source, utm_medium, utm_campaign) only happened on the contact page. We moved it to the first pageview of any route on the site, in any language. The main reason is the affiliate program: a visitor who arrives through a referral link (/r/[code]), browses to the homepage, and only heads to /contato later still keeps the correct campaign source, because it was captured the moment they landed on the site, not on the form. Alongside this change, utm_medium and utm_campaign are now persisted to the database (before, only part of the UTM columns existed).

Worth a distinction: the affiliate program's cl_ref cookie (which records which referral brought the visitor in) is a functional cookie, necessary for the affiliate program to operate, and isn't part of the analytics/marketing consent banner. Consent here is about third-party tracking for metrics, not about knowing who referred whom.

Why the cookie banner's acceptance rate never reaches GA4

There's a telemetry event called consent_choice that measures the site's cookie banner acceptance rate. The banner itself is about a separate convenience cookie, not about Vercel Analytics (which doesn't need consent to work). That event goes only to Vercel Analytics, on purpose, and is never forwarded to GA4. The reason is statistical: GA4 and the rest of the third-party tracking only load after a visitor accepts the banner. If consent_choice were forwarded to GA4, GA4 would only ever see records from people who had already accepted, and the "acceptance rate" metric would measure only those who accepted, never those who declined. Biased to the point of being useless.

What this layer solves

The practical result: we still don't need a consent banner to measure basic product usage, and we gained full conversion attribution (contact funnel and affiliates) on the integrations we chose to turn on, without their absence breaking anything in another environment. This is measurement architecture: an engineering decision about where each event should live and why, not a legal compliance opinion.

This attribution layer directly serves the affiliate program, where tracking the right origin of a referral decides whether the commission lands with the right affiliate. If your marketing funnel also needs attribution that survives a multi-page visit before it converts, tell us about your context.

Have a validated idea, process to automate, or product to build?

Get in touch