Troubleshooting Google Maps and Other Map Blocking Issues in Complianz
Content
If you're using the Complianz plugin on your WordPress site, you might encounter issues where Google Maps, OpenStreetMap (OSM), or other map services don't display correctly. This is a common point of confusion, as the plugin's core function is to block such services until a user provides consent. This article explains why these issues occur and provides the most effective solutions based on community experience.
Why Do Maps Disappear or Not Load with Complianz?
The primary purpose of the Complianz plugin is to ensure compliance with privacy regulations like GDPR and CCPA. A key part of this is blocking services that place marketing or tracking cookies—like Google Maps—until a user explicitly consents to them. This expected behavior can sometimes manifest in ways that seem like bugs:
- Blank Space Instead of a Placeholder: The map is blocked, but no placeholder image or "Accept Cookies" button appears, leaving an empty gap on the page.
- Map Fails to Load After Consent: The user accepts cookies, but the map still doesn't appear, often requiring a manual page refresh.
- Console Errors: Errors like
Uncaught ReferenceError: google is not definedappear in the browser's console, indicating a script loading problem. - Layout Issues: The placeholder might inject HTML elements that disrupt your page's styling.
These problems are almost always due to one of two reasons: a missing integration for your specific map plugin/theme or a styling conflict with the placeholder.
Common Solutions for Map Issues
1. Check and Configure Integrations
Complianz has built-in integrations for many popular map plugins and themes. If your specific tool isn't supported, the blocking may not work correctly.
- Navigate to: Complianz -> Integrations -> Services.
- Ensure: The "Google Maps" service is enabled and the "Placeholder" checkbox is ticked.
- Then check: Complianz -> Integrations -> Plugins for any specific integration related to your map plugin (e.g., WP Store Locator, Modern Events Calendar). Enable it if available.
2. Verify Placeholder Settings
A placeholder should appear where the map is blocked. If it doesn't, a simple setting might be disabled.
- Navigate to: Complianz -> Settings -> Cookies.
- Ensure: The setting "Disable placeholder insertion" is NOT enabled.
3. Apply a CSS Fix for Placeholder Styling
If the placeholder appears but breaks your layout (e.g., doesn't respect the container's height), custom CSS can often resolve it. This is a frequent fix for maps in page builders like Oxygen or Divi.
.cmplz-placeholder-parent {
height: inherit;
}
Add this code to your theme's "Additional CSS" section or your page builder's custom CSS field.
4. Create a Custom Integration (For Developers or Custom Code)
If there is no pre-built integration for your map solution, you will need to create a custom one. This is common for custom-coded maps, lesser-known plugins, or maps loaded via AJAX.
The Complianz team provides a detailed developer's guide for debugging Google Maps. The guide explains how to identify the scripts to block and how to write a Must-Use (mu-)plugin to handle the blocking and reloading process correctly.
5. Force a Page Reload After Consent
For maps that load correctly on the first visit but fail after a page refresh (or vice versa), a simple workaround is to force the page to reload once the user gives consent. This can ensure all scripts are re-executed in the correct order. This typically requires adding a small code snippet via a mu-plugin.
When to Suspect a Different Problem
If you have tried the steps above and your map still does not function, consider these possibilities:
- Caching: Always clear your website's cache and your browser's cache after making any changes.
- Plugin Conflicts: Temporarily disable other plugins to test for a conflict. A performance or optimization plugin might be interfering with how Complianz blocks and reloads scripts.
- Theme Conflicts: Test with a default WordPress theme (like Twenty Twenty-Four) to rule out an issue specific to your theme.
Successfully managing maps with Complianz often comes down to ensuring the plugin correctly identifies and handles the scripts from your specific map implementation. Using the built-in integrations and applying targeted CSS or custom code for unique setups will resolve the vast majority of issues.
Related Support Threads Support
-
Google Maps Embed stopped workinghttps://wordpress.org/support/topic/google-maps-embed-stopped-working/
-
Placeholder adds additional empty paragraph tagshttps://wordpress.org/support/topic/placeholder-adds-additional-empty-paragraph-tags/
-
Google Maps blocked after reload even if cookies accepted (Complianz issue)https://wordpress.org/support/topic/google-maps-blocked-after-reload-even-if-cookies-accepted-complianz-issue/
-
Mappress plugin not workinghttps://wordpress.org/support/topic/mappress-plugin-not-working/
-
Modern events calendar – complianzhttps://wordpress.org/support/topic/modern-events-calendar-complianz/
-
Google Maps not displayinghttps://wordpress.org/support/topic/google-maps-not-displaying-5/
-
Google Map API not working with Complianzhttps://wordpress.org/support/topic/google-map-api-not-working-with-complianz/
-
Blank area / non functional button when using wp-store locatorhttps://wordpress.org/support/topic/blank-area-non-functional-button-when-using-wp-store-locator/
-
Google maps error with integrationhttps://wordpress.org/support/topic/google-maps-error-with-integration/
-
WP Google Maps Plugin: Map is not loading because of Complianzhttps://wordpress.org/support/topic/wp-google-maps-plugin-map-is-not-loading-because-of-complianz/
-
Complianz Plugin makes Leaflet Map not workhttps://wordpress.org/support/topic/complianz-plugin-makes-leaflet-map-not-work/
-
Google Maps Placeholder Not Workinghttps://wordpress.org/support/topic/google-maps-placeholder-not-working/
-
Google Maps with Hivepress doesn’t workhttps://wordpress.org/support/topic/google-maps-with-hivepress-doesnt-work/
-
Block Premium Addon Elementor Google Maphttps://wordpress.org/support/topic/block-premium-addon-elementor-google-map/
-
Google Maps not displaying at certain sizehttps://wordpress.org/support/topic/google-maps-not-displaying-at-certain-size/
-
Error on Geodirectory integrationhttps://wordpress.org/support/topic/error-on-geodirectory-integration/
-
Google Maps not showing after consenthttps://wordpress.org/support/topic/google-maps-not-showing-after-consent/
-
maps not loadinghttps://wordpress.org/support/topic/maps-not-loading-6/
-
Divi Google map not showinghttps://wordpress.org/support/topic/divi-google-map-not-showing/
-
WP Maps and Complianzhttps://wordpress.org/support/topic/wp-maps-and-complianz/
-
Google Maps – ReferenceError: google is not defined..https://wordpress.org/support/topic/google-maps-referenceerror-google-is-not-defined/
-
Divi Google Map problemhttps://wordpress.org/support/topic/divi-google-map-problem/
-
Google Maps placehoder : CSS rule added continuouslyhttps://wordpress.org/support/topic/google-maps-placehoder-css-rule-added-continuously/
-
OpenStreetMap via Ultimate Maps not loading after consenthttps://wordpress.org/support/topic/openstreetmap-via-ultimate-maps-not-loading-after-consent/
-
Placeholder not showing for OSMhttps://wordpress.org/support/topic/placeholder-not-showing-for-osm/
-
Errors picked up from SEO analysishttps://wordpress.org/support/topic/errors-picked-up-from-seo-analysis/
-
Google Maps via Modern Events Calendarhttps://wordpress.org/support/topic/google-maps-via-modern-events-calendar-2/
-
Google maps iframe position shifted by use of Complianzhttps://wordpress.org/support/topic/google-maps-iframe-position-shifted-by-use-of-complianz/
-
Google Maps not showing until you accepthttps://wordpress.org/support/topic/google-maps-not-showing-until-you-accept/
-
Google Maps integration & placeholderhttps://wordpress.org/support/topic/google-maps-integration-placeholder/
-
Error Google Maps : google is not definedhttps://wordpress.org/support/topic/error-google-maps-google-is-not-defined/
-
Google Maps Placeholder Image Sizehttps://wordpress.org/support/topic/google-maps-placeholder-image-size/
-
Conflict with Spectra Google Maps blockhttps://wordpress.org/support/topic/conflict-with-spectra-google-maps-block/
-
Google maps not showing on ajax loadhttps://wordpress.org/support/topic/google-maps-not-showing-on-ajax-load/
-
Plugin Complianz – OpenStreetMaphttps://wordpress.org/support/topic/plugin-complianz-openstreetmap/
-
Placeholder div with no class is causing issueshttps://wordpress.org/support/topic/placeholder-div-with-no-class-is-causing-issues/