Google Analytics icon

Google Analytics

Use the Google Analytics API

Actions84

Overview

This node interacts with the Google Analytics API, specifically supporting a wide range of administrative and data operations across different versions (v1alpha, v1beta) and data layers. For the selected resource Admin (V1Alpha) - Data Stream and operation Get Data Stream Global Site Tag, it retrieves the global site tag associated with a specific data stream within a Google Analytics property.

This operation is useful when you want to programmatically obtain the global site tag snippet for a particular data stream, which can then be embedded in websites or applications to enable Google Analytics tracking.

Practical example:

  • Automatically fetch the global site tag for a new data stream created in your Google Analytics property to deploy it on your website without manual lookup.
  • Use this node in workflows that manage multiple properties and data streams, ensuring you always have the correct tracking code snippet.

Properties

Name Meaning
Property ID The identifier of the Google Analytics property that contains the data stream.
Data Stream ID The identifier of the data stream for which to retrieve the global site tag.
Query Parameters Optional additional parameters to customize the request (e.g., filters, pagination).

The Query Parameters collection supports these optional fields (not all relevant for this operation but available generally):

  • Calculated Metric ID
  • Entity (property or account level)
  • Filter expression
  • Names of access bindings
  • Page Size (number of items to return)
  • Page Token (for pagination)
  • Show Deleted (include soft-deleted entities)
  • Universal Analytics Property ID
  • Update Mask (fields to update)

Output

The output JSON contains the response from the Google Analytics API for the global site tag of the specified data stream. This typically includes the JavaScript snippet or configuration details needed to embed the global site tag on a website.

The exact structure depends on the API response but generally includes:

  • The global site tag content or script snippet
  • Metadata about the data stream and property

No binary data output is involved in this operation.

Dependencies

  • Requires an OAuth2 credential configured for Google Analytics API access.
  • The node uses the Google Analytics Admin API endpoint https://analyticsadmin.googleapis.com/v1alpha for this operation.
  • Proper permissions on the Google Analytics property and data stream are necessary to retrieve the global site tag.

Troubleshooting

  • Missing Credentials Error: If the node throws "Missing Google Analytics API Credentials," ensure that a valid OAuth2 credential for Google Analytics is set up and connected to the node.
  • Required Parameter Errors: The node requires both Property ID and Data Stream ID. Omitting either will cause errors like "Property ID is required" or "Data Stream ID is required." Provide these IDs correctly.
  • API Permission Errors: Insufficient permissions on the Google Analytics account or property may result in authorization errors. Verify that the OAuth2 token has adequate scopes.
  • Network or API Errors: Any network issues or API downtime will cause request failures. Check connectivity and Google API status.

Links and References

Discussion