Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

As a general rule: If possible, please use the option provided by Google Maps for direct embedding in an iframe. This is where Privacy Smart Blocker works , directly embedding Google Maps in an iframe will allow Usercentrics' Privacy Shield to work without further adjustments. 

If Google Maps is to be rendered via the API, you have to pay attention to two cases here: there are two scenarios:

  1. User visits the website with consent given to Google Maps

  2. User visits the website without consent given  to Google Maps

In case 1, please add the two scripts for Google Maps as follows:

Code Block
<script type="text/javascript" src="js/googlemaps.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=XXXXXXXXXX&callback=init_map"></script>

Please replace Replace XXXXXXXXXX with your API key. In the example above, the script googlemaps.js controls the functionality of Google Maps. If the name of the script differs from yours, please replace change it accordingly.

One problem you encounter with casued by this implementation is that you don't know where to display the content. We therefore recommend this form of integration only for experienced users.

To establish the functionality for the second case, please edit the script googlemaps.js as follows and replace the values for zoom, lat and lng with those of your own implementation:

...

The previously mentioned example functions works because we have imitated the google.maps.Map functionality (code section "Mock Implementation"). This way we can find out where the Privacy Smart Blocker has to be integrated. If there has been Consent consent was given, init_map  is called again by the actual Google Maps API script, which is set in the callback parameter of the URL. In this case the API is ready and the actual implementation (code section "Real Implementation") is integrated.

...