Set GTM / Preparations et verifications
Using a tag management system such as Google Tag Manager (GTM) will require a configuration to be set up to manage scripts based on user consent.
Tracking Code Positioning
The Google Tag Manager code and any other tracking script should be below the Byscuit script. Byscuit must be able to be as high as possible in theof the website so that it can load before the other tracking tools. The GTM script also needs to be the highest element in this part of the code, so we will opt to place it right after the Byscuit code.
To check that the code is well positioned:
- Go to your web page and press Ctrl+U to open the source code of the page
- You should see in the first lines the Byscuit script just at the opening of the <head>
- The Google Tag Manager code should be right after the Byscuit code. Another GTM script, the code <noscript> should be placed at the opening of <body>.
Consent Preview
Before continuing and installing, you need to make sure that Byscuit is working on the pages. We simply need to test that Byscuit sends the consent update and that GTM can read it. To do this check, we will go to GTM and activate Debug mode.
- When you are logged into your GTM account, click on Preview in the upper right corner of the page. If your GTM is in English, it will say Preview.
- Copy and paste the URL of your website in the field provided for this purpose
- Look at the summary on the left of the screen. The summary indicates the events detected by GTM on the website. Here, we simply confirm that the “Consent” event is in position 1 in the event listing.
- If you click on the Consent event in first position, you can then expand the API Call section. The elements here will always be “Denied”. When the user accepts cookies or has previously accepted them, a new Consent event is sent with the consent chosen by the user.