API Reference

@frontend-sdk/google-tag-manager - v0.24.2

Interfaces

Functions

useGoogleTagManager

Const useGoogleTagManager(options): void

Parameters

Returns

void


useGoogleTagManagerActions

useGoogleTagManagerActions(): GoogleTagManagerActions

Returns

GoogleTagManagerActions

Interface: GoogleTagManagerActions

Properties

track

Readonly track: (event: unknown) => void

Type declaration

▸ (event): void

Parameters
NameType
eventunknown
Returns

void


trackAddToCartEvent

Readonly trackAddToCartEvent: (products: readonly unknown[], currency?: string) => void

Type declaration

▸ (products, currency?): void

Parameters
NameType
productsreadonly unknown[]
currency?string
Returns

void


trackProductDetailViewEvent

Readonly trackProductDetailViewEvent: (products: readonly unknown[], currency?: string) => void

Type declaration

▸ (products, currency?): void

Parameters
NameType
productsreadonly unknown[]
currency?string
Returns

void


trackProductListImpressionsEvent

Readonly trackProductListImpressionsEvent: (products: readonly unknown[], currency?: string) => void

Type declaration

▸ (products, currency?): void

Parameters
NameType
productsreadonly unknown[]
currency?string
Returns

void


trackRemoveFromCartEvent

Readonly trackRemoveFromCartEvent: (products: readonly unknown[], currency?: string) => void

Type declaration

▸ (products, currency?): void

Parameters
NameType
productsreadonly unknown[]
currency?string
Returns

void

Interface: UseGoogleTagManagerOptions

Properties

containerId

Readonly containerId: string

Google Tag Manager container id (aka gtmId).


currencyCode

Readonly currencyCode: string

Global currency code.
There is occasionally some breakage that happens if the global value for currency hasn't been set properly,
that's why it is required during initialization.


gaSessionId

Optional Readonly gaSessionId: string

This field is for session tracking purposes in Google Analytics


optimizeContainerId

Optional Readonly optimizeContainerId: string

Google Optimize container id.
Set this if you have Google Optimize and you are initializing it outside of gtm


Did this page help you?