Guide to GDPR Compliant Cookie Declaration Using Wix.com.
By: Sebastian Zolg
Tags: Google Tag Manager, Gdpr, Website Development, Cookiebot, Wix

Step by Step

Prepare your Wix.com Site

Open your Wix.com website and if not already created, add a new page for your Data Privacy Policy. Place a simple paragraph text element anywhere on your page and label it LOADING COOKIE DECLARATION... or so. Please note that you have to name it exactly this way if you’re planning to use the below scripts without modification. Please also note that this text can appear within any other text on your site, e.g. your very long Data Privacy Policy statement.

Make sure the placeholder text has a paragraph style (not a heading) applied to it and is surrounded by line breaks (hit enter).

Keep everything open, as we’re soon coming back to your Wix.com website.

Placeholder for the Cookie Declaration on Wix.com

Google Tag Manager

In Google Tag Manager, click Create Account and configure your new Container accordingly, accept EULA and click all the way through till you end up in the main interface. Skip these steps in case you already have a configured Google Tag Manager environment for your Wix.com website.

At this point note your Google Tag Manager Id which is located right next to the Preview button. We’re going to use that one later.

Google Tag Manager — Create Account

Google Tag Manager — Main interface with Container Id

In the Google Tag Manager main interface create two variables of type Constant.

Variable Cookiebot Domain Group Id

It contains your Domain Group ID taken from Cookiebot.com. You find it in your Cookiebot.com account under Your scripts. Variable Cookiebot Placeholder Text

It contains the text of the placeholder element you’ve set on your Wix.com website in the previous step.

Google Tag Manager Variable for Cookiebot Domain Group Id

Google Tag Manager Variable for Cookiebot Placeholder Text

Next, we create the necessary Tag in Google Tag Manager which is more or less just a plain JavaScript injected code snippet that is leveraging the previously created variables. The tag will listen to an event fired by your Wix.com website which we create later on.

In Google Tag Manager go to Triggers and add a new Trigger of Type Custom Event.

Add a new Trigger

Custom Event Trigger

Name it something like On Inject Cookie Declaration Event and use the exact Event name InjectCookieDeclaration and hit Save.

Custom Event Trigger Configuration

Now we’re ready to create the Tag. Go to Tags in Google Tag Manager and click Tag Configuration.

Add Tag in Google Tag Manager

From there find the Custom HTML Tag and add it.

Custom HTML Tag

Name it something like Inject Cookie Declaration and paste the below script into the HTML box.

Custom HTML Tag Configuration

When you hit the Save Button you’ll be asked to Add Trigger. Doing so results in the following view where you can select the previously created On Inject Cookie Declaration Event trigger. Add the Trigger and Save everything.

Choose Trigger Event

This should be your final view. Now hit the Submit button to publish all of your work.

Final View in Google Tag Manager

Next, we need to tell your Wix.com website to trigger the event InjectCookieDeclaration which we’ve created previously. To do so, head over to your Wix.com website builder interface and Turn on Dev Mode through the Dev Mode menu.

Turn Dev Mode on for Wix.com

When in Dev Mode, open the code editor by clicking the Page Code bar in your editor footer section.

Page Code Editor on Wix.com

Add the following Script to your Page Code and publish your site again. This little script uses the Analytics Layer (a.k.a. Data Layer) to signal various events to other listeners.

In our case, it is the Google Tag Manager connected to your Wix.com website which ist listening for this custom event to trigger the injection of your Cookiebot.com Cookie Declaration. We’re almost there!

Signal Event to Data Layer on Wix.com

Now we’re taking the final step in connecting your Wix.com website with your Google Tag Manager. To do so, open the Tracking & Analytics Dialog in the Settings menu.

Tracking and Analytics Settings on Wix.com

From there click New Tool and select Google Tag Manager. Prompted for your Google Tag Manager Container ID, enter the ID that is shown in your Google Tag Manager's main interface, as mentioned before.

Connect Google Tag Manager to Wix.com

Google Tag Manager ID

Save all your work and make sure you published your Wix.com website, your Google Tag Manager work and your Cookiebot.com settings.

Now it’s time to test our implementation. Visit your Wix.com website and head over to your Data Privacy Policy page to watch the magic happen. First, see your text label appear indicating a loading action through its placeholder text.

Loading Cookie Declaration

After a few seconds and after Google Tag Manager received the Event from your Wix.com website, the Cookie Declaration from Cookiebot.com gets loaded on the fly. Note how nicely it is applied to your website having exactly the style you want it to have (refer to the problem statements above).

Injected Cookie Declaration

Before you go, consider a small donation 💗

I wrote this for you! And I made it free for everyone. Think about how much time and money you saved and consider a small donation of $100, $50, $25, or even less. It now powers your website🚀! Thank you so much!

Summary

That’s it. I hope you like this introduction on a concrete GDPR/EU ePrivacy Cookie Declaration implementation and it helped you to make your website compliant.

Make it so.

- Sebastian