Advertising consent

3 min read

Who is asked before an advertising tag loads, the footer opt-out, Global Privacy Control, and how the site keeps one answer for every tag and every server-side send.

An advertising tag, such as the Meta Pixel, needs the visitor's agreement in some places and an easy way out everywhere. The site keeps one answer per visitor. Every advertising tag in the browser and every advertising send from the server reads that answer.

Nothing here appears until a module that uses advertising tags is on and configured. Today that is social publishing, once a Pixel ID and a Conversions API token are saved on its Tracking tab (Social promotions). A site without one shows no banner and no footer link, and makes no request.

Who is asked

The site decides a visitor's region from the host's country header when it sends one. Otherwise it uses the browser's time zone.

  • Asked first: the European Economic Area, the United Kingdom and Switzerland, and anyone whose region cannot be told (a time zone such as UTC). They see a banner at the foot of the page. Nothing loads and nothing is sent until they accept.
  • Offered a way out: everyone else. They are treated as agreeing until they opt out.
  • Global Privacy Control: a browser that sends the signal has opted out, wherever it is, and nothing loads.

A site can ask everybody first instead:

// platformkit.config.js
tracking: {
  consent: 'opt-in'
}

The banner

The banner sits at the bottom-left of the page and never blocks reading. Accept and Decline are the same size and weight, and neither is chosen in advance. The banner links to the privacy policy. Once the visitor answers, it does not come back in that browser.

While advertising tags are in use, every page's footer carries Do not share my personal information. It opens /privacy-choices, where any visitor can stop sharing (Don't share) or start again (Share again). With Global Privacy Control on, the page says the browser's signal is being honoured and offers no way round it.

A site with no footer has no link. The choices page is still there, and the site can link to it from its own pages.

Where the answer is kept

The answer is kept in the browser, in the analytics client's store beside its own opt-out (dl.consent). It reaches the server through the ingest door, the same one the site's analytics use:

  • For a signed-in person, each change is a row in tracking_consents: the choice, the region, how it was given (banner, link, gpc or region) and when. The latest row is the answer, and the rows are deleted with the account. A region's default never replaces an answer the person gave.
  • On a yes, the door also keeps what a network needs to match a conversion to the visit: Meta's browser ids (_fbp, and _fbc built from a fbclid on arrival), the address and the user agent. These go in ad_match, apart from the analytics record, which never holds an address. They are deleted on a no, once the conversion they matched has been sent, or after seven days, the oldest event Meta accepts.

On the server, tracking_consent_yes(user, browser) reads the person's latest answer. With no answer on record, it checks whether their browser kept match data, which only a yes does. With neither, the answer is no.

Wording

The banner and the choices page take their words from the theme's privacy strings. The kit's own words name no advertising network, since the banner serves whichever advertising module is on; a site that wants to name its partner says so in its own strings. A site overrides the ones it changes, including banner.main.policy-href, the address of its privacy policy (/privacy by default).

Testing

tracking-consent-rules.test.mts checks the regions, the answer and Global Privacy Control under Node. tracking-consent.test.mts opens the served demo in a headless browser at fixed time zones, recording every request to Meta's hosts. It checks the banner before and after Accept and Decline, the footer opt-out, and Global Privacy Control.