DSGVO Google Maps

An (still) relevant issue at our web agency: According to the GDPR, all trackers on a website must be able to be rejected via a cookie notice. This also applies to a Google Maps integration on your own website, as it also collects data about visitors to the site.

 

First of all: The recommendation to embed only an image of the iframe instead of Google Maps is generally compliant with data protection requirements. However, this approach is prohibited by Google's Terms of Service and is therefore unlawful.

 

The only way to continue using Google Maps on the website is to link it to the cookies. Maps may therefore only be loaded after the user has accepted it via the cookie notice.

 

To achieve this, let's first take a look at the Google Maps code:

 

<iframe id="google_maps" src="/XXXXXXXXX " width="200" height="150" frameborder="0" style="border:0" allowfullscreen></iframe>

 

As you can see, this is an HTML iframe element.

 

You can add the following HTML element where you want to integrate Google Maps:

 

<div id=“maps“></div>

 

In the next step, we need JavaScript that inserts the iframe into the element created above:

 

document.getElementById('maps').innerHTML= '<iframe id=\"google_maps\" src=\" XXXXXXXXX \" width=\"200\" height=\"150\" frameborder=\"0\" style=\"border:0\" allowfullscreen></iframe>';

 

You now need to integrate the script into your cookie notice plugin. Our current recommendations for cookie notice plugins are:

 

 

  • WordPress: GDPR Cookie Consent
  • Joomla: Kick GDPR
  • General: Osano Cookie Consent

 

 

These plugins allow you to integrate scripts through the plugin menu, providing an easy way to link them to the cookie notice.

 

In the next post on our agency blog, we will introduce you to GDPR Cookie Consent for WordPress.