These guidelines are constantly updated based on best practices we find along the way. Do you have any specific findings? Please help us get these docs as complete as possible.
This guide helps you debug common Google Tag Manager (GTM) tag errors (client-side) using Code Cube monitoring insights.
What will you do?
- Run general checks to understand the error context
- Identify issues caused by outdated templates or variables
- Or debug custom HTML tag problem
- Or fix tool specific errors like Google Ads, LinkedIn and TikTok
⏰ Estimated time: 15–30 minutes
🔧 Requirements: Access to GTM (client- and server-side), Code Cube portal
Step 1 - Initial checks to get started on debugging
Before diving into specific error types, run these foundational checks to understand the problem context:
- Version & timing analyses
- GTM container version: Older GTM versions may still be cached, even after publishing fixes. So errors might still show up, when actually already resolved in the newest version.
- Error timeline: Pinpoint when the error first appeared. Did it coincide with a GTM deployment?
- Page scope: Validate which specific pages are experiencing errors.
- Verify tag status
- Paused tags: Check if the failing tag is paused within GTM.
- Make sure to remove triggers from paused GTM tags.
- Delete unused tags to prevent container clutter.
- Error reproduction
- GTM Preview Console: Check for trigger, condition, or consent-related errors
- Browser Developer Console (F12): Look for JavaScript errors from custom HTML tags or third-party scripts
- Dependency and configuration checks
- Tag sequencing: Ensure dependent tags (consent, pixel configurations) fire in the right order.
- Consent settings: For Consent Mode tags (Google Ads, LinkedIn), verify appropriate consent is granted before tag execution
1. Navigate to a page where the tag was marked as 'failed'
2. Enable GTM Preview Mode
3. Use dual debugging approach:
Tip: For detailed insights on Code Cube errors, enable the BigQuery offload (premium+ feature) to access raw monitoring data. Please contact us if you require more information.
Step 2 - Tips for fixing common errors for specific tags
These are recurring error patterns observed across client implementations.
Outdated (custom) tag templates
Tag templates not updated for years may contain deprecated methods or mismatched logic.
Impact: Slower page rendering and cluttered console, but also missing user/conversion data, which causes incomplete retargeting audiences and reduced ROAS.
Fix:
- Review last modified date in GTM Templates.
- Compare with vendor's latest template version (if not build custom).
- Rebuild outdated templates or migrate to official maintained versions.
- Test and publish the new version.
Outdated variable templates
When outdated variable templatess are used in tags, they cause tag failures.
Impact: Slower page rendering and cluttered console, but also missing user/conversion data, which causes incomplete retargeting audiences and reduced ROAS.
Fix:
- Identify failing variable in tag configuration
- Update to supported template version
- Rebuild configuration if template is discontinued
- Validate data flow after updates
Custom HTML tags
1. Script timing issues
When a Custom HTML tag contains both configuration and async library load, order of execution is not guaranteed.
Example:
window.teads_adv_id and window.teads_e defined after async library call → initialization errors.
<script src="https://p.teads.tv/teads-fellow.js" async></script>
<script>
window.teads_e = window.teads_e || [];
window.teads_adv_id = XXXX;
</script>Fix: Define configuration before loading the async script:
<script>
window.teads_e = window.teads_e || [];
window.teads_adv_id = XXXX;
</script>
<script src="https://p.teads.tv/teads-fellow.js" async></script2. Missing Library Dependencies
If the external URL is unavailable, tags never execute successfully.
Example: BlueKai tag calling tags.bkrtx.com/js/bk-coretag.js → library unreachable → 134k failed calls.
Fix:
- Validate external script availability before deployment
- Implement fallback mechanisms where possible
- Contact vendors for deprecated URLs
- Migrate to maintained tag templates when available
Google Ads conversion tags
- Conversion ID / Label mismatch
- If even one character in the AW-XXXXXX or label is wrong, Google returns an error.
- Trigger misconfiguration
- If conversion tags fire on every page, not just on the thank-you page.
- On those non-conversion pages, required parameters (like
valueortransaction_id) are missing → Google counts them as errors.
Microsoft Ads conversion tags
Common issues & fixes:
- Load UET config tag on every page first
- Configure correct variable for 'UETQ variable ID' parameter (typically 'uetq')
- Properly configure Microsoft Consent Mode integration.
- Verify event parameters match Microsoft's expected format.
Facebook conversion tags
Common issues & fixes:
- Facebook configuration must fire before any events.
- All parameters must contain expected values (mismatched values cause errors).
- Verify Pixel ID accuracy.
LinkedIn Insight tags
- Known issue: Events fired before consent update cause errors.
Solution: Implement delayed firing:
- Wait for consent signal
- Add buffer time after consent update
- Then fire LinkedIn events
- Consider using tag sequencing for complex scenarios
Additional Resources
- Offload data to BigQuery
Need help with specific debugging scenarios? Contact our support team for personalized assistance.