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) Channel Group resource to create channel groups within a specified property. It allows users to programmatically manage channel groups, which are used in Google Analytics to categorize traffic sources for better reporting and analysis.

Common scenarios where this node is beneficial include:

  • Automating the creation of custom channel groupings for properties to tailor traffic source categorization.
  • Integrating channel group management into larger workflows that involve Google Analytics property configuration.
  • Streamlining bulk or repeated setup of channel groups across multiple properties.

For example, a marketing analyst could use this node to automatically create a new channel group defining specific traffic channels after setting up a new Google Analytics property, ensuring consistent data categorization without manual intervention.

Properties

Name Meaning
Property ID The identifier of the Google Analytics property where the channel group will be created.
Query Parameters Optional parameters to customize the request; includes options like filter expressions, page size, etc.
Request Body JSON object containing the details of the channel group to create, such as its name and definition rules.

Details on "Query Parameters" options (optional):

  • Calculated Metric ID: ID for calculated metrics (not typically used for channel groups).
  • Entity: Level of data access report (property or account level).
  • Filter: Expression to filter results.
  • Names: Names of access bindings to retrieve.
  • Page Size: Maximum number of items to return.
  • Page Token: Token for pagination.
  • Show Deleted: Whether to include soft-deleted properties.
  • Universal Analytics Property ID: UA property linked to GA4 property.
  • Update Mask: Fields to update (snake case).

(Note: For creating a channel group, these query parameters are generally optional or unused.)

Output

The node outputs an array of JSON objects representing the response from the Google Analytics API after creating the channel group. This JSON typically contains the newly created channel group's details, including its unique ID, name, and configuration.

No binary data output is involved.

Dependencies

  • Requires valid Google Analytics API OAuth2 credentials configured in n8n.
  • Uses the Google Analytics Admin API endpoint https://analyticsadmin.googleapis.com/v1alpha.
  • The node depends on network connectivity to Google's API services.

Troubleshooting

  • Missing Credentials Error: If the node throws "Missing Google Analytics API Credentials," ensure that OAuth2 credentials for Google Analytics are properly set up and connected.
  • Required Parameter Errors: Errors like "Property ID is required" indicate missing mandatory inputs. Verify that the Property ID is provided.
  • API Call Failures: Errors returned from the Google Analytics API will be wrapped and shown with messages like "Error calling Google Analytics API." Check the error message and stack trace for details.
  • Invalid JSON in Request Body: Ensure the JSON provided in the Request Body field is well-formed and matches the expected schema for a channel group creation.
  • Permission Issues: Insufficient permissions on the Google Analytics account or property may cause authorization errors. Confirm the OAuth2 token has appropriate scopes.

Links and References


This summary focuses on the "Admin (V1Alpha) - Channel Group" resource and the "Create Channel Group" operation as requested.

Discussion