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 Event Edit Rules within a data stream. The "Create Event Edit Rule" operation allows users to create new event edit rules that modify or transform events in a Google Analytics data stream.

Typical use cases include:

  • Automatically adjusting event parameters before they are processed.
  • Correcting or enriching event data on the fly.
  • Implementing custom business logic for event tracking without changing client-side code.

For example, a marketing analyst might use this node to create an event edit rule that renames certain event parameters or filters out unwanted events from reporting.

Properties

Name Meaning
Property ID The identifier of the Google Analytics property where the event edit rule will be created.
Data Stream ID The identifier of the data stream within the property where the event edit rule applies.
Query Parameters Optional additional query parameters to customize the API request (e.g., pagination, filters).
Request Body JSON object containing the details of the event edit rule to create, such as conditions and transformations.

Details on key properties:

  • Property ID: Required to specify which Google Analytics property the event edit rule belongs to.
  • Data Stream ID: Required to specify the exact data stream under the property where the rule is applied.
  • Request Body: Must contain the event edit rule definition in JSON format according to Google Analytics API specifications.

Output

The node outputs a JSON array where each element corresponds to the response from the Google Analytics API after creating the event edit rule. The output JSON structure reflects the created event edit rule's details as returned by the API, including identifiers, conditions, and transformation settings.

No binary data is produced by this node.

Dependencies

  • Requires valid Google Analytics API OAuth2 credentials configured in n8n.
  • The node uses the Google Analytics Admin API v1alpha endpoint (https://analyticsadmin.googleapis.com/v1alpha).
  • Proper permissions on the Google Analytics account and property to create event edit rules are necessary.

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" or "Data Stream ID is required" indicate missing mandatory inputs. Verify these fields are correctly filled.
  • API Call Failures: Errors returned from the Google Analytics API may include permission issues, invalid JSON in the request body, or incorrect IDs. Review the error message and stack trace for details.
  • JSON Parsing Issues: Ensure the "Request Body" JSON is well-formed and matches the expected schema for event edit rules.

Links and References


This summary focuses on the "Create Event Edit Rule" operation within the Admin (V1Alpha) resource, describing its purpose, input requirements, output, dependencies, and common troubleshooting tips based on static analysis of the provided source code and property definitions.

Discussion