getCurrentDataLayerVariables | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Function getCurrentDataLayerVariables

    • Get the current variables in the GTM datalayer

      Type 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