Skip to main content

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 dataLayer and triggers:
    • Meta Pixel (browser-side, captures _fbp / _fbc).
    • GA4 โ†’ GTM Server (server-side forwarding).
    • Google Ads remarketing tag.

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_id as Pixel for dedup).
    • GA4 Measurement Protocol (first-party cookies, clean attribution).
    • Google Ads (Enhanced Conversions, GCLID matching).

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โ€‹

SubdomainTypePoints toRole
analytics.biosphereskincare.comCNAME<id>.stape.ioServer GTM endpoint
load.analytics.biosphereskincare.comCNAME<id>.stape.ioServes 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-sideWith server-side (Stape)
Pixel blocked by ad blockers โ†’ ~30% events lostFirst-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 lossCAPI sends from your server, bypasses ATT
Meta EMQ typically 4-5/10Meta EMQ typically 8-10/10
Degraded GA4 attributionClean GA4 attribution

Project phasingโ€‹

  1. Phase 1 (dev) โ€” implement the 10 core funnel events (PLP โ†’ purchase).
  2. Phase 2 (agency) โ€” GTM Web + Server + Stape configuration.
  3. QA โ€” cross-validation in staging (test scenarios).
  4. Go-live โ€” production deployment + 14-day monitoring (Meta EMQ, GAds conversions, GA4 events).
  5. Iteration โ€” add Phase 2 (acquisition) + Phase 3 (optional) events once core is stable.