Google Consent Mode

adopt-gtm-template

AdOpt provides a tag template to support Google Consent Mode, and to start using Google consent mode together with AdOpt, just follow the next steps:

Important
Installing and using the tag template DOES NOT replace the AdOpt disclaimer already installed on your website. Both the standard AdOpt disclaimer and the tag template must be installed on your site

Installing the tag template

1 - Import the AdOpt template

To do this, you can import our template directly from GitHub, or through the Google Tag Manager teplate gallery

Through GitHub

  1. Download the file
    ./src/template.tpl
    which you can find here, by clicking on the download icon in the top right corner.
  2. Open your Google Tag Manager Web Google Tag Manager user interface and select the desired container.
  3. In GTM, go to the Templates section, and in the Tag Templates box, click the blue New button.
  4. In the Template Editor, click the menu (three vertical dots) in the upper right corner and select Import.
  5. Select the
    template.tpl
    file you just downloaded.
  6. Follow the steps indicated. Once the process is complete, the template editor should be displaying the AdOpt template in edit mode.
  7. Click Save, and close the template editor. Do absolutely no changes to the model code.

Through the template gallery

  1. In GTM, go to the Templates section, and in the Tag Templates box, click the Search Gallery button.
  2. In the tab that opens on the right, click on the magnifying glass symbol to search, and search for "adopt" or simply scroll down the list until you find AdOpt.
  3. Click on the AdOpt template, and then click the blue Add to workspace button

2 - Installing tag template

  1. Now that you have the AdOpt template, go to the Tags section and click New to create a new tag.
  2. From the list of available templates, select the AdOpt template you just imported.
  3. In the tag configuration part, in the Triggering part, first select Consent Initialization - All Pages, as this is a specific trigger that will make GTM "understand" that the Consent mode is active.
  4. Add a second trigger, of type Custom Event.
    4.1. Click the "+" symbol to add a new trigger, and in the list of triggers, click the "+" symbol again to create a new trigger.
    4.2. Click on the Trigger Configuration box and in the list that will open on the right, click on Custom Event, in the Others section.
    4.3. Choose a name of your choice for this trigger, and in Event Name, type
    adopt-visitor-consent-ready
    4.4. Make sure the All custom events option is selected, select this option if necessary and click the blue Save button
    4.5. Back in configuration, check that both triggers are configured, and click the blue Save button.

Settings

Some tags, like those for Google Analytics and Google Ads, have Built-in consent checks. This means that these tags have some logic that automatically changes its behavior based on user consent. In these cases, no consent settings are required.

Important
Tags that contain integrated consent checks are loaded/triggered regardless of the visitor's consent, data and information will be transmitted to Google without their explicit permission, the difference is that in these cases these tags do not record cookies in the browser (cookieless ping). If this is a problem, or is something of concern to you, it is recommended to configure these tags with

To configure these checks, follow the next steps.

  1. Click on the tag to open it, and click on the Tag configuration box. Screenshot from 2023-09-14 14-41-40

  2. Click Advanced Settings, then Consent Settings to display the options, and check the Require additional consent for tag to fire option. Screenshot from 2023-09-14 14-42-05 Screenshot from 2023-09-14 14-42-44

  3. Click on the + Add required consent button, click on the field that just appeared, and select the type of consent desired. Screenshot from 2023-09-14 14-56-37

  4. Repeat step 3 for all consent types you want to add.

If the tag has a simple trigger, like an All Pages, follow these steps:

  1. Click on the Triggering box, and click on the "+" symbol, and in the list of available triggers, click on the "+" symbol again to configure a new trigger. Screenshot from 2023-09-14 14-57-36 Screenshot from 2023-09-14 14-57-48

  2. Click on the "Trigger Configuration" box, and from the list of available types, select the Custom Event, in the Others section. Screenshot from 2023-09-14 14-59-22 Screenshot from 2023-09-14 15-00-08

  3. In the Event name, type

    adopt-consent-mode-ready
    , and select the All custom events option, if this option is not already selected, choose a name for the trigger, and click the blue Save button. Screenshot from 2023-09-14 15-01-27

  4. Make sure both triggers are present (the old trigger that was already there and the new custom trigger that you just created), and click the blue Save button Screenshot from 2023-09-14 15-02-29

  5. Click the blue Save button in the top right corner.

If the tag has other types of triggers, which depend on visitor actions, such as clicks, or other rules such as a specific url, follow these steps (in this specific example, we will use a click-based trigger):

  1. Click on the trigger, to open its settings, click on the Trigger Configuration box, and check the Some Clicks option Screenshot from 2023-09-14 15-04-19

  2. In the fields that have just appeared, in the first field, click on New variable..., and again on the Variable configuration box. Screenshot from 2023-09-14 15-05-30 Screenshot from 2023-09-14 15-32-03

  3. In the list, click JavaScript Variable.
    Screenshot from 2023-09-14 15-14-04

  4. Back in Variable Configuration, in Global Variable Name, type

    adoptConsentModeReady
    , choose a name for this variable, and click the blue Save button in the top right corner. Screenshot from 2023-09-14 15-15-30

  5. Back in Trigger Configuration, select contains in the second field, and in the third field, type

    adoptConsentModeReady
    again. Screenshot from 2023-09-14 15-16-58

  6. Click the blue Save button in the top right corner.

  7. Repeat these steps for each of the triggers of this type, but instead of creating a new variable, just select the variable you already created the first time.

And that's it, don't forget to publish the changes.

Logo

AdOpt

Resources

Legal Terms

© AdOpt since 2020 • Made by people who love

🍪