Install with a tag manager or CMS
Load the consent runtime through Google Tag Manager, the WordPress plugin or a Shopify theme when you cannot edit the page head yourself.
Use one of these when Google Tag Manager, WordPress or Shopify decides what goes in your pages. If you can edit <head> yourself, install the script tag instead.
Before you start#
- A publishable key, which starts with
pk_, with your site's origin on its list. See Create a key. - The address of your deployment, such as
https://console.dpconsent.com/consent. - For Tag Manager and WordPress, the files under
integrations/gtmandintegrations/wordpress. They ship with the product.
Google Tag Manager#
The template sets the Consent Mode defaults first, then loads the runtime, which sends the updates.
- In Tag Manager, open Templates → Tag Templates → New.
- Choose Import from the menu, select
piedap-consent.tpland save the template. - Create a tag from the template.
- Enter your deployment's
https://address in Consent API URL. - Enter your
pk_…key in Publishable key. - Fire the tag on Consent Initialization – All Pages.
- Publish the container and open your site. The banner appears.
Tag Manager cannot hold tags in your HTML
Tag Manager loads scripts after its own container starts. Google tags and tags gated by Tag Manager's consent settings work. Scripts written directly in your page have already run. Mark those up as in Hold tags until consent, or use the plain script tag.
For tags without built-in consent checks, trigger on the custom event piedap_consent_update. Read a data layer variable such as piedap_consent.categories.MARKETING. The payload is in Browser runtime events.
Template fields
| Field | Default | What it does |
|---|---|---|
| Wait for update (milliseconds) | 500 |
How long Google tags hold their first hit |
| Redact ad click identifiers while ad_storage is denied | On | Sets ads_data_redaction |
| Pass ad click information through URLs while cookies are refused | Off | Sets url_passthrough |
| Regions that start granted (opt-out regions) | Empty | Region codes such as US or US-CA where every signal starts granted |
| This site uses IAB TCF and This site uses IAB GPP | Off | Install the __tcfapi or __gpp stub at once |
WordPress#
The plugin prints the tag first in <head> and marks it so common script optimisers leave it alone.
- Copy the plugin directory to
wp-content/plugins/piedap-consent. - In WordPress admin, activate the plugin.
- Open Settings → PIEDAP Consent.
- Enter your deployment's address in API URL.
- Enter your
pk_…key in Publishable key. - Save. The page shows the tag the plugin prints under Current tag.
Optional settings on the same page:
| Setting | What it does |
|---|---|
| CDN URL | Serves the script from a CDN and sends the API address as data-piedap-api |
| Default country override | Uses a two-letter country code instead of the detected one. For testing |
| IAB TCF, IAB GPP | Install the __tcfapi or __gpp stub at once |
| Pinned build | Prints the versioned file with its integrity attribute |
Shopify#
- In the console, open Install and copy the Shopify tag under Integrations.
- In Shopify admin, open Online Store → Themes → Edit code.
- Open
layout/theme.liquid. - Paste the tag as the first line inside
<head>, above every other script. - Save, then open your shop. The banner appears.
Shopify's own pixels run in a sandbox the runtime cannot reach. They follow Shopify's Customer Privacy API, so the runtime passes every answer on to it:
| Shopify field | Follows the category |
|---|---|
analytics |
ANALYTICS |
marketing |
MARKETING |
preferences |
FUNCTIONAL |
sale_of_data |
SALE_OR_SHARING |
Checkout is not held: automatic blocking has no checkout or payment hosts on its list.