The Cookie Control SDK is enabled via the custom trigger, events and tags functions in Google Tag Manager(GTM)
Events are fired by our script injected on your website with all the logic necessary to handle banners and widgets, so there is no need to implement our solution in the source code.
By default, there are 4 basic cookie types:
- cookie_cat_necessary - Cannot be deselected by the user
Those will also serve as triggers and event names.
Setting up triggers
1. Navigate to the main dashboard, click "Triggers" section, and select "New"
2. Select "Custom Event" trigger from the list
3. Fill in the required inputs:
As the trigger's event name, use one of the existing cookie
categories listed above.
The trigger itself doesn't need to use the category name.
4. Repeat the steps above for all individual cookie categories to cover all the possible
choices of the end-user.
Setting up tags
Now, with all triggers configure, we can continue and assign the content/functionalities we want to
serve on our website.
In this example, we'll use Google Analytics.
1. Start by choosing the type of tags you want to use. In this example, it’s Universal Google Analytics, but it could be any other tag
2. Configure the tag according to your needs, and select a relevant trigger. In this example,
as we're configuring Google Analytics, we should use the cookie_cat_statistic event, which
was assigned to a trigger called "Statistic Cookie".
Remember that a trigger's event name is a key value, while the name of the trigger can be set according to your preferences and will not affect the trigger’s functionality.
- A tag can be called using a number of triggers. If more than one trigger is added, Google
Tag Manager will require at least one of them to fire to execute the tag.
- Additionally, you can set how many times a tag can be triggered per a client’s visit.
- Remember to publish your changes or the tag will not work as expected.