Custom Cookie Policy (Javascript) Tutorial

Extend the cookie consent dialog with a custom policy from a third-party provider. Effectively manage cookie consent and analytics. This tutorial will show you how.

💡Pro Tip: Scripts used in the <HEAD> section of a page should be added to the 'In page header' custom code fragment.

Scripts used in the <BODY> section of a page should be added to the 'At start
of page' custom code fragment. This custom code fragment should also be used for
setting custom callback functions that should be triggered when a user accepts/rejects
cookies and handle which scripts to be blocked on every page load after a user has set
their cookie preference.

 

👩‍🔬Prerequisite knowledge: To make the most of this tutorial it will help to be familiar with the Imagen Admin interface. It will also help to be comfortable copying/pasting javascript

Contents

Enable Custom Cookie Policies

Cookiebot Tutorial

Alternative considerations


Enable Custom Cookie Policies

Before we can add any custom cookie policies we must first enable custom Javascript in the Imagen admin interface. This will allow for third-party or custom code to be placed in each Imagen site to process your users' cookie consent. 

 

We can now add scripts from your chosen cookie policy provider to the custom code fragments shown above. Take a look at the cookiebot Tutorial below for a walkthrough on how to configure your cookie policy. 

💡Pro Tip: Scripts used in the <HEAD> section of a page should be added to the 'In page header' custom code fragment.

Scripts used in the <BODY> section of a page should be added to the 'At start
of page' custom code fragment. This custom code fragment should also be used for
setting custom callback functions that should be triggered when a user accepts/rejects
cookies and handle which scripts to be blocked on every page load after a user has set
their cookie preference.


Cookiebot Tutorial

This tutorial will show you how to configure a custom cookie policy provided by a third-party provider


Alternative considerations

You may have chosen to use the default Imagen cookie policy, or perhaps a consent policy provided by a different third party to cookiebot:

OneTrust Privacy

Osano Privacy

💡Pro Tip: You can disable google analytics with one simple line of helper code. This will disable any tracking functionality  iwCookieCallbacks.disableGoogleAnalytics()  

 

📕Further Reading: Check out cookiebot to learn more about external cookie policy providers