Moving tracking from the browser to your own server does not remove the privacy obligation; it moves the data flow out of sight of browser audits and puts a new set of credentials and endpoints in your estate. Server-side tagging and conversion APIs (CAPIs) let marketing teams forward events and customer identifiers from their own infrastructure to analytics and advertising platforms. Done well, they can reduce what third parties collect directly from visitors. Done badly, they forward data regardless of consent, send more fields than needed and depend on long-lived tokens nobody owns. This guide describes the data flow, how consent signals must travel with each event, how to protect CAPI credentials, how to minimise what is sent, and the legal context. It is for privacy, marketing technology and security teams who share responsibility for the same pipeline.
Where the guide gives platform examples it uses Google (server-side Tag Manager and the GA4 Measurement Protocol) and Meta (Conversions API), listed alphabetically; the same patterns apply to other platforms. The legal landscape is moving, so treat legal points as context and confirm with counsel.
Key takeaways
- Server-side is still a disclosure. The EDPB's Guidelines 2/2023 treat code that instructs a device to send information as within Article 5(3) of the ePrivacy Directive, and onward sharing from your server remains processing under data protection law.
- Consent must travel with the event. Attach the consent state to every event at collection and filter on the server before any vendor tag fires; do not assume every server-side tag honours it automatically.
- CAPI credentials are non-human identities. Access tokens and API secrets sit in server code and tag containers; inventory them, store them in a secrets manager, scope them and rotate them.
- Hashing is not anonymisation. Platforms require hashed emails and phone numbers for matching, and the FTC warns that hashes can be reversed or linked across databases.
- Govern the pipeline like an integration. A field allow-list per destination, change control on tags, logging of what was sent and periodic reconciliation against the consent records.
How server-side tagging works
In a typical deployment the website or app sends events to a tagging server you operate, usually on a first-party subdomain, instead of directly to each vendor. Google's documentation for server-side Tag Manager describes the parts: clients claim incoming requests and turn them into events, triggers examine each event, and tags, built in sandboxed JavaScript, forward data to destinations. Google strongly recommends installing the server on a first-party domain before sending production traffic, and states that "only you have access to the data in the server until you choose to send it elsewhere".
Data flow, described step by step
- Collection: a browser tag or app SDK captures an event (page view, add to basket, purchase, lead) together with identifiers such as a first-party cookie value, click ID, IP address and user agent, and the visitor's consent state.
- Transport to the tagging server: the event is sent to the first-party endpoint (for example via the
server_container_urlsetting in Google's tag). - Enrichment: the server may join the event with back-end data: order value, customer email or phone from the CRM, loyalty status.
- Filtering and transformation: clients and tags decide which fields go where, hash identifiers, drop or truncate fields.
- Onward transfer: tags call vendor collection endpoints, and separate back-end jobs may call conversion APIs directly with offline or CRM events.
- Response: the server returns a response to the device, which may set or refresh first-party cookies.
Every arrow in that flow is a disclosure point to record in your data map. See Data flow mapping for security and privacy and the Data Mapping and ROPA Guide.
| Aspect | Client-side tags | Server-side tagging and CAPIs |
|---|---|---|
| Who sees the visitor's request | Each vendor directly, with IP address and third-party cookies where allowed | Your server first; vendors receive only what you forward |
| Visibility to auditors and browser tools | Visible in network traces and consent scanners | Largely invisible; needs server logs and configuration review |
| Data available to send | What the page exposes | Page data plus any back-end data you choose to join |
| Credentials involved | Public tag IDs | Access tokens, API secrets, cloud service accounts |
| Main privacy risk | Over-collection by vendor scripts | Forwarding regardless of consent, enrichment beyond notice |
| Main security risk | Script supply chain on the page | Token leakage, open collection endpoints, server compromise |
Conversion APIs and data sharing
Conversion APIs accept events from servers and match them to platform users. Matching relies on customer information, which is why these integrations carry more personal data than a browser pixel.
- Google: the GA4 Measurement Protocol authenticates with an
api_secretcreated under Admin, Data streams, Measurement Protocol API secrets, and passed in the request query string with the measurement ID. Google's documentation says "It is crucial to keep this secret confidential" and not to expose it in client-side code. In server-side Tag Manager, Google product tags read consent parameters sent by the Google tag. - Meta: the Conversions API uses an access token generated in Events Manager by users with developer privileges, or for a system user in Business Settings, and passed as a parameter in each API call. Its customer information parameters require SHA-256 hashing for fields such as email (
em), phone (ph), names, date of birth, city, postcode and country after normalisation, whileclient_ip_address,client_user_agent,fbcandfbpare sent unhashed.
Two consequences follow. First, hashed identifiers remain personal data: the FTC's Office of Technology warns that hashes "can be reversed or used to link data across different databases". See Data Masking vs Anonymisation vs Pseudonymisation. Second, the receiving platform's role (processor, controller or joint controller) depends on its terms and how it uses the data, which should be settled in the contract and the record of processing. See the GDPR Article 28 Processor Guide.
Privacy risks and consent
The EDPB adopted version 2.0 of Guidelines 2/2023 on the technical scope of Article 5(3) on 7 October 2024. It treats tracking pixels and tracking information in URLs as within scope, and states that where distributed JavaScript instructs a device to send information, such access "clearly falls within the scope of Article 5(3)". It also notes that falling within scope does not automatically mean consent is required: the exemptions are assessed case by case. In the UK the equivalent rule sits in PECR; the ICO's guidance on storage and access technologies, finalised in 2026 after the Data (Use and Access) Act 2025, is summarised in the Cookie and Tracking Technology Compliance Guide.
Consent signal propagation
- Capture once: the consent platform records the visitor's choices per purpose (analytics, advertising, personalisation) and any opt-out signal such as Global Privacy Control. See the IAB TCF and Global Privacy Control Signals Guide.
- Attach to every event: include the consent state in each request to the tagging server. Google documents that its tag adds consent parameters to the HTTP request and that Google product tags in the server are consent-aware.
- Enforce on the server for every destination: add an explicit consent condition to each non-Google or custom tag and to back-end CAPI jobs. Google's documentation describes consent awareness for its own product tags only, so do not rely on other tags to filter themselves.
- Carry consent into offline events: CRM and offline conversion uploads must use the consent recorded for that person and purpose, not the website default.
- Log the decision: record, per forwarded event, the consent state and the destination, so you can prove nothing was sent without a lawful basis.
Data minimisation
- Field allow-list per destination: define which fields each vendor receives and drop everything else by default, including full URLs with query strings, page titles on sensitive pages and free-text form values.
- Sensitive pages and categories: do not forward events from health, finance, children's or other sensitive journeys to advertising destinations. The FTC's GoodRx and BetterHelp orders included bans on sharing health information for advertising.
- Truncate and generalise: send order value bands or product categories rather than product names where matching does not need them.
- Retention: keep tagging server logs only as long as needed for troubleshooting and evidence, and exclude raw identifiers from long-term logs.
See the Data Minimisation guide for the general method.
Security risks (tokens, endpoints)
| Asset | Risk | Control |
|---|---|---|
| CAPI access tokens and Measurement Protocol API secrets | Leaked in code repositories, tag container variables, client-side code or tickets; used to inject false events or read configuration | Store in a secrets manager, never in client code; inject at runtime; rotate on staff change and at least annually; secret scanning on repositories |
| System users and integration accounts | Over-privileged, created by an agency and never reviewed | Named owner, least privilege for the pixel or data stream only, quarterly access review, remove on agency exit |
| Tagging server endpoint | Accepts arbitrary events, used for data poisoning or as an open relay | Validate origin and schema, rate limit, reject unknown event names, web application firewall |
| Cloud runtime and service account | Compromise exposes all events and enrichment data | Dedicated project, minimal service account roles, patching, admin MFA, audit logging |
| Tag container | Unauthorised tag sends data to a new destination | Publishing approvals, container permissions and policies, change alerts |
| Enrichment lookups | Server queries CRM with broad credentials | Read-only, field-limited service account; no direct database credentials in tags |
These credentials are non-human identities and belong in the same inventory as other API keys. See the API Key Management Guide and, for container roles and service accounts, Google Tag Manager Security.
Governance controls
How to implement
- Inventory: list every server-side destination, CAPI integration, offline upload job and credential, with owner, purpose and data fields.
- Assess: run a DPIA where the flow involves enrichment, sensitive categories or large-scale profiling. See the DPIA Guide.
- Design the controls: consent conditions per tag, field allow-lists, hashing at the server, secrets manager integration and logging.
- Test in a preview environment: send test events in each consent state (no interaction, reject all, accept all, partial) and confirm from server logs which destinations received what.
- Pilot: enable one destination at a time for a share of traffic and reconcile vendor-reported event counts against consented events.
- Roll back cleanly: keep the previous container version published and ready; roll back by reverting the container or disabling the destination tag, never by removing consent checks.
- Operate: require a privacy review ticket for any new destination or field, and re-run consent-state tests after every container publish.
Decision guidance
- Server-side tagging or not: it suits organisations that can operate a cloud workload and want control over fields sent; small teams without that capacity may get better privacy outcomes from fewer, well-configured client-side tags behind a consent platform.
- Tag-based forwarding or direct CAPI integration: forwarding through a tag container keeps one control point; direct back-end integrations are harder to see and need the same consent and allow-list checks in code.
- Enrichment: join CRM data only where the privacy notice covers it and the consent or legal basis supports advertising use.
Detection and measurement
- Percentage of forwarded events carrying a recorded consent state (target 100%).
- Events forwarded to advertising destinations with advertising consent denied (target zero).
- Destinations with a documented field allow-list and named owner.
- Age of each CAPI token and API secret against your rotation policy.
- Variance between consented events and vendor-reported conversions.
- Unapproved container publishes or new destinations detected.
Litigation context
In the US, pixel and tracking cases are pursued through regulators and private litigation. The FTC has warned that pixel use that improperly discloses personal information may violate the FTC Act, the Health Breach Notification Rule and HIPAA rules. Private claims under wiretap statutes and the Video Privacy Protection Act have targeted tracking technologies; moving a tag server-side reduces content leakage but does not remove disclosure. The theories and risk by page type are covered in the Tracking Pixel Litigation Guide.
Common failure patterns
- Server-side used to bypass choices: events are forwarded to vendors whatever the consent state, which hides tracking from browser-based audits rather than reducing it.
- Tokens in tag variables: a CAPI token pasted into a container variable or repository is readable by everyone with container or code access.
- Full URLs forwarded: query strings and page paths carry search terms, health conditions or account IDs to advertising platforms.
- Agency-owned credentials: system users and secrets created by an agency stay active after the contract ends.
- Offline uploads outside consent: CRM-based conversion uploads include customers who refused advertising cookies.
Framework mapping
| Framework | Reference | Application |
|---|---|---|
| GDPR | Art. 5(1)(c), Art. 25, Art. 28, Art. 32 | Data minimisation, privacy by design in tag configuration, platform contracts, security of the pipeline |
| ePrivacy Directive | Art. 5(3) | Consent for access to and storage on the device, including scripted sending |
| NIST CSF 2.0 | ID.AM-03, ID.AM-07 | External data flows and data inventories maintained |
| NIST CSF 2.0 | PR.AA-05, PR.DS-02 | Least privilege for integrations; data in transit protected |
| NIST SP 800-53 Rev 5 | PT-2, PT-3, IA-5, AU-2 | Authority and purposes for processing PII, authenticator management, event logging |
Practitioner checklist
- Map every server-side destination and CAPI job with fields, purpose, owner and legal basis.
- Attach consent state to every event and enforce it on the server for every non-Google and custom tag and back-end job.
- Apply a default-deny field allow-list per destination and strip sensitive page data.
- Move all CAPI tokens and API secrets into a secrets manager with owners and a rotation schedule.
- Restrict system users and service accounts to the single pixel, stream or project they need.
- Validate, rate limit and log the tagging endpoint, and alert on new destinations.
- Test each consent state in preview after every container publish, and keep a rollback version.
- Reconcile consented events against vendor-reported conversions monthly.
Standards and references
- EDPB: Guidelines 2/2023 on Technical Scope of Art. 5(3) of ePrivacy Directive, version 2.0
- FTC Office of Technology: Lurking Beneath the Surface: Hidden Impacts of Pixel Tracking
- Google for Developers: An introduction to server-side tagging
- Google for Developers: Server-side tagging and consent mode
- Google for Developers: Send Measurement Protocol events to Google Analytics
- Meta for Developers: Conversions API, get started
- Meta for Developers: Conversions API customer information parameters
Related NHI Mgmt Group resources: Consent Management Guide: Cookies, CMPs and GPC · Cookie and Tracking Technology Compliance Guide · Tracking Pixel Litigation Guide · Client-Side Security Guide