Skip to content
Guides · Privacy

GDPR-compliant ad tracking: consent, Consent Mode and Conversion APIs

When ad tracking needs consent in the EU, how to set up Consent Mode v2, and what server-side tracking, hashing and a DPA do and do not change legally.

Daniel Kalcher13 min read

This guide is for anyone running ads on Meta, Google, TikTok or LinkedIn who wants to measure conversions from EU visitors without breaking the GDPR. You will learn which legal basis you need for what, how to set up Consent Mode v2 properly, what server-side tracking, cookieless measurement and hashing really achieve, and what belongs in your privacy policy.

This is not legal advice. The groundwork comes from the legal texts, court rulings and regulators' guidance; for your specific setup, talk to your privacy adviser or data protection officer.

Two laws, two questions

In the EU, ad tracking is judged against two sets of rules, and you need to check both separately.

QuestionRuleTypical basis for ad tracking
May I store or read information in the browser?Art. 5(3) ePrivacy Directive, via national lawConsent
May I process and share the personal data I collect?Art. 6 GDPRConsent, rarely legitimate interests

The ePrivacy rule allows storing or reading information on a user's device only with consent. The exceptions are narrow: transmitting a communication, or what is strictly necessary to deliver a service the user explicitly asked for. Each member state has written this into its own law. In Germany it is § 25 TDDDG, and the German regulators do not treat ad measurement as exempt across the board (DSK guidance on digital services, in German). The rule applies whether or not the information is personal data, as the Court of Justice confirmed in Planet49.

The GDPR then covers everything that follows: any processing of personal data needs a legal basis under Art. 6 (Regulation (EU) 2016/679). Building a picture of a visitor across clicks, pages and conversions means consent in practice. Relying on legitimate interests for advertising tracking is a high-risk choice.

You share responsibility

When you embed a pixel, you are jointly responsible with the platform for collecting the data and passing it on. The Court of Justice decided this for an embedded social plugin in Fashion ID. So collecting consent is your job, not Meta's or Google's.

Contracts add a second layer: Google's EU user consent policy requires valid consent for cookies and for personalized ads, with records kept and an easy way to withdraw.

What counts as device access

Not just cookies. localStorage, loading a pixel, fingerprinting and reading identifiers all count. The European Data Protection Board's Guidelines 2/2023 explicitly include tracking pixels and tracking links, and treat IP-based tracking as covered in some cases too. Switching technology does not make consent unnecessary.

A banner on its own is not enough. Check these points:

  1. Ask first: No advertising pixel or tag loads before the visitor has agreed.
  2. Active opt-in: Pre-ticked boxes are not consent (Planet49, Recital 32 GDPR).
  3. Refusing is as easy as accepting: Put a "Reject" button on the same layer as "Accept".
  4. Be specific: Purpose, vendor, how long cookies last, and whether third parties get access. Google also requires you to name every party that receives the data.
  5. Separate purposes: Analytics and advertising are different purposes and need their own categories.
  6. Allow withdrawal: Any time, without hoops, for example through a permanent link in the footer.
  7. Keep proof: Record who agreed to what and when. Art. 7 GDPR and Google both expect this.

Consent Mode is neither a banner nor a legal basis. It passes the choice from your banner to Google's tags, which then adjust how they behave (Google Ads Help). Version 2 has four signals for ads and analytics (reference):

SignalControlsWhen denied
ad_storageAdvertising cookies in the browserNo new ad cookies
analytics_storageAnalytics cookiesNo analytics cookies
ad_user_dataSending user data to Google for adsNo enhanced conversions, cookieless conversion pings
ad_personalizationPersonalized ads, remarketingNo personalization

For visitors in the EEA, Google expects these signals; without them you lose measurement and remarketing (EEA update).

Basic vs advanced

BasicAdvanced
Tags loadonly after consentimmediately, defaulting to "denied"
Without consentnothing reaches Googlecookieless pings with timestamp, user agent, referrer
Modelinggeneral modelmodel specific to your account

