Skip to content

@capgo/capacitor-gtm

The main interface for the Google Tag Manager plugin.

The main interface for the Google Tag Manager plugin.

  • 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.
MethodDescription
initializeInitializes Google Tag Manager with the specified container ID.
pushPushes an event to the Google Tag Manager dataLayer.
setUserPropertySets a user property in the Google Tag Manager dataLayer.
getValueGets a value from the Google Tag Manager dataLayer. Searches through the dataLayer for the most recent value of the specified key.
resetResets the Google Tag Manager instance and clears all data. This will remove all data from the dataLayer and require re-initialization.
getPluginVersionGet the native Capacitor plugin version.

This reference is synced from src/definitions.ts in capacitor-gtm.