Skip to main content

Google Tag Manager Integration

Integrate services through Google Tag Manager with Biskoui consent management for centralized tag control.

Prerequisites

If you haven’t chosen an integration mode yet, start with Service integration modes.

  • Google Tag Manager must already be installed on your website
  • Biskoui consent management must be installed and configured on your site

Service Integration via GTM

This guide shows how to integrate individual services (like Google Analytics, Facebook Pixel, etc.) through Google Tag Manager while respecting user consent managed by Biskoui.

When biskoui has finished loading and the user's consent state is available, it pushes a ready event to the data layer:

{
event: "biskoui_ready",
acceptedServices: ["google_analytics", "google_maps"]
}

Use biskoui_ready as a GTM Custom Event trigger when a tag or variable needs biskoui to be fully loaded. The acceptedServices field contains the accepted service keys at initialization time. GTM variables triggered by this event can also safely call the biskoui JavaScript API, for example biskoui.hasAcceptedService("google_analytics"). You should not need to add an arbitrary delay before reading consent state.

For each service configured with GTM integration, biskoui also pushes the service activation event configured in the console, for example:

{
event: "biskoui_activate_facebook_pixel";
}

This activation event is the consent gate for that service.

Activation event lifecycle

A GTM service activation event, such as biskoui_activate_facebook_pixel, is emitted:

  • once per page load for the service, if the visitor has already accepted that service;
  • immediately on the current page when the visitor accepts the service for the first time or updates preferences to accept it;
  • after the SDK has loaded the consent state and before the banner is rendered.

It is not emitted when the service is rejected. It is also deduplicated during a single page load: if a visitor accepts, rejects, and accepts the same service again without reloading, biskoui does not push the activation event a second time.

Use the biskoui service activation event as the primary trigger for tags that must only run after consent. Add your page or URL constraints to the same trigger.

For example, for a Facebook Pixel event that should only fire on a Cartes confirmation page:

  1. Create a GTM Custom Event trigger with event name biskoui_activate_facebook_pixel.
  2. Add trigger conditions such as Page URL contains /cartes/confirmation or your page-type variable.
  3. Attach the Facebook event tag directly to that trigger.

Avoid using the Facebook Pixel base tag as a GTM Setup Tag for page-view or URL-triggered event tags as a consent mechanism. In GTM, a setup tag can fire immediately before the sequenced tag even if the setup tag's own trigger did not match. That can bypass the intended biskoui activation trigger.

If the tag requires initialization before event tracking, either initialize and send the event in the same consent-gated tag, or make both the initialization tag and event tag consent-gated by the same biskoui_activate_* trigger plus the appropriate page conditions.

Benefits of GTM Integration

  • Manage service activation based on user consent
  • Centralized control of all tracking services
  • Automatic consent-based tag firing
  • Simplified compliance management

Adding a Service via GTM

You'll need to repeat this process for each service you want to integrate with consent management.

Step 1: Configure Service in Biskoui Console

  1. Log into the Biskoui console at https://admin.biskoui.ch
  2. Navigate to the Services tab
  3. Click Add a service
  4. Search for and select the service you want to add
  5. In the Integration mode dropdown, select Google Tag Manager (GTM)
  6. Copy the provided event trigger using the Copy button

Step 2: Create Trigger in GTM

  1. Open your Google Tag Manager console at https://tagmanager.google.com
  2. Go to Triggers and click New
  3. Name your trigger (e.g., "Biskoui Analytics Consent")
  4. Click the trigger configuration icon
  5. Select Custom Event as the trigger type
  6. Paste the event trigger copied from Biskoui console
  7. Click Save

Step 3: Create and Configure Tag

  1. Go to Tags and click New
  2. Name your tag (e.g., "Google Analytics - Consent Based")
  3. Click the Tag Configuration icon
  4. Choose the appropriate tag type:
    • For built-in services: Select from GTM's pre-built list (e.g., "Google Analytics: GA4 Configuration")
    • For custom services: Select Custom HTML and paste the service's script
  5. Configure the tag settings as needed
  6. Click the Triggering icon
  7. Select the trigger you created in Step 2
  8. Click Save

Step 4: Test and Publish

  1. Use GTM's Preview mode to test the integration
  2. Verify that tags fire only when consent is given
  3. Test consent acceptance and withdrawal scenarios
  4. Submit and Publish your container when ready

Common Service Examples

Google Analytics 4

  1. In Biskoui Console: Add Google Analytics service, select GTM integration
  2. In GTM:
    • Create trigger with Biskoui's GA consent event
    • Create GA4 Configuration tag
    • Set Measurement ID and link to consent trigger

Facebook Pixel

  1. In Biskoui Console: Add Facebook Pixel service, select GTM integration
  2. In GTM:
    • Create trigger with Biskoui's Facebook consent event
    • Create Custom HTML tag with Facebook Pixel code
    • Link tag to consent trigger
  1. In Biskoui Console: Add Google Ads service, select GTM integration
  2. In GTM:
    • Create trigger with Biskoui's Google Ads consent event
    • Create Google Ads Conversion Tracking tag
    • Configure conversion settings and link to trigger