Skip to main content

Google Analytics 4 (GA4)

Web Source code Package

Google Analytics 4 (GA4) configuration within the unified gtag destination. This allows you to send events to GA4 with enhanced measurement features and flexible event tracking.

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',
},
},
});

Configuration reference

PropertyTypeDescriptionMore
measurementId*stringGA4 Measurement ID from Google Analytics
debugbooleanEnable debug mode for GA4
includeInclude[]Array of properties to include in events
pageviewbooleanEnable automatic pageview tracking
server_container_urlstringServer-side GTM container URL
snakeCasebooleanConvert parameter names to snake_case
transport_urlstringCustom transport URL for GA4
* Required fields

Event Mapping

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

PropertyTypeDescriptionMore
includeInclude[]Array of properties to include in this specific event
💡 Need Professional Support?
Need professional support with your walkerOS implementation? Check out our services.