Skip to main content

Exclude CookieHub from certain pages

In certain cases, it may be necessary to exclude specific pages, such as privacy policy or legal disclaimers, from displaying the CookieHub dialog to allow users to read essential information without interruptions. By following the steps outlined below, you can seamlessly configure CookieHub and Google Tag Manager to exclude designated pages from showing the CookieHub dialog.

Please note that this guide assumes you have already set up CookieHub and have basic familiarity with Google Tag Manager. Let's dive into the steps:

  1. Log in to Google Tag Manager.
  2. Click on the "Variables" section on the left.
  3. Click the New button in "User-Defined variables"
  4. Choose "RegEx Table "as the variable type
  5. Select {{Page Path}} as the "Input Variable".
  6. In the RegEx Table, add a row and specify the URL pattern that should be excluded (e.g., \/privacy-policy). Please note that special characters need to be escaped so put a backward slash in front of any forward slash.
  7. Set the Output value for the excluded URL pattern to false.
  8. Check the "Set Default Value" option and set the Default value to true.
  9. Provide a name for the new variable and save it. RegEx Table in Google Tag Manager
  10. Go to the "Tags" section and locate the CookieHub tag.
  11. Click the Edit icon to modify the tag configuration.
  12. Look for the "Show user interface" field and select the newly created variable from the dropdown list.
  13. Save the changes to the CookieHub tag. Exclude CookieHub dialog from certain pages
  14. Publish the changes in Google Tag Manager to make them live on your website.