menu
Menu
Mobify DevCenter
search_icon_focus

Google Tag Manager

progressive-web-sdk/dist/analytics-integrations/connectors/google-tag-manager

The google-tag-manager module contains the GoogleTagManagerConnector class, an implementation of the AnalyticsConnector interface, used for connecting to Google Tag Manager.

class

GoogleTagManagerConnector

A Connector for the Analytics Provider: Google Tag Manager.

Import
import { GoogleTagManagerConnector } from 'progressive-web-sdk/dist/analytics-integrations/connectors/google-tag-manager

Implements:

AnalyticsConnector

Constructor

Usage
new GoogleTagManagerConnector(options)
ParameterTypeDescription
optionsObjectGoogle Tag Manager options.
options.containerIdString(required) Google Tag Manager Container id.

Methods

load()

Loads necessary resources and performs any additional set up required to create the connection to the Analytics Provider.

Returns:

Promise.<undefined> - Returns a resolved promise when the resources are fully loaded.

See also: loadScript


track(type, data)

Track an analytics event and send it to an analytics provider.

Returns:

Object - The data that was sent to the analytics provider.

See also: types

ParameterTypeDescription
typeStringThe event type, which can be any String, but Mobify has special support for some built-in types.
dataObjectThe event data, which can be any Object, but Mobify has special support for some built-in types.