@capgo/capacitor-gtm
The main interface for the Google Tag Manager plugin.
Overview
Section titled “Overview”The main interface for the Google Tag Manager plugin.
Core Capabilities
Section titled “Core Capabilities”initialize- Initializes Google Tag Manager with the specified container ID.push- Pushes an event to the Google Tag Manager dataLayer.setUserProperty- Sets a user property in the Google Tag Manager dataLayer.getValue- Gets a value from the Google Tag Manager dataLayer. Searches through the dataLayer for the most recent value of the specified key.
Public API
Section titled “Public API”| Method | Description |
|---|---|
initialize | Initializes Google Tag Manager with the specified container ID. |
push | Pushes an event to the Google Tag Manager dataLayer. |
setUserProperty | Sets a user property in the Google Tag Manager dataLayer. |
getValue | Gets a value from the Google Tag Manager dataLayer. Searches through the dataLayer for the most recent value of the specified key. |
reset | Resets the Google Tag Manager instance and clears all data. This will remove all data from the dataLayer and require re-initialization. |
getPluginVersion | Get the native Capacitor plugin version. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-gtm.