Google Analytics icon

Google Analytics

Use the Google Analytics API

Actions84

Overview

This node integrates with the Google Analytics API, specifically targeting the Admin (V1Alpha) resource for managing Custom Dimensions within a property. The "Get Custom Dimension" operation retrieves details about a specific custom dimension configured in a Google Analytics property.

Use cases include:

  • Fetching metadata and configuration of a particular custom dimension to understand how data is being tracked.
  • Auditing or synchronizing custom dimensions between Google Analytics and other systems.
  • Automating reporting workflows that require detailed information about custom dimensions.

For example, you might use this node to retrieve the definition of a custom dimension by specifying the property ID and the custom dimension ID, then use that data downstream in your workflow for validation or reporting purposes.

Properties

Name Meaning
Property ID The identifier of the Google Analytics property where the custom dimension exists.
Custom Dimension ID The unique identifier of the custom dimension to retrieve.
Query Parameters Optional parameters to refine or filter the request. Includes options like:
- Calculated Metric ID: ID for a calculated metric (string).
- Entity: Level of data access report (property or account level) (string).
- Filter: Expression to filter results (string).
- Names: Names of access bindings to retrieve (string).
- Page Size: Maximum number of items to return (number).
- Page Token: Token for pagination continuation (string).
- Show Deleted: Whether to include soft-deleted properties (boolean).
- Universal Analytics Property ID: UA property to look up connected GA4 property (string).
- Update Mask: List of fields to update (snake case string).

Output

The node outputs a JSON array containing the response from the Google Analytics API for the requested custom dimension. The JSON structure corresponds directly to the API's representation of a custom dimension resource, typically including fields such as:

  • name: Resource name of the custom dimension.
  • parameterName: The API parameter name.
  • displayName: Human-readable name.
  • description: Description of the custom dimension.
  • scope: Scope of the dimension (e.g., event, user).
  • disallowAdsPersonalization: Boolean flag related to ads personalization.
  • Other metadata fields as defined by the Google Analytics API.

No binary data output is involved in this operation.

Dependencies

  • Requires an OAuth2 API credential for Google Analytics with appropriate permissions to access the Admin API.
  • The node uses the Google Analytics Admin API endpoint at https://analyticsadmin.googleapis.com/v1alpha.
  • Proper setup of the OAuth2 credentials in n8n is necessary for authentication.

Troubleshooting

  • Missing Credentials Error: If the node throws an error about missing credentials, ensure that the Google Analytics OAuth2 API credentials are correctly configured and selected.
  • Required Parameter Errors: The node requires both Property ID and Custom Dimension ID. Omitting either will cause an error indicating the missing parameter.
  • API Errors: Errors returned from the Google Analytics API (e.g., permission denied, not found) will be surfaced with messages prefixed by "Error calling Google Analytics API". Check that the authenticated user has access to the specified property and custom dimension.
  • Pagination Issues: If using query parameters like pageSize or pageToken, ensure values are valid to avoid unexpected empty results or errors.

Links and References

Discussion