Google Tag Coupled Sync (Legacy)

New to Google Tag? See the Google Tag Overview for general information about gtag.js and architecture options.

⚠️

This is the legacy coupled sync architecture. All three Google product configurations (GA4, CM360, Google Ads) are managed within a single sync. This architecture is deprecated—new implementations should use the decoupled sync.


What is the Coupled Google GTag Sync?

The coupled Google Gtag sync manages the gtag.js library lifecycle and handles GA4, CM360 Floodlight, and Google Ads configuration in a single sync. This sync:

  • Loads and manages the gtag.js library
  • Calls gtag('config', ...) for each configured product
  • Captures attribution identifiers (gclid, dclid, wbraid) from URL parameters
  • Configures Google Consent Mode across all products
  • Enriches server-side events with identifiers via context.providers.googleGtag

Considerations

  • Conversion Window Alignment - GCLID, DCLID, and WBRAID cookie lifetimes should be set to match the conversion windows configured in Google Ads and CM360/DV360. Misalignment results in EXPIRED_EVENT errors — events are delivered successfully at the API level but rejected by Google with errors in the response body.
  • Google Ads Partial Failure Responses - The Google Ads API returns HTTP 200 even when individual conversions fail. Errors such as EXPIRED_EVENT or UNAUTHORIZED_CUSTOMER appear in the response body under partialFailureError and do not trigger automatic retry. Monitor response bodies directly or via GCP to catch silent conversion failures.
  • CM360 Retry Behavior - Unlike Google Ads, CM360 returns actual HTTP errors when conversions fail (e.g., NOT_FOUND when an identifier is not yet available). These failures are automatically queued for retry by MetaRouter's retry mechanism.
  • Processing Delays - Google recommends delaying conversion uploads after identifier capture. Without a configured delay, CM360 relies on retry to recover from early delivery; Google Ads does not retry. Contact your MetaRouter Customer Support Rep to configure a delay at the integration level.
  • IAB TCF Consent - Enabling IAB TCF Consent requires an IAB TCF v2.0-compliant CMP installed on the site with the __tcfapi JavaScript API exposed, and the Consent Policy set to "Explicit Consent" in MetaRouter Advanced Settings. Vendor ID for CM360 and Google Ads is 755.
  • Consent Mode and CMP Compatibility - The decoupled sync architecture includes more robust handling of consent state changes and non-standard CMP configurations. Contact your MetaRouter Customer Support Rep if your site does not use OneTrust.

Architecture Overview

Google Gtag (Single Sync)
├── GTAG.js Tag ID (GA4 Measurement ID)
├── Destination IDs (optional — Google Ads AW-XXXXXX)
├── Floodlight Advertiser ID Object (optional — CM360)
├── Consent Mode Settings
├── Cookie Lifetime Settings
└── Session Settings (GA4)

Common Configuration Fields

These fields apply across all product configurations within this sync.

FieldDescriptionRequiredDefault
GTAG.js Tag IDYour GA4 Measurement ID (e.g., G-XXXXXXXXX). Found in GA4 Data Streams. Also accepts GT- and AW- formats.Yes
Consent TypeConsent category required before sync fires.Yes
IAB TCF ConsentEnable IAB TCF v2.0 integration. Vendor ID: 755. Prerequisites: Explicit Consent policy enabled; IAB TCF v2.0-compliant CMP installed; CMP exposes __tcfapi.NoDisabled
Cookie Lifetime (in days)General cookie expiration period.Yes45
Fire on Re-SyncRe-triggers sync on identify() calls.YesON
Send MetaRouterSync to GA4Fires a MetaRouterSync event to GA4 for validation.YesON
Enable Google Consent ModeEnables consent categories: ad_storage, ad_user_data, ad_personalization, analytics_storage.YesOFF
Advanced Consent Mode TypeAdvanced (ON) or basic (OFF) consent mode when consent mode is enabled.YesON
Create Session IDGenerates and manages GA4 session ID.YesON
GCLID Cookie Lifetime (in days)Expiration for Google Click ID cookie.No90
DCLID Cookie Lifetime (in days)Expiration for Display Click ID cookie.No90
WBRAID Cookie Lifetime (in days)Expiration for WBRAID (iOS web-to-app) cookie.No90
Send MetaRouterReSync Event With Google TagFires a re-sync event via Google Tag on re-sync.NoON

Product-Specific Configuration

GA4

No additional GA4-specific fields beyond the common fields above. GA4 tracking is enabled by the GTAG.js Tag ID (G-XXXXXXXXX) in the common fields.


CM360 Floodlight

FieldDescriptionRequiredDefault
Floodlight Advertiser ID ObjectJSON array of Floodlight advertiser configurations (see format below).Yes
DCLID Cookie Lifetime (in days)Expiration for Display Click ID cookie used for DV360/CM360 attribution.No90

Cookie Lifetime Best Practice: Set DCLID Cookie Lifetime to align with your CM360/DV360 attribution window.

