Zum Inhalt

Google Tag Manager

As the Tag Manager acts as a container through which scripts can be integrated into the website, the scripts do not appear directly in the source code. Accordingly, it is not possible to remove the scripts from the page and reintegrate them into the cookie.

To block scripts that are loaded via the Tag Manager, ideally only the "Block embeddings that contain the following text" feature is used. For the blocking of scripts to work, however, it must be ensured that the CCM19 code is in the source code before the Tag Manager code.

We would like to expressly point out in advance that we do not recommend using the Google Tag Manager because in most cases a cookie must be set for it to work. This is not really technically necessary, but must be defined as such.

Furthermore, from the point of view of the Schrems II judgment with regard to Privacy Shield, the unsolicited integration of Google services is at least questionable and should be carefully considered.

In order to ensure the functionality of the Tag Manager and all associated services, the Tag Manager must always be active. This means that it always sends the user's IP address to the Tag Manager server - and therefore also to Google.

CCM19 is an alternative for the core function of the Google Tag Manager, i.e. implementing scripts on the website without having to edit the source code.

However, if this is not an option for you, please follow these instructions:

Integration in Google Tag Manager

Events are triggered in Google Tag Manager via the window.dataLayer interface if this is integrated on the target page.

As soon as embedding is permitted via the CCM19 interface, the following event is triggered. The events are triggered repeatedly for all permitted embeddings each time the page is accessed.

window.dataLayer.push({
    event: 'CCM19.embeddingAccepted', // Constant identifier
    id: 'xxxxxxx', // CCM19 internal embedding ID
    name: 'Google Analytics', // User-defined embedding name
});

In the Tag Manager, you can react to this via Triggers → New → Custom Events.

Mon Oct 25 2021 11:17:23 GMT+0200 (Mitteleuropäische Sommerzeit).png

This is what the information contained in the data layer looks like. Our aim is to define the triggers for this information.

Our starting point is after the successful implementation of CCM19 and the Tag Manager on your website.

1. the entry in CCM19 for the Google Tag Manager

In CCM19, navigate to the menu item "Integrations & Cookies". Create an entry for the Google Tag Manager there. You can find out how to create an entry and what you need to pay attention to here. Make sure to set the Tag Manager astechnically necessary .

2. set up tag

For our example, we created a tag for the web analysis tool Google Analytics. We left the tracking type set to Pageview.

Mon Mar 22 2021 154243 GMT+0100 (Mitteleuropäische Normalzeit).png

3. select trigger

We set a user-defined event as trigger type [a)] and name it .*[b)]. Check the option Use regular expression match [c)].

Mon Mar 22 2021 154642 GMT+0100 (Mitteleuropäische Normalzeit).png

4.create variables

As the event is the same for every embedding, we now want to use variables to define that the tag is only triggered if the Google Analytics embedding is approved. So we click on Trigger this trigger on: Some custom events and insert a new variable.

cbimage.jpg

We select the data layer variable from [a)] as the variable type. We enter the key name as the name [b)] and switch to version 1 [c)].

Mon Mar 22 2021 162718 GMT+0100 (Mitteleuropäische Normalzeit).png

5. add variable filter

Now we define which value the key name must have in order to trigger the trigger. Here wealwaysenter the name of the embedding (as it was stored in CCM19), i.e. in this case Google Analytics [a)].

We also add an event [b)].

Mon Mar 22 2021 162726 GMT+0100 (Mitteleuropäische Normalzeit).png

The event we enter here is: CCM19.embeddingAccepted.

6. test, test, test..

The Tag Manager offers a preview mode for testing. So before you switch the version live, you should check whether the tags are also triggered. Look for the corresponding embedding in the messages and take a closer look at the tag. If all the checkmarks have been set there, the tracking is working.

cbimage (1).jpg

Other events

CCM19.consentStateChanged

after version 2020.11.26

This event is triggered every time the page visitor saves the consent configuration. After the initial consent is given, it is also sent on subsequent page views.

It provides information about the permissions that the page visitor last configured.

Example:

window.dataLayer.push({
    event: 'CCM19.consentStateChanged',
    initialConsent: true,
    'ccm19_Google Ads Conversion': true,
    'ccm19_Facebook Pixel': true,
    'ccm19_YouTube Webplayer': true,
});
  • event: string - event identifier
  • initialConsent: boolean - If initial configuration of the page visitor true, otherwise false.
  • ccm19_{EMBEDDING_NAME}: boolean - If embedding is approved by the site visitor, true, otherwise false.

CCM19.embeddingAccepted

This event is fired each time the page is called up and the consent dialog is confirmed for each embedding that the page visitor has agreed to through their last configuration.

Example:

window.dataLayer.push({
    event: 'CCM19.embeddingAccepted',
    id: 'xxxxxxx',
    name: 'CMS Session',
});
  • event: string - event identifier
  • id: string - CCM19 internal embedding ID
  • name: string - User-defined embedding name

Deprecated:Please do not use for new projects; convert old code to embedding events.

A "custom event" is triggered in the Google Tag Manager via the DataLayer for each cookie that is allowed:

CCM19.cookieAccepted.<cookiename>

So e.g. CCM19.cookieAccepted._ga for the cookie_ga.