Tag Monitor checks in real time whether the tags in your Google Tag Manager container fire correctly, and alerts you when they don't. New to Code-Cube.io? Start with What is Code-Cube.io?
This guide walks you through the full client-side setup of Tag Monitor using Google Tag Manager (GTM).
What will you do?
- Configure your domains and containers in the Code-Cube.io portal
- Import the Tag Monitor template into GTM
- Set up the tag with sampling and metadata
- Publish and verify your implementation
⏰ Estimated time: 10 - 15 minutes
🔧 Requirements: Access to Google Tag Manager with Publish permission on the container, and access to the Code-Cube.io portal
- Step 1 – Portal configuration
- 1.1 Domains and time zone
- 1.2 GTM container settings
- Step 2 – Import the template in GTM
- 2.1 Download the template
- 2.2 Import the template in GTM
- Step 3 – Configure the tag in GTM
- 3.1 Create the tag
- 3.2 Set up the trigger
- 3.3 Enable required variables
- Step 4 – Configure tag metadata
- Option A: Automatic update (recommended)
- Option B: Manual update
- Step 5 – Deploy and verify
- 5.1 Publish changes
- 5.2 Verify
- Troubleshooting
- Next steps
Step 1 – Portal configuration
Before configuring anything in GTM, define which domains and containers should be monitored with Tag Monitor.
1.1 Domains and time zone
- Go to the step 'General settings' on the Tag Monitor configuration page
- Add all domains you want to monitor
- Select the appropriate time zone

Important: Alerts and data will only be available for domains listed here. If your domain is not added, Tag Monitor won't process any data.
1.2 GTM container settings
- Go to the step 'Client-side error monitoring' on the Tag Monitor configuration page
- Add the GTM container IDs you want to enable monitoring for

Important: Only containers listed here are monitored. If a container ID is not added, Tag Monitor won't process any data from it.
Step 2 – Import the template in GTM
Install the Tag Monitor tag template in your GTM container. This provides the logic needed to send tag data to Code-Cube.io.
2.1 Download the template
- Go to 'Client-side error monitoring' on the Tag Monitor configuration page
- Click "Download template"

2.2 Import the template in GTM
- Open your GTM container
- Go to "Templates" > "Tag Templates"
- Click "New"
- Click the three dots > "Import"
- Upload the downloaded file
- Save without making any changes

Step 3 – Configure the tag in GTM
Now configure how the Tag Monitor tag collects and sends data, including basic settings and sampling.
3.1 Create the tag
- Create a new tag
- Choose the imported Tag Monitor template as the tag type
- Fill in the required fields:
- Database name: Copy from the configuration page
- Consent: Set to 'No additional consent required'
- Metadata: Add key
excludewith valuetrue


3.2 Set up the trigger
Use a Custom Event trigger with regex matching and optional sampling to control data volume.
- Create a new trigger
- Trigger type: Custom Event
- Event name:
.*(match all) - Enable "Use regex matching"

Optional: add sampling
Sampling minimizes the impact on performance in high-traffic environments.
Not sure what to pick? Start with 10% and scale up if needed.
- Enable the built-in variable "Random Number"
- Add a condition to the trigger so the tag only fires when
Random Numbermatches one of the values below
GTM's Random Number ranges from 0 to 2,147,483,647, so each value selects roughly that share of events.
Sample size | Variable | Condition | Value |
0.5% | Random Number | less than or equal to | 10737418 |
5% | Random Number | less than or equal to | 107374182 |
10% | Random Number | less than or equal to | 214748364 |
20% | Random Number | less than or equal to | 429496729 |
25% | Random Number | less than or equal to | 536870911 |
50% | Random Number | less than or equal to | 1073741823 |
Tip: You can customize the trigger to your own insights and requirements, for example by adding extra rules to include certain events or pages.
3.3 Enable required variables
Tag Monitor uses these built-in variables to identify the container the tag was fired from.
- Go to Variables > Built-in Variables
- Enable:
- Container ID
- Container Version
Step 4 – Configure tag metadata
Add your tag names to the outgoing requests for easier debugging and reporting.
Option A: Automatic update (recommended)
- Go to 'Configure tag names' on the configuration page
- Click Start bulk editing
- Follow the guided process to update your GTM container via the API. See
Bulk edit tags in Google Tag Manager for details

Option B: Manual update
For each tag in your container:
- Open Advanced Settings
- Check "Include tag name" under Additional Metadata
- Set the key name to
name

Step 5 – Deploy and verify
Once everything is configured, go live and confirm everything works as expected.
5.1 Publish changes
- Submit and publish your GTM workspace
- Choose the right environment (usually production)
5.2 Verify
- Open the Tag Monitor dashboard in the Code-Cube.io portal
- Look for incoming data from your configured domain and container
- Check that tag names are being registered correctly
Troubleshooting
Problem | What to check |
No data in dashboard | Check that trigger conditions are met; verify the sampling rate isn't too low |
Missing tag names | Ensure metadata is configured for all tags |
Performance issues | Consider reducing the sampling rate if site speed is affected |
Template import fails | Download the template again; check for browser extensions blocking the import |
Still stuck? Contact the Code-Cube.io team.
Next steps
Notifications & alerts: choose where and how you receive alerts
Set up Tag Monitor (server-side): extend monitoring to your server-side container
Set up Tag Volume monitoring: get alerted when tag volume drops
Understanding & solving errors: learn how to read and fix the errors Tag Monitor reports