How it works without Apex
Supabase and Firebase know a user from sign-up on. The visits before that happen to an anonymous visitor. Call identify in the browser when the session starts, with the visitor cookie. Apex then joins those earlier visits to the user.
How Apex does it for you
The Apex snippet gives each browser a visitor cookie. When your app calls identify with that cookie, Apex joins the earlier visits from that browser to the user. A server-only sign-up can't do this.
How to set this up in 5 steps
Add the Apex snippet
Each browser gets a visitor cookie called
apex_vid.Call identify when the session starts
In onAuthStateChange or onAuthStateChanged, pass the user id, email and the
apex_vidcookie.Keep the server sign-up event
Your database webhook or cloud function records each sign-up from the server.
Set the visitor cookie from your server
On Next.js, the
@apex-inc/nextmiddleware setsapex_vidfrom your server, so Safari doesn't cut it to 7 days.Check a test user
Sign in as a test user and look for the earlier visits on their record.
Your users table starts at sign-up
Supabase and Firebase know a user from the moment they sign up. Everything before that, the blog post they found on Google and the newsletter link they clicked, happened to an anonymous visitor.
Apex can join those visits to the user. It takes one call from the browser when the user signs in.
One browser call when the user signs in
Put the Apex snippet on your site and app. Each visit gets a visitor cookie,
apex_vid.Call identify in the browser when the session starts. Use
onAuthStateChangein Supabase oronAuthStateChangedin Firebase. Pass the user id, the email and theapex_vidcookie. See Supabase and Firebase.Keep the server sign-up event too. The database webhook or cloud function records each sign-up from your server. It doesn't know the browser, so it can't join visits on its own.
Add a first-party domain for Safari. Load the snippet from your own subdomain so the visitor cookie lasts 365 days instead of 7. See First-party domain.
Your server knows the email. Only the browser knows which visits came before. The browser call sends both, so the visits join the user.
Worked example: one contract app's new user (illustrative)
Quillmark is a contract review app for small law firms. Every number is an illustrative assumption.
- Aisha Rahman reads a blog post she found on Google, 12 days before she signs up.
- She clicks a newsletter link 3 days before, then types the address and signs up.
- In Chrome, with the browser call in place, all three visits join her record.
- In Safari without a first-party domain, the cookie from the blog visit is gone after 7 days, so that visit stays anonymous.
- With only the server sign-up event, none of the visits join her.
What this costs to run
The table reads live from Apex's published rate card. Site visits, the identify call and the sign-up event all count as events.
Live Apex pricing · Pay-as-you-go
Estimated Apex cost for One web app on Supabase or Firebase · earlier visits joined to each sign-up
$0 / month
Fully inside Apex's free monthly allowances (resets every calendar month).
| Apex meter / schedule | Scenario volume | Free allowance / basis | Rate | Apex cost |
|---|---|---|---|---|
Events 9,000 site visitors × 4 events (36,000) + 300 sign-ups = 36,300 events | 36,300 / mo | 1M / month | $5 per 100K events | $0 |
Supabase and Firebase need no Apex connector. The identify call and the sign-up event count as events like any other. Individual event history stays queryable for 13 months without a card, 3 years with a card on file, and 7 years once you've paid an invoice. See the live pricing page.
Third-party and campaign costs (not paid to Apex)
| Expense | Typical range | Notes |
|---|---|---|
| Supabase or Firebase | Your plan | One small edge or cloud function for the server sign-up event. |
Limits worth knowing before you start
One browser at a time. Visits join only from the browser the user signs in on. A visit from their phone joins when they sign in there too.
Safari's 7-day cookie. Without a first-party domain, the cookie ends 7 days after it is set, even if they come back in between.
Server-only sign-ups don't join visits. A sign-up sent only from your server, with no visitor id, leaves earlier visits anonymous.
A visitor who says no to tracking. The browser call then sends the email only, with no visitor id, so earlier visits stay anonymous.
Cleared cookies start over. Private windows and cleared cookies get a new visitor id.

