How to Troubleshoot Google Maps Blocking Issues with Complianz
Content
Many WordPress users rely on the Complianz plugin to manage cookie consent for GDPR and CCPA compliance. A common challenge is getting Google Maps to work correctly—either blocking it before consent or getting it to load properly afterward. This guide covers the most frequent issues and their solutions, based on community discussions.
Why Google Maps Blocking Can Be Tricky
Google Maps can be implemented on a website in many ways: through standard iframes, various WordPress plugins, custom JavaScript API integrations, or even page builder widgets. The Complianz plugin has built-in integrations for many common methods, but some custom or less common implementations may require extra configuration. The core issue is that Complianz must identify and block the specific scripts or iframes that load the map until the user provides consent.
Common Problems and Solutions
1. Map is Not Blocked Before Consent
Why it happens: Complianz does not recognize the script or iframe loading the map, often because it's loaded by a theme or plugin that isn't integrated by default.
Solution: Use the Script Center to manually block the script.
- Navigate to Complianz -> Integrations -> Script Center.
- Click "Add script to block".
- Enter a descriptive name (e.g., "Custom Google Maps").
- In the URL field, enter the core script URL that needs to be blocked. For many Google services, this is often a base URL like
maps.googleapis.com. As seen in the support threads, you can block an entire service domain; wildcards like*are not necessary. - Select the appropriate category (usually Marketing).
- Enable the toggle to activate the blocking.
- Save changes and clear your site and browser cache to test.
2. Map is Blocked But Doesn't Load After Consent
Why it happens: This is often a caching or script configuration conflict. Highly optimized caching plugins can break the script that reloads the map after consent is given.
Solution: Troubleshoot caching and optimization plugins.
- Temporarily disable all caching and optimization features (e.g., JS minification, deferral, or delay) in plugins like WP Rocket.
- If the map works with these features off, re-enable them one by one to identify the culprit. You will likely need to exclude the Complianz or Google Maps scripts from the problematic optimization setting.
- Ensure you have followed any specific guides for your caching plugin, as mentioned in the sample threads.
3. Map Loads But Has Display Issues (e.g., Wrong Height)
Why it happens: When a map is blocked, Complianz replaces it with a placeholder div. The styling of this placeholder may not always match the original map's dimensions.
Solution: Apply custom CSS.
- You can add CSS to target the placeholder and set a fixed height. The placeholder often has a class like
cmplz-placeholder-1(the number may vary). - Add the following code to Appearance > Customize > Additional CSS in your WordPress dashboard, adjusting the height value as needed:
.cmplz-placeholder-1 { height: 300px; } - For more specific targeting, you can prefix the selector with a page ID or class.
4. Map in AJAX-loaded Content Doesn't Fire Blocker
Why it happens: If your site uses AJAX to load content (e.g., a single-page application), the Complianz script may not scan the new content for elements that need to be blocked.
Solution: This typically requires a custom development solution to re-trigger Complianz's scanning function after new content is loaded via AJAX. The sample threads indicate this is a client-side issue that goes beyond a simple plugin setting.
Debugging Steps for All Issues
- Test with a Default Theme and Minimal Plugins: As one user discovered, a conflict with their theme or another plugin was preventing a Google Calendar from being blocked. Temporarily switching to a default theme like Twenty Twenty-Four and disabling other plugins can help identify a conflict.
- Check for Proper Integration: Always ensure the slider for the relevant integration (e.g., under Complianz -> Integrations -> Services for Google Maps) is enabled and that you have saved your settings.
- Clear Caches: Always clear your WordPress cache, server cache, and browser cache after making changes. One user found their popup calendar issue was simply a caching problem.
Remember, the 'Complianz – GDPR/CCPA Cookie Consent' team maintains detailed debugging guides for more complex scenarios involving custom code.
Related Support Threads Support
-
GeoDirectory problem?https://wordpress.org/support/topic/geodirectory-problem/
-
Exclude Google Map and FullEvents – Ovatheme Events from Complianzhttps://wordpress.org/support/topic/exclude-google-map-and-fullevents-ovatheme-events-from-complianz/
-
Blocking google maps on certain pageshttps://wordpress.org/support/topic/blocking-google-maps-on-certain-pages/
-
disabling Google calendarhttps://wordpress.org/support/topic/disabling-google-calendar/
-
very high maphttps://wordpress.org/support/topic/very-high-map/
-
Blocking notice on Google Map (JS API) loaded by ajax doesn’t firehttps://wordpress.org/support/topic/blocking-notice-on-google-map-js-api-loaded-by-ajax-doesnt-fire/
-
Plugin blocks Google cookieshttps://wordpress.org/support/topic/plugin-blocks-google-cookies/
-
Issues blocking Genially when embedded into MemberPress Coursehttps://wordpress.org/support/topic/issues-blocking-genially-when-embedded-into-memberpress-course/
-
Block GTranslatehttps://wordpress.org/support/topic/block-gtranslate/
-
can i use your plugin to get the google-map-compliant …https://wordpress.org/support/topic/can-i-use-your-plugin-to-get-the-google-map-compliant/
-
Google Maps not working even if the cookies are acceptedhttps://wordpress.org/support/topic/google-maps-not-working-even-if-the-cookies-are-accepted/
-
Blocking URLshttps://wordpress.org/support/topic/blocking-urls/
-
Design of blocker of YouTube and Google Mapshttps://wordpress.org/support/topic/design-of-blocker-of-youtube-and-google-maps/
-
disabling Google calendarhttps://wordpress.org/support/topic/disabling-google-calendar-2/
-
Plugin blocks opening Info box in Google Mapshttps://wordpress.org/support/topic/plugin-blocks-opening-info-box-in-google-maps/
-
Astra theme google maps integration via their APIhttps://wordpress.org/support/topic/astra-theme-google-maps-integration-via-their-api/
-
GeoIP maxmind file not loading + exception rules based on countryhttps://wordpress.org/support/topic/geoip-maxmind-file-not-loading-exception-rules-based-on-country/
-
Google Maps are blocked from loading, integration settings doesn’t workhttps://wordpress.org/support/topic/google-maps-are-blocked-from-loading-integration-settings-doesnt-work/
-
Block a google Calendar in a popuphttps://wordpress.org/support/topic/block-a-google-calendar-in-a-popup/
-
complianz to include GTranslate in Functionalhttps://wordpress.org/support/topic/complianz-to-include-gtranslate-in-functional/
-
Problems with pluginhttps://wordpress.org/support/topic/problems-with-plugin-24/
-
G111 on GCD not showing on websitehttps://wordpress.org/support/topic/g111-on-gcd-not-showing-on-website/
-
newsletter2gohttps://wordpress.org/support/topic/newsletter2go/
-
I am having a heck of a time disabling google maps from my wordpress page.https://wordpress.org/support/topic/i-am-having-a-heck-of-a-time-disabling-google-maps-from-my-wordpress-page/
-
Complainz is blocking Google Maps, Geocoding and Placeshttps://wordpress.org/support/topic/complainz-is-blocking-google-maps-geocoding-and-places/