Skip to Content
All Blogs

Set Up A GDPR Cookie Consent Form

   — #feature

Set Up A GDPR Cookie Consent Form Using Google Tag Manager. This solution works for cookies fired from inside the GTM container. It won’t prevent cookie placement for those placed outside the container.

Under the General Data Protection Regulation (GDPR), the ideal cookie consent form will:

  • Detect your location and see whether you’re in the EU
  • Based on your location, display the cookie consent (or not)
  • Request cookie consent
  • If you consent, place analytics cookies as usual
  • By default, let you browse the site, but turn off analytics cookies, providing a seamless user experience
  • Oh, and since you have about 48 hours (GDPR goes into effect May 25th), require as little developer time as possible.

- Ask, and ye shall receive:

This step-by-step uses Google Tag Manager (GTM) to create a cookie consent banner that pops up at the bottom of your site only for EU visitors. The banner asks visitors to opt-in. If they don’t, they can still browse the site,but GTM will not fire cookies that require consent.

To set this up, you need to understand GTM and GTM configuration. When you’re done, you’ll get something like this:

gdpr-blog-1-834x449

Step 1: Sign up for an ipinfo.io account

Step 2: Generate a cookie consent banner at Cookie Consent by Insites

Step 3: Configure Google Tag Manager

I will provide the code of the NextJS project for the GDPR setup in the Pensieve.