Ir al contenido de la documentación

Google Maps consent gating

Hold Google Maps iframes, API scripts and static images until the visitor grants preferences consent.

Última actualización:

CookieBeam's auto-blocking intercepts Google Maps resources before they reach the browser. In opt-in regions, Maps waits for the visitor to grant preferences consent. If your banner doesn't already include a preferences category, add one.

Inventory classifications and publisher rules you've set take precedence. A Maps host you've already classified as marketing still requires marketing consent. Adaptive and Lockdown also gate fetch, XHR and beacon requests to Maps hosts.

FormWhat happens before consent
Share "Embed a map" (www.google.com/maps/embed?pb=...)Iframe held, placeholder shown
Embed API (www.google.com/maps/embed/v1/place?key=...)Iframe held, placeholder shown
Legacy embed (maps.google.com/maps?...&output=embed)Iframe held, placeholder shown
JavaScript API (maps.googleapis.com/maps/api/js)Script held; no visual placeholder
Static Maps (maps.googleapis.com/maps/api/staticmap)Image held, placeholder shown

The Load map button grants every resource in the displayed category, not just the map itself. The placeholder follows the banner's shield theme, its buttons are keyboard-accessible, and it doesn't animate. The shield.loadMap translation accepts {c} for the category label.

Maps-specific API and tile hosts (maps.googleapis.com, maps.gstatic.com) share the preferences default. Other services on www.google.com aren't classified as Maps. The original URL, query parameters, API key and referrer policy are all preserved when the resource loads after consent. There's no privacy URL rewrite.

Installation limits

HTML parser or preload requests can start before interception or DOM observation kicks in. For a strict first-paint guarantee, leave out the live src and store the URL in a data attribute instead. Set src from a consent callback only after preferences consent. Don't assume inert author markup is automatically queued.

A theme bundle that has already initialized Maps code can't be unloaded or reliably restarted by blocking later requests. Defer that initializer until consent, using the Maps API's documented callback or dynamic import flow.

Blocked connections are rejected, not queued. Retry them after consent. Cross-origin iframe internals, workers, CSS background URLs, and previously captured native browser APIs are outside this gate. Consent withdrawal can't undo data already sent.

Republish your banner after installing this release. Existing published loader.js and latest.js bundles keep their old behavior until you republish. Check any existing inventory overrides that classify Maps tile hosts or www.google.com as necessary or ignored; those overrides still take precedence.

Category choice

Preferences preserves CookieBeam's existing optional-functionality classification for Maps. It's separate from the marketing category commonly used for video embeds. This default doesn't claim that every Maps API request sets advertising cookies.

Google documents iframe embedding, JavaScript API loading and static image requests.

To verify: clear the consent store, confirm no Maps request fires from a dynamically inserted resource, then grant preferences consent and confirm the expected request appears. Also test with only analytics accepted (Maps should stay held) and with your site's real theme initializer.