trackkit / providers/ga4/types / GA4Options
Type Alias: GA4Options
GA4Options =
BaseProviderOptions&object
Defined in: providers/ga4/types.ts:10
Configuration options for the GA4 provider.
Extends BaseProviderOptions with GA4-specific fields such as measurementId and optional apiSecret.
Type Declaration
name
name:
"ga4"
Provider name discriminator.
measurementId?
optionalmeasurementId:string
Google Analytics 4 measurement ID (alternative to site alias).
Example
'G-XXXXXXXXXX'apiSecret?
optionalapiSecret:string
Custom API secret for server-side tracking using the GA4 Measurement Protocol.
Required in many GA4 setups when sending events directly to the MP endpoint.
customDimensions?
optionalcustomDimensions:Record<string,string|undefined>
Custom dimensions mapping.
Maps friendly names to GA4 dimension keys.
Example
{ plan_type: 'custom_dimension_1' }customMetrics?
optionalcustomMetrics:Record<string,string|undefined>
Custom metrics mapping.
Maps friendly names to GA4 metric keys.
Example
{ engagement_score: 'custom_metric_1' }debugEndpoint?
optionaldebugEndpoint:boolean
When true, send events to the GA4 validation endpoint (/debug/mp/collect) instead of the production endpoint.
Useful for validating payloads without polluting real data.
debugMode?
optionaldebugMode:boolean
When true, add GA4 debug_mode=1 event param so events show in GA4 DebugView.