Logo

    Search

    What is Code Cube

    User management

    Notifications & alerts

    Tag Monitor

    DataLayer Guard

    Understanding & solving tracking errors

    Privacy & security

    FAQ

    Code-Cube.io documentation library
    Code-Cube.io documentation library
    ⚙️

    Set-up Tag Monitor (server-side)

    This guide walks you through the full setup of Code-Cube.io's Tag Monitor using Google Tag Manager server-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 and Code-Cube.io portal

    Implementation

    • Step 1 – Portal configuration
    • Step 2 – Import template in GTM (Server)
    • 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.io’s Tag Monitor.

    1.1 Domains & 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
    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

    • Go to the step 'Server-side error monitoring’ on the Tag Monitor configuration page
    • Add the GTM container IDs you want to enable monitoring for
    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.io 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 'Server-side error monitoring' in the Tag Monitor configuration page
    • Click "Download template"
    image

    2.2 Import template to GTM

    1. Open your GTM server-side 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.io portal
    2. Look for incoming data from your configured domain and container
    3. Check that tag names are being registered correctly

    Step 2. Import Code-Cube.io template in GTM

    2.1 Download the template

    1. Open the step 'Server-side monitoring' on the Tag Monitor configuration page.
    2. Click the download button to download the Tag Monitor template
    image

    2.2 Import template to GTM

    1. Open your Google Tag Manager server-side container.
    2. Navigate to "Templates".
    3. Click "New" in the "Tag Templates" section.
    image
    1. Click the three dots in the top right corner.
    2. Select "Import" and choose the downloaded Tag Monitor template.
    3. Save without making any modifications.
    image
    💡

    This template will soon be available in the Community Template Gallery for easier installation.

    Step 3. Configure the tag in GTM

    Set up the core Tag Monitor configuration to define how your implementation will collect and process data.

    3.1 Create the tag

    1. Create a new tag in your container.
    2. Select the imported Tag Monitor template as the tag type.
    3. Configure these required settings:
      • Database Name / Dataset ID: Copy this value from the Code-Cube.io configuration page, step 'Server-side monitoring'.
      • Table Name / Table ID: Enter "raw_data_server"
      • Metadata: Add key "exclude" with value "true"

    3.2 Set-up the trigger

    1. Create a new 'Custom Event' trigger
    2. Configure to fire on all events:
      • Event name: .*
      • Enable "Use regex matching"
    3. Add sampling for better performance:
      • Enable the built-in variable "Random Number"
      • Add rule: "Some custom events" where "Random Number" meets criteria.

    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
    💡

    The trigger can be customized following your own insights and requirements. For example you can add extra rules to include certain events or pages.

    3.3 Enable required variables

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

    4. Configure Tag Metadata

    Choose ONE of these methods:

    Option A: Automatic Update (Recommended)

    1. Navigate to "Configure tag names" in the 'Server-side monitoring' section of the configuration page.
    2. Click "Start bulk editing"
    3. Follow the guided process to update your container via API

    Option B: Manual Update

    For each tag in your container:

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

    Step 5: Deploy and Verify

    5.1 Publish Changes

    1. Submit and publish your workspace
    2. Select the appropriate environment (typically production)

    5.2 Verification

    1. Open the Tag Monitor dashboard in Code-Cube.io portal
    2. Check that data is flowing in from your container
    3. Verify that tag names are displaying correctly

    Troubleshooting

    Problem
    Possible Solution
    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 server performance is affected
    Template import fails
    Download template again; check for browser extensions blocking import