Google Tag Manager icon

Google Tag Manager

Use the Google Tag Manager API

Actions84

Overview

This node integrates with the Google Tag Manager (GTM) API, specifically allowing users to update existing GTM Tags within a specified workspace. The "Update Tags" operation enables modifying the configuration of a tag in a GTM container workspace.

Common scenarios for this node include:

  • Automating updates to GTM tags as part of deployment pipelines.
  • Programmatically changing tag settings without manual intervention in the GTM UI.
  • Integrating GTM tag management into broader workflows that involve other marketing or analytics tools.

For example, you might use this node to update a tag's firing triggers or parameters when a new campaign launches, ensuring consistent tracking setup across environments.

Properties

Name Meaning
Account ID The unique identifier of the Google Tag Manager account where the tag resides.
Container ID The identifier of the GTM container that holds the tag.
Workspace ID The workspace within the container where the tag is located and will be updated.
Tag ID The specific ID of the tag to update.
Optional Query Parameters Additional optional parameters for the API request. These can include various flags and settings such as:
- Allow User Permission Feature Update (boolean)
- Fingerprint (string)
...and many others as per GTM API.
Request Body A JSON object representing the new configuration of the tag. This contains the fields and values to update on the tag.

Note: The Optional Query Parameters collection includes many possible options, but typically for updating tags, the main required properties are the IDs and the request body containing the updated tag data.

Output

The output is a JSON array containing the response from the Google Tag Manager API after updating the tag. This response includes the full details of the updated tag resource as returned by the GTM API.

The structure corresponds to the GTM Tag resource, which typically includes fields like:

  • name: The name of the tag.
  • type: The type of tag (e.g., Google Analytics, AdWords).
  • parameter: Configuration parameters for the tag.
  • firingTriggerId: Array of trigger IDs that cause the tag to fire.
  • blockingTriggerId: Array of trigger IDs that block the tag.
  • tagId: The unique identifier of the tag.
  • Other metadata fields related to the tag's state and configuration.

No binary data output is involved in this operation.

Dependencies

  • Requires an OAuth2 credential configured for Google Tag Manager API access.
  • The node uses the official GTM API endpoint at https://www.googleapis.com/tagmanager/v2.
  • Proper permissions on the GTM account and container are necessary to perform update operations.

Troubleshooting

  • Missing Credentials: If the OAuth2 credentials for Google Tag Manager are not set up or invalid, the node will throw an error indicating missing credentials.
  • Required Parameter Missing: Errors will occur if any of the required IDs (Account ID, Container ID, Workspace ID, or Tag ID) are not provided.
  • Invalid Request Body: Providing an improperly structured JSON in the request body may cause the API to reject the update.
  • API Errors: Any errors returned by the GTM API (such as permission denied, not found, or conflict errors) will be surfaced with messages prefixed by "Error calling GTM API".
  • To resolve these issues, ensure all required parameters are correctly filled, the request body matches the expected GTM Tag schema, and the OAuth2 credentials have sufficient permissions.

Links and References


This summary focuses on the "Update Tags" operation of the "Tag" resource as requested, based on static analysis of the provided source code and property definitions.

Discussion