Architecture
Full data flowโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Browser (biosphereskincare.com) โ
โ โ
โ 1. GTM snippet in <head> + <body> โ
โ 2. window.dataLayer.push({event:'add_to_cart', ...}) โโโโโ โ โ YOUR JOB
โ โ โ
โ โผ โ
โ 3. GTM Web (client-side container) โ
โ โโ Meta Pixel: fbq('track', 'AddToCart', {...}) โ
โ โโ Forwards to GTM Server โโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GTM Server-Side (analytics.biosphereskincare.com) โ
โ โ hosted on Stape โ
โ 4. Enrichment (IP, UA, _fbp, _fbc, SHA-256 PII) โ
โ โ โ
โ โโโโบ Meta Conversions API (shared event_id = dedup) โ
โ โโโโบ GA4 Measurement Protocol โ
โ โโโโบ Google Ads Enhanced Conversions / Conversion API โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Componentsโ
1. Biosphere siteโ
- Stack: custom (your code).
- Responsibility: push the right data at the right moment to
window.dataLayer.
2. GTM Web (served from load.analytics.biosphereskincare.com)โ
- Client-side GTM container served first-party (bypasses ad blockers).
- Reads
dataLayerand triggers:- Meta Pixel (browser-side, captures
_fbp/_fbc). - GA4 โ GTM Server (server-side forwarding).
- Google Ads remarketing tag.
- Meta Pixel (browser-side, captures
3. GTM Server (analytics.biosphereskincare.com)โ
- Server-side GTM container hosted on Stape.
- Receives hits from GTM Web.
- Enriches (server IP, User-Agent, SHA-256 hash of PII).
- Fans out to:
- Meta CAPI (with same
event_idas Pixel for dedup). - GA4 Measurement Protocol (first-party cookies, clean attribution).
- Google Ads (Enhanced Conversions, GCLID matching).
- Meta CAPI (with same
4. Stapeโ
- Hosting platform for server-side GTM.
- Manages SSL, subdomain mapping, power-ups (cookie keeper, geo headers, etc.).
Pixel โ CAPI deduplicationโ
Meta would otherwise count a Purchase twice (Pixel browser-side + CAPI server-side). To dedupe, both sides must share the same event_id.
โ You don't have to do anything: GTM generates a unique event_id on the client and propagates it to the server. As long as your purchase carries a unique transaction_id, dedup works.
Subdomains & CNAMEsโ
| Subdomain | Type | Points to | Role |
|---|---|---|---|
analytics.biosphereskincare.com | CNAME | <id>.stape.io | Server GTM endpoint |
load.analytics.biosphereskincare.com | CNAME | <id>.stape.io | Serves gtm.js first-party |
The exact CNAME targets will be provided by the agency once the Stape container is created.
Why server-side?โ
| Without server-side | With server-side (Stape) |
|---|---|
| Pixel blocked by ad blockers โ ~30% events lost | First-party endpoint โ only 2-5% lost |
_fbp cookie set by Meta โ max 7 days on Safari (ITP) | Cookie set by your domain โ full lifetime |
| iOS 14+ ATT: massive signal loss | CAPI sends from your server, bypasses ATT |
| Meta EMQ typically 4-5/10 | Meta EMQ typically 8-10/10 |
| Degraded GA4 attribution | Clean GA4 attribution |
Project phasingโ
- Phase 1 (dev) โ implement the 10 core funnel events (PLP โ purchase).
- Phase 2 (agency) โ GTM Web + Server + Stape configuration.
- QA โ cross-validation in staging (test scenarios).
- Go-live โ production deployment + 14-day monitoring (Meta EMQ, GAds conversions, GA4 events).
- Iteration โ add Phase 2 (acquisition) + Phase 3 (optional) events once core is stable.