How Consent Works
This page explains the step-by-step consent process, what gets blocked before consent, and the security measures protecting the flow.
Consent Flow

What Gets Blocked
Before the visitor makes a consent decision, the plugin ensures no contact with Google Maps:
- Map iframes are stripped from the HTML output (
google.com/maps/embed,maps.google.com, and component-specific markup) - The Maps API script (
maps.googleapis.com) is removed so no map JavaScript loads - Component and page-builder map markup (Widgetkit, Phoca, SP Page Builder, and others) is stripped
- No Google cookies are set
- No data — including the visitor's IP — is sent to Google's servers
- No map tiles are requested from Google's CDN
This applies to both detected maps and maps created with the {smartmap} shortcode — shortcode maps render as a consent placeholder until accepted. See The {smartmap} Shortcode.
If you turn on geo-detection, visitors outside your consent regions are auto-accepted by default; you can change this.
After Consent
Accept
- The consent cookie
slgm-consentis set toagree, valid for the whole site - On the next page load (and all subsequent loads while the cookie is valid), the original Google Maps code is left untouched
- Maps load and display normally
Decline
- The consent cookie
slgm-consentis set todecline - Map code continues to be stripped from the HTML on every page load
- The consent box is not shown again until the cookie expires
- Shortcode maps show a short notice that Google Maps was not loaded
Security Features
CSRF Protection
Every consent form submission includes a Joomla CSRF token. The plugin validates this token before setting the consent cookie. This prevents cross-site request forgery attacks that could set consent on behalf of a visitor.
Secure Cookie Flags
The consent cookie is set with:
- HttpOnly — Cannot be read or modified by JavaScript, preventing XSS-based cookie theft
- Secure — Only transmitted over HTTPS (when Force HTTPS is set to Entire Site)
- SameSite=Lax — The cookie is not sent with cross-site requests, preventing CSRF via third-party sites
Input Validation
- The consent value is strictly validated to only accept
agreeordecline - All user-facing text (headline, consent text, button labels) is escaped with
htmlspecialchars - Shortcode attributes are normalized, whitelisted, and clamped (zoom 1–21, map type to a fixed set, dimensions to
%/px) before any URL is built - A malformed custom regex pattern is ignored rather than breaking the page
Revoking Consent
There is no built-in revoke button. Visitors can revoke consent by:
- Clearing their browser cookies (the
slgm-consentcookie specifically, or all cookies) - Waiting for the cookie to expire (if set to a day-based lifetime)
Once the cookie is gone, the consent dialog appears again on the next visit.