Skip to main content

Google Gtag

Web Source code Package

The Google Gtag destination provides a unified interface for sending events to Google Analytics 4 (GA4), Google Ads, and Google Tag Manager (GTM) through a single destination configuration.

Installation

npm install @walkeros/web-destination-gtag

Setup

import { createCollector } from '@walkeros/collector';
import { destinationGtag } from '@walkeros/web-destination-gtag';

const { elb } = await createCollector();

elb('walker destination', destinationGtag, {
settings: {
ga4: {
measurementId: 'G-XXXXXXXXXX', // Required for GA4
},
ads: {
conversionId: 'AW-XXXXXXXXX', // Required for Google Ads
},
gtm: {
containerId: 'GTM-XXXXXXX', // Required for GTM
},
},
});

Configuration reference

PropertyTypeDescriptionMore
ga4GA4SettingsGA4-specific configuration settings
adsAdsSettingsGoogle Ads specific configuration settings
gtmGTMSettingsGoogle Tag Manager specific configuration settings

Event Mapping

For custom event mapping (mapping.entity.action.settings):

PropertyTypeDescriptionMore
ga4GA4MappingGA4-specific event mapping configuration
adsAdsMappingGoogle Ads specific event mapping configuration
gtmGTMMappingGTM specific event mapping configuration
💡 Need Professional Support?
Need professional support with your walkerOS implementation? Check out our services.