Legacy Mode
Legacy mode is activated automatically when the GA / GTM Tracking ID field is left empty. Instead of injecting tracking scripts, the plugin detects and manages scripts that already exist in your page.
What It Is
Many Joomla templates and extensions add Google Analytics or Tag Manager code directly into the page HTML. Legacy mode finds these scripts and removes them from the page until the visitor consents.
How Auto-Detection Works
The plugin scans the rendered page body using a pattern that matches:
google-analytics.com/analytics.js(Universal Analytics)googletagmanager.com/gtag(GA4 and GTM)
If any of these patterns are found in the HTML output, the plugin treats the page as having GA/GTM scripts.
What Happens
| Consent Status | Behavior |
|---|---|
| No decision yet | GA/GTM script references are stripped from the HTML. The consent dialog is shown. |
| Accepted | The page is served as-is — existing GA/GTM scripts remain untouched. |
| Declined | GA/GTM script references are stripped from the HTML. No consent dialog is shown. |
When to Use Legacy Mode
Use legacy mode when:
- Your template adds GA/GTM code that you cannot remove
- Another extension injects Google Analytics and you don't want to disable it
- You want consent management without changing your existing analytics setup
Limitations
| Feature | Managed Mode | Legacy Mode |
|---|---|---|
| Local script hosting | Yes | No |
| Script injection control | Full | Pattern-based stripping |
| GTM noscript iframe | Handled | Not managed |
| Template editing required | No | No |
Managed mode is recommended for most sites. It provides cleaner control and supports local script hosting. Use legacy mode only when you cannot remove existing GA/GTM code from your template or other extensions.
Switching from Legacy to Managed Mode
- Enter your GA4 Measurement ID or GTM Container ID in the plugin settings
- Remove the existing GA/GTM code from your template (optional but recommended)
- Save the plugin settings
The plugin will now inject the tracking script itself instead of relying on template code. If you don't remove the template code, both may inject scripts — so it's best to remove the template's GA/GTM code when switching to managed mode.