How we handle GDPR article 17 requests using Google Tag Manager and email?

FYI: Also try our GDPR Delete tool

We needed an easy way to delete users from our Google Analytics Free to comply with GDPR article 17 and we wanted it to be as easy as possible.

We succeeded and decided to make it easy for you as well – and yes it is free, but we would appreciate it if you helped us spread the word.

Here is what we did and what you should do!

So! we wanted to spend as little time as possible doing the implementing as we have very little time and many things to do.

The solution has 4 steps:

Step 1 – provide the user with easy access to their clientId

Step 2 – make it easy for the user to send us their clientId

Step 3 – delete the user’s data with this tool

To do this we needed 2 things.

  1. To read the clientId while the user is on our site.
  2. Write out the clientID to the user, so he/she can copy/paste it to us.

We decided that Google Tag Manager (GTM) was a good tool for this.

Part 1: Reserve a spot on the website for the clientId

We decided that the user should click on some text to reveal the clientId. So we added this HTML to our page.

<p>Your Client Id on this page is: <i id=”clientId”>[CLICK TO REVEAL]</i></p>

Part 2: Monitor clicks on “clientId” element then write the clientId

In GTM, create a trigger and call it e.g. “Get-Set clientID”


Configure to Click IDequalsclientId

Click Save

In GTM, create a new Tag of the type Custom HTML

Paste following code:

(function(){(function(){ function getClientIdCookie(name) {  var value = "; " + document.cookie; var parts = value.split("; " + name + "=");  if (parts.length == 2) return parts.pop().split(";").shift(); } var clickedElement = document.getElementById("{{Click ID}}"); var _ga = getClientIdCookie("_ga"); if(!!_ga) {   var parts = _ga.split(".").reverse();   if(parts.length > 2)   clickedElement.innerHTML = parts[1] + '.' + parts[0]; })()

Add the trigger we created above

Click Save. Click Submit. Click Publish

Load the page where you added the HTML text. This is how the result looks on our site.

When the user clicks the [CLICK HERE TO REVEAL] text is looks like

See for yourself here.

We would love ideas and feedback. Let us know on Twitter,  or via the chat on our main site

// Type writer effect