Tracking on page load

*This practice is not recommended as it is not in line with GDPR's requirement of prior consent.

In some cases, you might want to enable cookie tracking of one or more categories by default, and letting your users disable cookies tracking if they wish.

Implementing cookie tracking on page-load in the source code:

This practice is for allowing a script to run on page load and without consent from the user, but the user still has the option of disabling it, if they want to opt-out.

if (CookieInformation.getConsentGivenFor('cookie_cat_category') || typeof (CookieInformation.getConsentGivenFor('cookie_cat_category')) === 'undefined') { // here goes the script }
  • replace the cookie_cat_category with the category you want to enable.

Implementing cookie tracking on page-load in GTM:

if (CookieInformation.getConsentGivenFor('cookie_cat_category') || typeof (CookieInformation.getConsentGivenFor('cookie_cat_category')) === 'undefined') { // here goes the script }
  • replace the cookie_cat_category with the category you want to enable.

Example with Facebook Pixel:

Screenshot_2018-11-27_at_12.54.19.png

Did this answer your question?