A GDPR Requirement Every Web Manager Should Know About

by

• Article
4–5 minutes

read

In all likelihood, you have probably heard something about the European Union’s General Data Projection Regulation (EU GDPR). The intent of the EU GDPR, which became enforceable in May of 2018, is to affirm and codify a person’s right to the ownership and control of their personal information. An element of this regulation enables the individual to permit or deny tracking of their presence on websites. The EU GDPR has many practical implementations for website managers.

But while the parameters of the EU GDPR are quite clear, uncertainty surrounds how the EU may will apply and enforce the rules when it comes to U.S. companies. Digital transactions increasingly cross oceans and political jurisdictions. California has also imitated legislation like the GDPR that would necessitate almost every site in the US to meet similar compliance regulations. Combined these mean there is at least is one crucial element of compliance that all U.S. businesses and web managers should know about and consider imemplement: cookie opt-in banners.

Cookie Opt-In Banners

The EU GDPR requires websites to display a banner informing the user that they may be tracked and give them the ability to remove any tracking mechanisms, including cookies. There are many ways to provide these banners and to enable visitors to deny (opt-out of) the use of cookies to identify them.

We have a client who requested such a banner, but with the requirement that visitors should opt-in to receive the cookie and analytics tracking. This would then exclude visitors by default from cookies and Google analytics tracking. Here’s how REQ helped our client do this … and how you can do the same thing.

