General Data Protection Regulation (GDPR or DSGVO in Germain) is a law on data protection and privacy for people within the European Union. It applies to any data collected from the citizens of EU from anywhere in the world. GDPR aims to give EU citizens control over their personal data and to regulate the approach of international business.
The following tutorial will show you how to add a message before loading your map in order to inform your EU users that Google Maps may store their personal data like the IP address, location, etc… More details can be found at https://cloud.google.com/security/gdpr
Add the following code to the file “functions.php” of your theme/child theme (this code works with “Progress Map v5.6.2 and above!):
This code will reload the map page if the user accepts using Google Maps, otherwise, the code will redirect to another page (e.g. Hompage).
In the code, change ‘#’ by the hompage URL or any other link (e.g. ‘www.mywebsite.com/homepage’)!
add_action('cspm_do_before_map_load', function(){
wp_add_inline_script("cspm-script",
"if(!document.cookie.split('; ').find(row => row.startsWith('CSPM-UseGoogleMaps=true'))) {
window.stop();
var homepage_url = '#';
var message = 'This website uses Google Maps. I consent to Google receiving the IP address of my device and other technical data for the display of maps and for its own purposes. When activated, this data is transmitted to Google.';
var d = new Date();
var exdays = 1;
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = 'expires='+ d.toUTCString();
iziToast.question({
id: 'GDPR_DSGVO_warning',
title: '',
timeout: false,
message: message,
position: 'center',
transitionIn: 'fadeIn',
close: false,
overlay: true,
overlayClose: false,
drag: false,
zindex:99999,
toastOnce: true,
maxWidth: '500px',
buttons: [
['', function (instance, toast) {
instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
document.cookie = 'CSPM-UseGoogleMaps=true;' + expires;
window.location.reload();
}, true],
['', function (instance, toast) {
instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
document.cookie = 'CSPM-UseGoogleMaps=false;' + expires;
document.location = homepage_url;
}],
],
});
}"
);
});
In the same context
- Open the single post page inside a modal
- Programmatically change single map language based on the URL’s language attribute
- Synchronize the ACF map field with the map fields in “Progress Map”
- Set the zIndex of a specific marker
- Replace/override your map query settings to showcase diverse locations on any page
- Show locations based on a keyword search
- Display “Progress Map” metabox on “Envira Gallery” add/edit page
- How to add custom class names to the infoboxes
- How to add “Read More” link to the infobox content
- Programmatically change the content of the carousel items
- Programmatically change the content of the infobox
- Programmatically change the title of the infobox
- Trigger marker events
- Center the map on a specific marker on page load
- Open the locations/posts “Nearby places” map inside a modal
- Redirect to the single post on marker click
- Insert a map inside a taxonomy page and display locations based on the current taxonomy term
- Use marker popups to display the post ID
- Change the text of the button “Toggle Carousel”
- Use the StreetView image as the carousel items image
- Hide the Points of Interest from the map
- Import/Export your maps between WordPress websites
- Import/Export your map locations between WordPress websites