Google Maps may process device data (IP, etc.). For EU visitors, show a consent prompt before the map runs, using Ultimate’s cspm_do_before_map_load action (Progress Map 5.6.2+ / Ultimate).
This example uses the iziToast UI already available in typical Progress Map front-end stacks. Adapt the message and redirect URL to your privacy policy.
/**
* Ask for consent before Progress Map loads Google Maps.
*/
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 = 'https://www.example.com/'; // Change me
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: [
['Use Google Maps', function (instance, toast) {
instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
document.cookie = 'CSPM-UseGoogleMaps=true;' + expires;
window.location.reload();
}, true],
['Cancel', function (instance, toast) {
instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
document.cookie = 'CSPM-UseGoogleMaps=false;' + expires;
document.location = homepage_url;
}],
],
});
}"
);
} );
Important
- Replace
homepage_urlwith a real page (privacy policy or home). - This is a starting point, not legal advice — have your counsel review consent wording and cookie duration.
- If you already use a consent management platform (CMP), prefer integrating Ultimate with that CMP instead of a parallel cookie.
- See also Google’s GDPR documentation for Maps: https://cloud.google.com/security/gdpr
