In the following, we will show you how to use Google Maps within WP Gridbuilder in a GDPR-compliant way.
Step 1 - Create Script Blocker
In the Borlabs Cookie menu, click Script Blocker and then Add New.
Set page and search phrase
Now you have to select the page on which you have embedded the map. In our example, this is the page Fotospots. Add wpgb-map-js in the field Search phrases.
This will ensure that only the URLs we are looking for are found. Then click Scan.
Configure Script Blocker and block JavaScript handles
After your site has been scanned and you clicked Next, you need to set an ID and name for your Script Blocker. For ID enter wpgb-map and for name WP Gridbuilder Map. Set the status to ON.
Now you have to select the appropriate JavaScript handles that should be blocked by the Script Blocker. Now you can create the Script Blocker.
Copy code for Content Blocker
After the Script Blocker is created, you have to copy the code for the Content Blocker to the clipboard. We will need it in a moment to set up a working Content Blocker in the second step.
Step 2 - Google Maps Content Blocker
Select the already existing Google Maps Content Blocker and click on the pencil icon to be able to edit it.
Configure Content Blocker
Now you can paste the already copied code for the Content Blocker in JavaScript - Global (which you have already copied to the clipboard).
Important: Activate the option Execute global code first!
Afterwards, you have to add the following code under JavaScript - Initialization:
window.dispatchEvent(new Event('wpgb.loaded'));
Now scroll up in the settings to the CSS option and add the following CSS code after line 9:
.BorlabsCookie + .wpgb-facet > fieldset > .wpgb-map-facet { display: none; }
Step 3 - WP Gridbuilder and Google Maps in Gutenberg Editor
In order for Google Maps to be blocked with WP Gridbuilder output, you must first copy the shortcode in Content Blocker.
Then go to the page where the grid is output and paste the Content Blocker shortcode above Google Maps.
You can delete the note …block this….