Function getCurrentDataLayerVariables
- getCurrentDataLayerVariables<
DataLayerFormat extends object = Record<string, unknown>,
>(
win?: Window,
): DataLayerFormatType Parameters
- DataLayerFormat extends object = Record<string, unknown>
Parameters
- win: Window = window
The window to get the dataLayer from (default: current window)
Returns DataLayerFormat
The current variables in the GTM datalayer, merged together from all entries. Note that this is a snapshot and won't update as the dataLayer changes
Get the current variables in the GTM datalayer