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.
On this page
- Two laws, two questions
- You share responsibility
- What counts as device access
- What valid consent needs
- Consent Mode v2: basic or advanced
- Basic vs advanced
- Setting up Consent Mode
- Server-side tracking: what changes, what doesn't
- Leads from your CRM
- Cookieless options
- Hashing: pseudonymous, not anonymous
- DPAs, roles and transfers
- Data minimization in practice
- What belongs in the privacy policy
- Common problems and solutions
- How to do it with TSO
- Sources
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.
| Question | Rule | Typical basis for ad tracking |
|---|---|---|
| May I store or read information in the browser? | Art. 5(3) ePrivacy Directive, via national law | Consent |
| May I process and share the personal data I collect? | Art. 6 GDPR | Consent, 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.
What valid consent needs
A banner on its own is not enough. Check these points:
- Ask first: No advertising pixel or tag loads before the visitor has agreed.
- Active opt-in: Pre-ticked boxes are not consent (Planet49, Recital 32 GDPR).
- Refusing is as easy as accepting: Put a "Reject" button on the same layer as "Accept".
- 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.
- Separate purposes: Analytics and advertising are different purposes and need their own categories.
- Allow withdrawal: Any time, without hoops, for example through a permanent link in the footer.
- Keep proof: Record who agreed to what and when. Art. 7 GDPR and Google both expect this.
Consent Mode v2: basic or advanced
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):
| Signal | Controls | When denied |
|---|---|---|
ad_storage | Advertising cookies in the browser | No new ad cookies |
analytics_storage | Analytics cookies | No analytics cookies |
ad_user_data | Sending user data to Google for ads | No enhanced conversions, cookieless conversion pings |
ad_personalization | Personalized ads, remarketing | No personalization |
For visitors in the EEA, Google expects these signals; without them you lose measurement and remarketing (EEA update).
Basic vs advanced
| Basic | Advanced | |
|---|---|---|
| Tags load | only after consent | immediately, defaulting to "denied" |
| Without consent | nothing reaches Google | cookieless pings with timestamp, user agent, referrer |
| Modeling | general model | model 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.
Setting up Consent Mode
- Set defaults: Call
gtag('consent', 'default', …)with all four signals set todeniedbefore anyconfigoreventcommand, ideally limited to the regions where you show the banner (Google's guide). - Wait for the banner:
wait_for_update(500 ms, for example) gives asynchronous banners time to report the choice. - Update on interaction: As soon as the visitor clicks, send
gtag('consent', 'update', …), store the choice and set it again on every following page. - Redact click IDs:
ads_data_redactionstrips click IDs from requests whilead_storageis denied. - 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.
| Claim | True? |
|---|---|
| Ad blockers and ITP cost you less data | Yes, the hop to the platform no longer runs through the browser |
| You control which fields leave | Yes, you can hold back IP, user agent or contact details |
| You no longer need a banner | No. If your script reads IDs or cookies in the browser, the ePrivacy rule applies |
| Sending data to Meta is not a transfer | No. A hashed email, IP and click ID are personal data |
| Hosted in the EU means GDPR-compliant | No. 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.
| Option | Stored in browser | What you get | Catch |
|---|---|---|---|
| Aggregate counts, no IDs | nothing | Visits and conversions per channel | No link to a person |
| Daily server-side ID (hash of IP and user agent) | nothing | One day's visits joined up | Personal data; the EDPB sees some IP tracking under Art. 5(3) |
| Click ID from the URL (gclid, fbclid) | nothing, unless you store it | Link to the ad | The EDPB sees URL tracking under Art. 5(3) too |
| Platform modeling | nothing | Estimate of missing conversions | Estimates 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:
- Send only events you optimize for: Lead, booked call, deal. No scroll tracking to Meta.
- Keep contact details out of URLs: Thank-you pages like
/thanks?email=…end up in logs, analytics and pixel requests. - Review fields per platform: Hold back whatever a platform does not need.
- Set retention periods: Delete IP addresses and raw data after a fixed period, and immediately on withdrawal.
- 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:
| Item | Example |
|---|---|
| Vendor and role | Meta Platforms Ireland, joint controller for collection |
| Purpose | Measuring and optimizing ad campaigns |
| Data | Click ID, IP address, user agent, hashed email and phone |
| Legal basis | Art. 6(1)(a) GDPR plus the national ePrivacy provision |
| Retention | Cookie lifetime, deletion period for raw data |
| Recipients and transfers | Platform, tracking provider, US under the Data Privacy Framework |
| Withdrawal | Link 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
| Problem | Cause | Solution |
|---|---|---|
| Pixel fires before consent | Pixel hard-coded in the template instead of controlled by the banner | Load pixels only through the banner or a tag manager with a consent condition |
| Google reports missing consent signals | Consent Mode missing, or set up without ad_user_data | Set defaults before all tags and update all four signals |
| Conversions drop after the banner goes live | Many visitors refuse, basic mode sends no pings | Plan for the drop; send server-side what you collected with consent |
| Conversion API sends IP without consent | The tool's default setting | Check per destination what leaves without consent and switch it off |
| Withdrawal only works on the next page | Banner does not tell the tags about the change | Send the update command on withdrawal and stop pixels for the rest of the page |
| Email address in the thank-you page URL | Form passes fields via GET | Use POST or strip the parameters before tracking |
| Privacy policy only mentions the pixel | Server-side transfers forgotten | Add 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
- Directive 2002/58/EC (ePrivacy Directive), consolidated version, EUR-Lex
- Regulation (EU) 2016/679 (General Data Protection Regulation), EUR-Lex
- Judgment C-673/17 (Planet49), EUR-Lex
- Judgment C-40/17 (Fashion ID), EUR-Lex
- Implementing Decision (EU) 2023/1795 (EU-US Data Privacy Framework), EUR-Lex
- Guidelines 2/2023 on Technical Scope of Art. 5(3) of ePrivacy Directive, European Data Protection Board
- § 25 TDDDG, German Federal Ministry of Justice
- Orientierungshilfe der Aufsichtsbehörden für Anbieter:innen von digitalen Diensten, Datenschutzkonferenz (DSK)
- EU user consent policy, Google
- About consent mode, Google Ads Help
- Consent mode reference, Google Ads Help
- Updates to consent mode for traffic in European Economic Area (EEA), Google Ads Help
- Set up consent mode on websites, Google for Developers
- Manage offline conversions, Google for Developers
- Customer information parameters, Meta for Developers
How TSO helps
- Conversion APILeads, meetings and deals go server-side to seven ad platforms, deduplicated with the pixel. So their algorithms optimize for real customers.
- Privacy & consentThree privacy modes, automatic detection of your cookie banner, and per platform you decide which data leaves. Hosted in Germany.
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
Daniel is CTO and leads the technology behind tracking, attribution and conversion APIs at TSO.