Floodlight Advertiser ID Object format - This field controls which Floodlight activities the MetaRouter sync fires as conversion events—specifically to register the MetaRouter anonymous ID (matchId) with CM360 at the moment of the page visit, so it can later be matched against server-side conversion events. Only include activities designated for this sync-time ID capture.

[
  {
    "group": "teamint",
    "activityTag": "syncn0",
    "advertiserID": "14780324"
  },
  {
    "group": "page",
    "activityTag": "pagei0",
    "advertiserID": "14780324",
    "matchIDEnumKey": "u53"
  }
]

Note: Only include Floodlight activities used for syncing purposes—do not add all Floodlight activities.

FieldCM360 LocationNotes
activityTag"Activity Tag String" columnRequired
advertiserIDYour CM360 Advertiser IDWorks with or without DC- prefix
group"Group Tag String" columnRequired
matchIDEnumKeyCustom Floodlight variable (e.g., u53)Optional

Google Ads

FieldDescriptionRequiredDefault
Destination IDsJSON array of Google Ads Conversion Tracking IDs. Format: ["AW-123456789"].No[]

Best Practice — Conversion Window Alignment: Set cookie lifetimes to match your Google Ads conversion window. Using a gclid older than your conversion window results in EXPIRED_EVENT errors. See Google Ads - Conversions troubleshooting for details.


Setup

  1. From the Pipelines page, find the pipeline for your web property
  2. Hover over the three-dot dropdown and select "Build AJS File"
  3. In the Identity Syncs section, add Google Gtag
  4. Configure the Common Configuration Fields above
  5. Configure fields for each Google product you are enabling (GA4, CM360, Google Ads)
  6. Click Save and Build File
  7. Deploy your AJS file to propagate changes

Technical Details

Sync Behavior

  1. Loads and manages the gtag.js library
  2. Calls gtag('config', ...) for each configured product with user_id and page_referrer
  3. Captures attribution identifiers (gclid, dclid, wbraid) from URL parameters
  4. Creates/retrieves GA4 client ID and session information (when GA4 is configured)
  5. Fires Floodlight conversion events (when CM360 is configured)
  6. Fires MetaRouterSync event to GA4 (when enabled)
  7. Re-triggers on identify() calls when Fire on Re-Sync is enabled
  8. Applies Google Consent Mode when enabled

Storage Markers

Storage TypeKeyTTLDescription
Cookie_ga400 daysGA4 client ID
Cookie_ga_{tagID}400 daysProperty-specific GA4 client ID
Cookie_gcl_awConfigurable (default 90 days)Google Click ID
Cookie_gcl_dcConfigurable (default 90 days)Display Click ID
Cookie_gcl_gbConfigurable (default 90 days)WBRAID (iOS web-to-app)
Cookie_gcl_au90 daysGoogle Ads conversion linker
Cookie_meta_CM360_gtag_called365 daysCM360 sync execution marker
IndexedDB[prefix]_googleGtag_ga_library_loadedsyncFrequencyLibrary load marker

Server-Side Enrichment

Adds to context.providers.googleGtag:

{
  "googleGtag": {
    "data": {
      "clientID": "1234567890.1234567890",
      "sessionID": "1595262825000",
      "sessionCount": 3,
      "gclid": "CjwKCAjwt-OwBhBnEiwAgwzrUkyN...",
      "dclid": "CKDdz-fE_IUDFYtTCQkdbyMOPg",
      "wbraid": "...",
      "timezone_offset": "-300"
    }
  }
}

Fields populated depend on which products are configured and which identifiers are present on the page.


Processing Delay Recommendations

Google recommends delaying conversion uploads to ensure identifiers are fully available:

IdentifierRecommended Delay
matchId~2 hours after Floodlight call
dclid~1 hour after click
gclid~1 hour after click
wbraid~1 hour after click

To enable event delay: Contact your MetaRouter Customer Support Rep to configure a delay for conversions.

Without delay configured: CM360 uses a fail-then-retry pattern — events that fail due to identifier unavailability (NOT_FOUND) are automatically queued for retry. Google Ads returns HTTP 200 with errors in the response body and does not automatically retry.


Verification

GA4

  • Network tab: filter for google-analytics.com, look for MetaRouterSync event requests
  • Cookies: confirm _ga cookie is present
  • GA4 Realtime: verify events appear with correct client IDs
  • MetaRouter event debugger: confirm context.providers.googleGtag.data.clientID and sessionID

CM360

  • Network tab: filter for googleadservices.com or doubleclick.net, look for conversion requests with Floodlight activity IDs and match_id
  • Cookies: confirm _gcl_dc cookie and _meta_CM360_gtag_called marker
  • CM360 Dashboard: check Floodlight reporting (may take up to 2 hours)
  • MetaRouter event debugger: confirm context.providers.googleGtag.data.dclid

Google Ads

  • Network tab: filter for googleadservices.com, look for config calls with your Ads ID
  • Cookies: confirm _gcl_aw (gclid) and _gcl_gb (wbraid) cookies
  • MetaRouter event debugger: confirm context.providers.googleGtag.data.gclid