Google Analytics icon

Google Analytics

Use the Google Analytics API

Actions84

Overview

This node integrates with the Google Analytics API, specifically supporting the "Admin (V1Alpha) - AdSense Link" resource and its operations. The "Create AdSense Link" operation allows users to create a new AdSense link within a specified Google Analytics property. This is useful for linking AdSense accounts to Google Analytics properties to enable revenue tracking and reporting.

Typical use cases include:

  • Automating the creation of AdSense links for multiple properties.
  • Integrating AdSense data into Google Analytics workflows.
  • Managing AdSense links programmatically as part of larger analytics automation.

Properties

Name Meaning
Property ID The identifier of the Google Analytics property where the AdSense link will be created.
Query Parameters Optional parameters to customize the request; includes options like filter, page size, etc.
Request Body JSON object containing the details of the AdSense link to create.

Details on Properties:

  • Property ID: Required string specifying the target property for the AdSense link.
  • Query Parameters: A collection of optional parameters that can be added to the request URL query string. Examples include filter, pageSize, pageToken, etc., but these are generic and may not all apply to this specific operation.
  • Request Body: A JSON-formatted string representing the body of the POST request to create the AdSense link. This should contain the necessary fields as per the Google Analytics Admin API specification for creating an AdSense link.

Output

The node outputs a JSON array where each element corresponds to the response from the Google Analytics API for the executed operation.

For the "Create AdSense Link" operation, the output JSON contains the newly created AdSense link resource details as returned by the API. This typically includes identifiers, linked account information, and status.

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/scopes must be granted to the OAuth2 credential to manage AdSense links.

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 selected.
  • Required Parameter Errors: Errors like "Property ID is required" indicate missing mandatory input. Verify that the Property ID is provided.
  • API Errors: Any error messages from the Google Analytics API will be wrapped and shown with the prefix "Error calling Google Analytics API." Check the message and stack trace for details.
  • Invalid JSON in Request Body: Ensure the JSON in the Request Body field is well-formed and matches the expected schema for creating an AdSense link.

Links and References


This summary is based on static analysis of the node's source code and provided property definitions, focusing on the "Admin (V1Alpha) - AdSense Link" resource and the "Create AdSense Link" operation.

Discussion