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 Data Streams. The "Delete Data Stream" operation allows users to delete a specific data stream within a Google Analytics property. This is useful when you want to remove obsolete or incorrect data streams from your analytics setup.

Common scenarios include:

  • Cleaning up unused or test data streams in a property.
  • Automating the management of data streams as part of a larger workflow.
  • Ensuring compliance by removing data streams that are no longer needed.

Example: You have a property with multiple data streams and want to programmatically delete one that is no longer collecting relevant data.

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 to be deleted within the specified property.
Query Parameters Optional additional parameters for the request, such as filters or pagination controls.

The "Query Parameters" collection can include:

  • Calculated Metric ID
  • Entity (property or account level)
  • Filter expressions
  • Names of access bindings
  • Page Size (number)
  • Page Token (for pagination)
  • Show Deleted (boolean)
  • Universal Analytics Property ID
  • Update Mask (fields to update)

For this operation, these query parameters are generally optional and may not be required.

Output

The output JSON will contain the response from the Google Analytics API after attempting to delete the specified data stream. Typically, for a delete operation, the API returns an empty object or confirmation of deletion.

The node outputs the parsed JSON response from the API call in the json field of the output data.

No binary data output is involved in this operation.

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/property to delete data streams are necessary.

Troubleshooting

  • Missing Credentials Error: If the node throws "Missing Google Analytics API Credentials," ensure that OAuth2 credentials for Google Analytics API 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 that these IDs are correctly provided.
  • API Permission Errors: If the API returns permission denied errors, check that the authenticated user has sufficient rights to delete data streams in the specified property.
  • Network or API Errors: General API errors will be reported with messages prefixed by "Error calling Google Analytics API." Review the error message and stack trace for details.

Links and References


This summary covers the static analysis of the node's execute method for the "Delete Data Stream" operation under the Admin (V1Alpha) - Data Stream resource.

Discussion