Search

Home

What is Code Cube

Privacy & security

FAQ

Set up Tag Monitor (server-side)

Set up Tag Monitor (server-side)

Tag Monitor checks in real time whether the tags in your Google Tag Manager server container fire correctly, and alerts you when they don't. New to Code-Cube.io? Start with What is Code-Cube.io?What is Code-Cube.io?

This guide walks you through the full server-side setup of Tag Monitor using Google Tag Manager (GTM). Setting up client-side monitoring? See Set up Tag Monitor (client-side)Set up Tag Monitor (client-side).

What will you do?

  • Configure your domains and containers in the Code-Cube.io portal
  • Import the Tag Monitor template into your GTM server container
  • Set up the tag with sampling and metadata
  • Publish and verify your implementation

⏰ Estimated time: 10 - 15 minutes

🔧 Requirements: Access to your GTM server container with Publish permission, and access to the Code-Cube.io portal

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

image
☝🏼

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

image
☝🏼

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 server container. This provides the logic needed to send tag data to Code-Cube.io.

2.1 Download the template

image

2.2 Import the template in GTM

  1. Open your GTM server container
  2. Go to "Templates" > "Tag Templates"
  3. Click "New"
  4. Click the three dots > "Import"
  5. Upload the downloaded file
  6. Save without making any changes
image

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

  1. Create a new tag
  2. Choose the imported Tag Monitor template as the tag type
  3. Fill in the required fields:
    • Database name: Copy from the configuration page
    • image
    • Consent: Set to 'No additional consent required'
    • Metadata: Add key exclude with value true
image

3.2 Set up the trigger

Use a Custom Event trigger with regex matching and optional sampling to control data volume.

  1. Create a new trigger
  2. Trigger type: Custom Event
  3. Event name: .* (match all)
  4. Enable "Use regex matching"
image

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.

  1. Enable the built-in variable "Random Number"
  2. Add the condition Random Number – less than or equal to – [value] to the trigger, using a value from the table below
Sample size
Value
0.5%
10737418
5%
107374182
10%
214748364
20%
429496729
25%
536870911
50%
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. Choose one of these options.

Option A: Automatic update (recommended)

  1. Go to 'Configure tag names' on the configuration page
  2. Click Start bulk editing
  3. Follow the guided process to update your GTM container via the API. See Bulk edit tags in Google Tag ManagerBulk edit tags in Google Tag Manager for details
image
💡

Tip: This saves time and ensures consistency across all your tags.

Option B: Manual update

For each tag in your container:

  1. Open Advanced Settings
  2. Check "Include tag name" under Additional Metadata
  3. Set the key name to name
image

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

  1. Open the Tag Monitor dashboard in the Code-Cube.io portal
  2. Look for incoming data from your configured domain and container
  3. 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 server performance 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