Search

User management

Privacy Regulations

Changelog

Glossary

FAQ

🚀

Set-up Tag Monitor (client-side)

This guide walks you through the full setup of Code Cube's Tag Monitor using Google Tag Manager.

What will you do?

  • Configure your domains and containers in the Code Cube 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 (preferably admin) and Code Cube portal

Implementation

  • Step 1 – Portal configuration
  • Step 2 – Import template in GTM
  • Step 3 – Configure the tag in GTM
  • Step 4 – Configure tag metadata
  • Step 5 – Deploy and verify

Step 1 – Portal configuration

Before configuring anything in GTM, define which domains and containers should be monitored with Code Cube’s Tag Monitor.

1.1 Domains & 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: Alerts and data will only be available for domains listed here. If your domain is not added, Tag Monitor won’t process any data.

Step 2 – Import Code Cube 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.

2.1 Download the template

image

2.2 Import template to GTM

  1. Open your GTM 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
  7. 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"
  5. image

You can add sampling to the trigger, which will help to minimze the impact on performance for high-traffic environments.

  • Enable the built-in variable "Random Number"
  • Add a condition to only fire the tag when Random Number matches your sampling logic

Recommended Sampling Rates:

segment of 0.5%
random number
less then or equal to
10737418
segment of 5%
random number
less then or equal to
107374182
segment of 10%
random number
ends on
1*
segment of 20%
random number
less then or equal to
429496729
segment of 25%
random number
less then or equal to
536870911
segment of 50%
random number
less then or equal to
1073741823
💡
Tip: The trigger can be customized following your own insights and requirements. You can, for example, add extra rules to include certain events or pages. Not sure what to pick? Start with 10% and scale up if needed.

3.3 Enable required variables

Some built-in variables should be enabled, as these are used by Tag Monitor to identify the container the tag was fired from.

  • Go to Variables > Built-in Variables
  • Enable:
    • Container ID
    • Container Version

4. Configure Tag metadata

Add your tag names to the outgoing requests for easier debugging and reporting.

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 API
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 key name to name
image

Step 5 – Deploy and verify

Once everything is configured, it’s time to 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 portal
  2. Look for incoming data from your configured domain and container
  3. Check that tag names are being registered correctly

Troubleshooting

No data in dashboard
Check that trigger conditions are met; verify sampling rate isn't too low
Missing tag names
Ensure metadata is configured for all tags
Performance issues
Consider reducing sampling rate if site speed is affected
Template import fails
Download template again; check for browser extensions blocking import