GTM Snippet Not Loading
The GTM snippet (<script>(function(w,d,s,l,i){...) and the data layer initialization are not appearing in the page source.
1. Container ID Not Configured
The module silently does nothing if the GTM Container ID is empty. This is the most common cause of a completely missing snippet.
Check: Go to Addons → Google Tag Manager. Verify that the Google Tag Manager Container ID field contains a value like GTM-XXXXXXX.
Fix: Enter your container ID and click Save.
2. Module Not Activated
The module hooks only register when the module is activated in WHMCS.
Check: Go to Setup → Addon Modules. Find Google Tag Manager and confirm the status shows Active. If not, click Activate.
3. Theme Is Not Outputting WHMCS Hooks
The module injects its output through WHMCS hooks (ClientAreaHeadOutput, ClientAreaHeaderOutput, ClientAreaFooterOutput). If your WHMCS theme does not call these hook output variables in its templates, the snippets will never appear — even if the module is working correctly.
Check: In your active theme's header.tpl (and footer.tpl), verify the following variables are present:
{$WHMCSGTM_datalayer_output}
{$clientareaheadoutput}
{$clientareaheaderoutput}
{$clientareafooteroutput}
Custom and third-party themes sometimes rename or omit these. Compare with the default Twenty-One theme to see what is expected.
Fix: Add the missing hook output variables in the appropriate locations of your theme template files.
The default WHMCS theme outputs hooks in the <head> and just before </body>. Ensure your custom theme follows the same pattern.
4. Caching Layer Serving Stale Pages
If you have a reverse proxy (e.g. Cloudflare, Varnish, LiteSpeed Cache) in front of your WHMCS installation, cached pages may not include the dynamically injected GTM snippet or data layer.
Check: Bypass your cache (add ?nocache=1 or use a browser in private/incognito mode with cache disabled) and check the page source again.
Fix: Configure your caching layer to exclude WHMCS pages from caching, or set cache rules to always serve the Set-Cookie / authenticated pages dynamically.
5. License Invalidated Settings
The module checks the license validity on every admin login (via the AdminLogin hook). If the license is expired, invalid, or unreachable, the module will automatically erase the GTM Container ID and GA Tracking ID from its settings. This causes the module to stop injecting any output on all pages.
Symptoms:
- Module was working, then suddenly stopped.
- GTM Container ID and/or GA Tracking ID fields are empty after you saved them.
- A
WHMCSGTM: License check failedentry appears in WHMCS Activity Log.
Check: Go to Utilities → Logs → Activity Log and search for WHMCSGTM. Look for a License check failed entry with a timestamp matching when the issue started.
Fix: Verify your license key is active in your Mimir Tech client area. Ensure the licensed domain matches the WHMCS installation domain. If the server cannot reach the license server, check any firewall or outbound connection restrictions.
6. PHP Error Breaking Hook Output
A PHP fatal or parse error in the module (or in a conflicting addon) can silently prevent the hook from returning output.
Check: Enable WHMCS error logging in Utilities → Logs → Module Log or check the WHMCS activity log for PHP errors. You can also temporarily enable display_errors in WHMCS configuration.php for debugging.
Fix: Share the error output with support if you cannot identify the source.