How it works without Apex
Use the same Apex workspace key across localhost, staging previews, TestFlight builds, and production instead of creating a second workspace. Name live domains and Beta preview hosts (and set Shopify store environments) under Settings -> Workspace -> Environments, and send x-apex-environment (or event-level environment) on Server Events API calls so labeled test traffic stays out of live revenue and ad sends.
How Apex does it for you
Apex inspects incoming web hostnames and mobile build signatures automatically, tags events as Production, Beta, Dev, or Unclassified, keeps Beta and Dev traffic out of production analytics, revenue, and ad-platform sends, and still meters every ingested environment transparently.
How to set this up in 5 steps
Keep one Apex workspace key across dev, staging, and production
Do not create a second workspace just to keep test clicks out. Using one key everywhere preserves identical event schemas, Key Events, and journeys across every stage.
Name live and Beta hosts and Shopify stores in Workspace -> Environments
Open Settings -> Workspace -> Environments to name your Production and Beta hosts and set Shopify store environments. localhost is detected as Dev automatically, and Apex never guesses staging or qa subdomains.
Verify automatic mobile build detection on iOS and Android
Apex Mobile SDK automatically classifies App Store and Google Play production builds as Production, TestFlight and Play internal tracks as Beta, and Xcode debug or sideloaded builds as Dev.
Pass x-apex-environment on every Server Events API deployment
Because server-to-server calls have no browser hostname, set the x-apex-environment header (production, beta, or dev; aliases staging, preview, test, development, localhost) or event-level environment, which wins over the header. Unlabeled server events land in Unclassified and still count as revenue.
Use testMode: true strictly for dry-run payloads, not free Dev volume
Events with testMode: true are stored under their environment, never create a person, skip live-activity flashes and default journeys, and still bill on the Events meter.
Why one key beats two workspaces
In older analytics tools, engineering teams create a separate "Staging" project and swap keys in environment variables. That creates two recurring headaches: every new Key Event, Segment, or Experiment has to be recreated twice, and one bad .env deployment accidentally points production at the staging key (or vice versa).
Apex uses one workspace key everywhere (localhost, Vercel/Netlify preview URLs, TestFlight builds, dev Shopify stores, and production). Instead of splitting workspaces, Apex separates traffic at ingest into four explicit environments: Production, Beta, Dev, and Unclassified.

How Production, Beta & Dev classify
| Surface | Production | Beta | Dev |
|---|---|---|---|
| Web (`apex-js`) | Hosts you name as Production | Vendor previews (*.vercel.app, *.netlify.app) + hosts you name as Beta | localhost, 127.0.0.1, *.local, *.test (automatic) |
| iOS & Android (`apex-mobile`) | App Store & Google Play production builds | TestFlight & Google Play internal tracks | Xcode debug & sideloaded dev builds |
| Shopify stores | Live store configured in Settings | Staging store configured in Settings | Dev store configured in Settings |
Hosts you list under Settings -> Workspace -> Environments land in Production or Beta, and you configure Shopify stores in that same screen (localhost is automatic Dev; Apex never guesses staging or qa subdomains).
Billing transparency: Dev and Beta events are stored under their environment and kept out of production analytics, revenue, and ad-platform sends, and they still count toward the Events meter. Environment does not change the price, and Unclassified events bill too.

Server events: label every deployment
Browser snippets and mobile SDKs automatically supply hostnames and build signatures. Backend workers calling the Server Events API do not have a browser URL, so label every deployment explicitly:
- Per deployment (`x-apex-environment` header): Pass
production,beta(aliasesstaging,preview), ordev(aliasestest,development,localhost). - Per event (`environment` field): Overrides the header when set on an individual event.
- Typo safety: A misspelled environment value returns
400 invalid_environment(or comes back indata.errors) and never silently counts as Production. - Do not omit the label on staging backends: An unlabeled server event lands in Unclassified (hidden when the dashboard is filtered to Production), yet it still counts as revenue and can be sent to your ad platforms. Always set
x-apex-environment: betaordevon non-production servers so staging purchases stay out of live revenue. - The `"testMode": true` rule:
"testMode": trueis a dry-run flag for practice payloads. Those events are stored under their environment, never create a person, skip live-activity flashes and default journeys, and still bill as events (it is not a free Dev or Beta bucket).
What this costs on Apex
Live Apex pricing · Pay-as-you-go
Estimated Apex cost for Engineering team running 25,000 monthly events across localhost, preview, and production
$0 / month
Covered by monthly free allowances.
| Apex meter / schedule | Scenario volume | Free allowance / basis | Rate | Apex cost |
|---|---|---|---|---|
Events Ingested web, mobile, and server events (all environments) (Dev, Beta, Unclassified, and Production events all count toward the Events meter) | 25,000 / mo | 1M / month | $5 per 100K events | $0 |
Attribution Attributed mobile conversions (Attributed conversions from ads, tagged campaigns, and Apex Links; untagged organic counts as events) | 1,000 / mo | 1.5K / month | $0.05 per attributed conversion | $0 |
Dev and Beta events are stored under their environment and kept out of production analytics, revenue, and ad-platform sends. Every ingested environment still counts toward the Events meter. History: 13 months no card, 3 years with card, 7 years once you've paid an invoice. Live pricing.
Third-party and campaign costs (not paid to Apex)
| Expense | Typical range | Notes |
|---|---|---|
| Second staging analytics workspace | $0/mo | No duplicate workspace subscription or schema syncing required |