We adapted the cookie consent script from Cookie Consent by Insites (https://cookieconsent.insites.com/) <link> combined with the location plugin from geoplugin.net to enable our desired opt-in tracking function via Google Tag Manager (GTM).

Obtain your GeoPlugIn Account

Surf to premium.geoplugin.net and register for an account and pay the annual fee for SSL API access. SSL is critical as your GDPR complaint website should be using SSL.  Implementing with the unsecured version will result in mixed content errors that can disable the banner script. Obtain your GeoPlugin APIKey to be inserted into the script.

Designing the Banner

Design your banner and copy by adapting the script available at https://cookieconsent.insites.com/.  This will then form the basis for the main section of the script.

Create your HTML Tag with its Script

<CODE>

<link rel=”stylesheet” type=”text/css” href=”https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css” />

    <script src=”https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js”></script>

<script language=”JavaScript” src=”http://www.geoplugin.net/javascript.gp” type=”text/javascript”></script>

 

 

    <script>   

    var geoPluginAPIKey = ‘place_API_key_here’;

    var cookie = false;

    var isDeclined = window.localStorage.getItem(“declinedCookie”);

    console.log(“this is: “, isDeclined);

    console.log(cookie);

      if(isDeclined == null) {

          jQuery.getJSON(‘https://ssl.geoplugin.net/json.gp?k=’ + geoPluginAPIKey + ‘&jsoncallback=?’)

            .done(function(data) {

                var isInEU = geoplugin_inEU();

               console.log(isInEU);

   

                if(isInEU !== 0){

   

    window.cookieconsent.Popup.prototype.deleteCookies = function() {

            //List of essential cookies – set as an empty array to delete everything – i.e. var essential = [];

            var essential = [“cookieconsent_status”, “DYNSRV”];

   

            //create array of cookies set

            var cookies = document.cookie.split(“;”);

   

            //loop through the cookies

            for (var i = 0; i < cookies.length; i++) {

                var cookie = cookies[i];

   

                //Get the cookie name

                var eqPos = cookie.indexOf(“=”);

                var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;

   

                //Delete all cookies except those listed in essential

                if (essential === undefined || essential.length == 0 || essential.indexOf(name) == -1){

                    //Note assuming path is always = ‘/’

                    document.cookie = name + “=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/”;

                }

            }

        }

    window.addEventListener(“load”, function(){

    window.cookieconsent.initialise({

      “palette”: {

        “popup”: {

          “background”: “#000”

        },

        “button”: {

          “background”: “#f1d600”

        }

      },

      “content”: {

      “header”: ‘Cookies used on the website!’,

      “message”: ‘

This website uses cookies to personalize content and ads, to provide social media features and to analyze our traffic. We also share information with our advertising and analytics partners who may combine it with other information that you have provided to them or that they have collected from your use of our services. Learn more by clicking here. You may opt out of receiving emails or surveys from us at any time by clicking on the “Unsubscribe” link in the footer of any email or emailing optout@yourdomain.com.

',

      “dismiss”: ‘Decline’,

      “allow”: ‘Got it!’,

      “deny”: ‘deny’,

      “link”: ‘Learn more’,

      “href”: “http://www.yourdomain.com/privacy-policy”,

      “close”: ‘&#x274c;’,

      },

     “type”: “opt-in”,

   

    onStatusChange: function(status, chosenBefore) {

                             console.log(status);

                //If cookies not allowed delete them

                if (status != ‘allow’){

                             console.log(“declined cookie”);

                    console.log(cookie);

                             window.localStorage.setItem(“declinedCookie”, true);

                            

                    this.deleteCookies();

                    console.log(cookie);

                                   

                } else {

                  cookieConsent = true;

                  console.log(cookie);

            }

     

    }

    })

   

    });

        

            }}).fail(function(jq, status, msg) {

              console.log(‘Geolocation failed: ‘ + status + ‘ – ‘ + msg);});

     

      }   

    </script>

 

</CODE>

-

The cookieConsent Variable and Custom Event Trigger

Create a JavaScript Variable matched with the cookieConsent variable from the above script. This will be assigned a Custom Event Trigger to fire when the visitor does not consent to the banner.

-

Apply the Trigger as an Exception

Apply the Custom Event Trigger as an Exception to each Tag that is not permitted without consent. Do not apply this Trigger to the Cookie Consent Script.

-

Transfer Coded Tags to GTM

This method only applies to Tags managed in GTM.  This is then an excellent time to review the site for Facebook pixels or any other Tags that must be removed from the page code and transferred to GTM.

Next Steps

A cookie banner is just one small step to comply with the various aspects of the GDPR and pending California regulations. Privacy policies, data security and management, and response to consumer inquiries are all critical elements that can be more complex.  Feel free to reach out to us for any assistance.

How Phone.com’s Amber Newman Turned Paid Search Into a Precision Marketing Engine

How Phone.com’s Amber Newman Turned Paid Search Into a Precision Marketing Engine

Phone.com offers customers a straightforward alternative to complex and costly VoIP systems. It allows them to set up custom business numbers and manage calls, texts, and videos directly from their personal phones, keeping work and personal communications separate. Amber Newman, Phone.com’s director of marketing, has built a strategy that reflects her company’s simple but powerful…

How Patrick Bradshaw Is Bringing Marketing Into the Deal

How Patrick Bradshaw Is Bringing Marketing Into the Deal

Sales enablement has traditionally focused on preparing reps with content, training, and playbooks before a deal begins. Patrick Bradshaw, Sr. Director of Acquisition and Growth Marketing at Highspot, says that the model is evolving as AI and better data make it possible to support teams up to the end of the sales process. We caught…

The CMO Who Gave Up Sales Pitches to Build Real Relationships

The CMO Who Gave Up Sales Pitches to Build Real Relationships

Chatting with Nathan Burke of 7AI on why relationship-building outperforms traditional B2B marketing Nathan Burke is intentionally doing less of what most B2B marketers are taught to do. As CMO of 7AI, he’s opting out of the usual B2B playbook, the awkward steak dinners with a pitch attached, the conference badge scanning arms race, and…

How UVEye’s Unicorn Drives Trade Show Excitement

How UVEye’s Unicorn Drives Trade Show Excitement

Trade shows are crowded. Competitive. Expensive. Every booth promises innovation. Every brand is trying to stand out to the sea of overwhelmed and tired attendees. For AI-driven vehicle inspection company UVEye, standing out meant not just thinking creatively. It meant creating a unicorn. UVEye calls its technology an “MRI for cars.” It provides AI-driven technology that…

How WalkMe’s Melanie Pasch Humanized the Enterprise AI Adoption Problem with “AI Shame”

How WalkMe’s Melanie Pasch Humanized the Enterprise AI Adoption Problem with “AI Shame”

Ask an executive how many software applications their company uses, and they’ll probably guess 30 or 40. The average organization, according to research by digital adoption platform (DAP) pioneer WalkMe, actually runs about 625 applications. This staggering digital ecosystem is where most tech investments stall, not because the technology is poor, but because employees can’t…

From $200M ARR to Pre-Seed: How Karina Lawrence Rewrites the Marketing Playbook for Early-Stage Startups

From $200M ARR to Pre-Seed: How Karina Lawrence Rewrites the Marketing Playbook for Early-Stage Startups

When you’ve helped scale a developer-focused company from roughly $200M to nearly $250M in ARR, you know what “grown-up” marketing looks like. Today, though, Karina Lawrence is back at the very beginning—leading marketing at Macrovo, a pre-seed, ~10-person startup that blends AI and human expertise to help financial institutions make faster, smarter decisions. It’s a…

B2B Videos You Actually Want to Watch? Meet Jared Evers of Medallia.

B2B Videos You Actually Want to Watch? Meet Jared Evers of Medallia.

For Jared Evers and his small and scrappy content team at Medallia – provider of customer and experience software – if you can’t do something stellar, there’s no sense in doing it at all. For proof, check out how the team is pushing the boundaries of corporate videos with Experience Now, Medallia’s own streaming platform.…

Verisys’ Brian Krenzer on Why Doing Less is the Smartest Q4 Move

Verisys’ Brian Krenzer on Why Doing Less is the Smartest Q4 Move

When Verisys, a healthcare data company focused on compliance and credentialing, set out to close the gap between what’s promised and what’s delivered, marketing became a central force in making that happen. Under the leadership of VP of Marketing Brian Krenzer, the team reoriented around what matters most: delivering a five-star customer experience at every…

How Workable’s Kathleen Schurman Uses Authenticity and AI to Elevate HR Marketing

How Workable’s Kathleen Schurman Uses Authenticity and AI to Elevate HR Marketing

In an age where automation dominates marketing headlines, Kathleen Schurman, Marketing Director at Workable, is proving that authenticity and storytelling still come first. Her team’s success lies in staying true to Workable’s roots—user-friendly software for hiring teams of all sizes—while adopting AI tools that amplify creativity and efficiency. We spoke with Kathleen about moving upmarket,…

How HII’s Jaime Orlando Builds Connection, Culture, and Momentum Inside a Legacy Brand

How HII’s Jaime Orlando Builds Connection, Culture, and Momentum Inside a Legacy Brand

Q: Jaime, for those who might not know HII Mission Technologies, can you give us a quick overview of what your team does? Jaime Orlando Absolutely. HII as a company has an incredible legacy. It’s America’s largest shipbuilder, with more than 135 years of experience. About 75% of HII’s business comes from shipbuilding at our…

CONTACT US
CONTACT US

WE HELP BRANDS OWN WHAT’S NEXT

Our integrated PR and digital campaigns build reputations, drive growth, and shape conversations that define markets. Let’s talk about how we can help you do the same.