Advanced mode gives you more modeled conversions. But the tag loads before any choice is made, and the browser sends requests to Google. Whether that is compatible with the ePrivacy rule without consent is disputed. If you want to stay on the safe side, use basic mode. Make this a deliberate decision with your privacy adviser, not whatever your banner tool ships with.

  1. Set defaults: Call gtag('consent', 'default', …) with all four signals set to denied before any config or event command, ideally limited to the regions where you show the banner (Google's guide).
  2. Wait for the banner: wait_for_update (500 ms, for example) gives asynchronous banners time to report the choice.
  3. Update on interaction: As soon as the visitor clicks, send gtag('consent', 'update', …), store the choice and set it again on every following page.
  4. Redact click IDs: ads_data_redaction strips click IDs from requests while ad_storage is denied.
  5. Test: In Tag Assistant, check that no ad cookie is set before consent and that withdrawal sets every signal back to denied.

The signal also belongs on conversions you upload through an API. Google recommends sending the ad_user_data field with offline conversions and enhanced conversions for leads, because without it they may not be attributable (Google Ads API).

Server-side tracking: what changes, what doesn't

With server-side tracking, it is your server, not the pixel in the browser, that sends the conversion to the platform through a Conversion API. Technically that is a clear win. Legally it is often overrated.

ClaimTrue?
Ad blockers and ITP cost you less dataYes, the hop to the platform no longer runs through the browser
You control which fields leaveYes, you can hold back IP, user agent or contact details
You no longer need a bannerNo. If your script reads IDs or cookies in the browser, the ePrivacy rule applies
Sending data to Meta is not a transferNo. A hashed email, IP and click ID are personal data
Hosted in the EU means GDPR-compliantNo. Location answers the third-country question, not the legal basis

So server-side tracking does not replace consent. It is a better pipe for data you are allowed to collect. For the technical side of connecting the APIs, see the guide on how to set up a Conversion API.

Leads from your CRM

Sales conversions are a special case: booked calls, closed deals, revenue. People usually hand over their details in a form so you can contact them. Sending those details, hashed, to Meta or Google is a further purpose that needs its own legal basis. Many advertisers ask for explicit consent for this in the form or banner and name the purpose in the privacy policy.

Cookieless options

"Cookieless" does not mean "no legal basis needed". It only means nothing is stored in the browser. The GDPR still applies as soon as an IP address, or a value derived from one, is involved.

OptionStored in browserWhat you getCatch
Aggregate counts, no IDsnothingVisits and conversions per channelNo link to a person
Daily server-side ID (hash of IP and user agent)nothingOne day's visits joined upPersonal data; the EDPB sees some IP tracking under Art. 5(3)
Click ID from the URL (gclid, fbclid)nothing, unless you store itLink to the adThe EDPB sees URL tracking under Art. 5(3) too
Platform modelingnothingEstimate of missing conversionsEstimates only, no individual records

For reach and channel comparison, cookieless measurement is often enough. To report individual leads back to the ad platforms, you will usually still need consent.

Hashing: pseudonymous, not anonymous

Conversion APIs expect contact details as SHA-256 hashes. Normalize first: for email, trim spaces and lowercase; for phone numbers, digits only with the country code (Meta for Developers).

Say a lead types " Jane.Doe@Example.com ". It becomes jane.doe@example.com and then the hash 86e0b9e5…cc6133d. Meta computes the same hash from its own user accounts and finds the person. That is precisely why the hash is pseudonymous rather than anonymous data, and why the GDPR applies to it just as it does to the email itself (Recital 26).

IP address, user agent and Meta's fbc and fbp cookies are not hashed; Meta requires them in plain text. So check for every tool whether these fields are also sent without consent.

DPAs, roles and transfers

Keep three roles apart:

  • Your tracking tool processes data on your behalf. You need a DPA under Art. 28 GDPR, a list of sub-processors and the technical and organizational measures.
  • The ad platforms also use the data for their own purposes and usually see themselves as independent or joint controllers. They set this out in their own terms; read which role they claim and reflect it in your privacy policy.
  • Third countries: If data goes to the US, check whether the recipient is certified under the EU-US Data Privacy Framework. The adequacy decision only covers certified companies.

Data minimization in practice

Art. 5 GDPR says to process only as much data as the purpose requires. For ad tracking that means:

  1. Send only events you optimize for: Lead, booked call, deal. No scroll tracking to Meta.
  2. Keep contact details out of URLs: Thank-you pages like /thanks?email=… end up in logs, analytics and pixel requests.
  3. Review fields per platform: Hold back whatever a platform does not need.
  4. Set retention periods: Delete IP addresses and raw data after a fixed period, and immediately on withdrawal.
  5. Limit access: Contact details visible only to the roles that need them.

What belongs in the privacy policy

Art. 13 GDPR lists what you have to tell people. For ad tracking, cover each tool with:

ItemExample
Vendor and roleMeta Platforms Ireland, joint controller for collection
PurposeMeasuring and optimizing ad campaigns
DataClick ID, IP address, user agent, hashed email and phone
Legal basisArt. 6(1)(a) GDPR plus the national ePrivacy provision
RetentionCookie lifetime, deletion period for raw data
Recipients and transfersPlatform, tracking provider, US under the Data Privacy Framework
WithdrawalLink to the cookie settings

Don't forget transfers that skip the browser: conversions sent through an API and uploads from your CRM belong in the text as much as the pixel does.

Common problems and solutions

ProblemCauseSolution
Pixel fires before consentPixel hard-coded in the template instead of controlled by the bannerLoad pixels only through the banner or a tag manager with a consent condition
Google reports missing consent signalsConsent Mode missing, or set up without ad_user_dataSet defaults before all tags and update all four signals
Conversions drop after the banner goes liveMany visitors refuse, basic mode sends no pingsPlan for the drop; send server-side what you collected with consent
Conversion API sends IP without consentThe tool's default settingCheck per destination what leaves without consent and switch it off
Withdrawal only works on the next pageBanner does not tell the tags about the changeSend the update command on withdrawal and stop pixels for the rest of the page
Email address in the thank-you page URLForm passes fields via GETUse POST or strip the parameters before tracking
Privacy policy only mentions the pixelServer-side transfers forgottenAdd Conversion APIs and CRM uploads as separate processing

How to do it with TSO

TSO does not answer the legal question for you, but it makes visible and configurable what happens before and after consent.

  • Three privacy modes per project: "Without consent" (you are responsible for the legal basis), "Cookieless until consent" with a daily ID on the server, and "Consent only", where nothing is sent or stored before the visitor agrees. New projects start in "Without consent", so choose deliberately.
  • Banner detection: Google Consent Mode v2, Cookiebot, OneTrust, Usercentrics, Borlabs and Complianz are detected. In "Cookieless until consent" and "Consent only", pixels loaded by TSO only start once the visitor consents, and a withdrawal is passed on to the pixel. In "Without consent", TSO does not ask and loads them right away.
  • Honest about the default: Out of the box, IP address and user agent go to the Conversion APIs even without consent, and the location derived from the IP always goes along. You can switch IP and user agent off per destination, and send events to a destination only with consent.
  • Hashing on sending: TSO stores contact details in plain text and normalizes and hashes them with SHA-256 only when sending them to a platform.
  • Retention: IP address and user agent are deleted after 60 days, immediately on withdrawal. Personal data never shows up in logs.
  • Consent for Google: Conversions sent to Google Ads carry the consent signal of the visit the click and page came from, even when the conversion comes from sales later.

The use case Tracking with Consent Mode v2 walks through the setup step by step. Our data processing agreement is published on this website.

Sources

How TSO helps

Frequently asked questions

Do I need consent for the Meta pixel?

Almost always, yes. The pixel sets cookies and reads information from the browser, which falls under Art. 5(3) of the ePrivacy Directive, and ad measurement is not strictly necessary for the service the visitor asked for. Load it only after consent.

Is server-side tracking allowed without a cookie banner?

Not automatically. If your script reads an ID from the browser, or personal data goes to Meta or Google, you still need a legal basis, and for advertising that is usually consent.

What is the difference between basic and advanced Consent Mode?

In basic mode, Google's tags only load after consent. In advanced mode they load straight away and send cookieless pings when consent is denied, which Google uses to model conversions.

Are hashed email addresses anonymous?

No. A SHA-256 hash can be matched back to the person, which is exactly what the platforms use it for. It is pseudonymous data and stays personal data.

Do I need a DPA with Meta or Google?

You need one with your tracking tool if it processes data on your behalf. The ad platforms usually act as controllers in their own right and set this out in their own terms.

Terms in this guide

Written by
Daniel KalcherCTO

Daniel is CTO and leads the technology behind tracking, attribution and conversion APIs at TSO.

More guides

All guides →

From the guide to clean measurement.

Set up TSO with us in a demo or request beta access.