How to install Cookie-Script with Google Tag Manager

You can easily install Cookie-Script via Google Tag Manager (GTM) by following these step-by-step instructions.

It is assumed that you have already had experience with GTM and your GTM account is created, also you created a website container in GTM and added the GTM container snippet to your website as required:

Implementing the Cookie-Script popup box in GTM

In your GTM Workspace create a new tag by clicking New tag > Custom, HTML Tag. In the HTML field, insert Cookie-Script code copied from your item. Code should look similar to the one below:

<!--Start Cookie Script--> 
<script type="text/javascript" charset="UTF-8"
</script> <!--End Cookie Script-->

Next, click Add trigger choose DOM Ready, and apply a name to your tag.

Your final tag configuration window should look like this. (unique number of .js file have been changed ):

cookie code

In the end, click "Publish" to apply your changes to your website.

Configuring Third-party Scripts in Google Tag Manager

After you have added the Cookie-Script popup to your website you might need to configure some third-party scripts to be loaded only after the user's consent. This is needed to block third-party cookies. Fortunately, Cookie-Script has a built-in integration with Google Tag Manager events which allows you to set all the triggers and tags in your GTM account. You can find detailed instructions in our manual for disabling third-party scripts using GTM