AnalyticsAdmin
import { AnalyticsAdmin } from "https://googleapis.deno.dev/v1/analyticsadmin:v1beta.ts";
Manage properties in Google Analytics. Warning: Creating multiple Customer Applications, Accounts, or Projects to simulate or act as a single Customer Application, Account, or Project (respectively) or to circumvent Service-specific usage limits or quotas is a direct violation of Google Cloud Platform Terms of Service as well as Google APIs Terms of Service. These actions can result in immediate termination of your GCP project(s) without any warning.
§Methods
Marks target Account as soft-deleted (ie: "trashed") and returns it. This API does not have a method to restore soft-deleted accounts. However, they can be restored using the Trash Can UI. If the accounts are not restored before the expiration time, the account and all child resources (eg: Properties, GoogleAdsLinks, Streams, AccessBindings) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.
Required. The name of the Account to soft-delete. Format: accounts/{account} Example: "accounts/100"
Lookup for a single Account.
Required. The name of the account to lookup. Format: accounts/{account} Example: "accounts/100"
Get data sharing settings on an account. Data sharing settings are singletons.
Required. The name of the settings to lookup. Format: accounts/{account}/dataSharingSettings Example: "accounts/1000/dataSharingSettings"
Returns all accounts accessible by the caller. Note that these accounts might not currently have GA4 properties. Soft-deleted (ie: "trashed") accounts are excluded by default. Returns an empty list if no relevant accounts are found.
Updates an account.
Output only. Resource name of this account. Format: accounts/{account} Example: "accounts/100"
Requests a ticket for creating an account.
Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. Reports may be requested for any property, but dimensions that aren't related to quota can only be requested on Google Analytics 360 properties. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see searchChangeHistoryEvents.
The Data Access Report supports requesting at the property level or account level. If requested at the account level, Data Access Reports include all access for all properties under that account. To request at the property level, entity should be for example 'properties/123' if "123" is your GA4 property ID. To request at the account level, entity should be for example 'accounts/1234' if "1234" is your GA4 Account ID.
Searches through all changes to an account or its children given the specified set of filters.
Required. The account resource for which to return change history resources. Format: accounts/{account} Example: "accounts/100"
Returns summaries of all accounts accessible by the caller.
Acknowledges the terms of user data collection for the specified property. This acknowledgement must be completed (either in the Google Analytics UI or through this API) before MeasurementProtocolSecret resources may be created.
Required. The property for which to acknowledge user data collection.
Creates a conversion event with the specified attributes.
Required. The resource name of the parent property where this conversion event will be created. Format: properties/123
Deletes a conversion event in a property.
Required. The resource name of the conversion event to delete. Format: properties/{property}/conversionEvents/{conversion_event} Example: "properties/123/conversionEvents/456"
Retrieve a single conversion event.
Required. The resource name of the conversion event to retrieve. Format: properties/{property}/conversionEvents/{conversion_event} Example: "properties/123/conversionEvents/456"
Returns a list of conversion events in the specified parent property. Returns an empty list if no conversion events are found.
Required. The resource name of the parent property. Example: 'properties/123'
Updates a conversion event with the specified attributes.
Output only. Resource name of this conversion event. Format: properties/{property}/conversionEvents/{conversion_event}
Creates an "GA4" property with the specified location and attributes.
Archives a CustomDimension on a property.
Required. The name of the CustomDimension to archive. Example format: properties/1234/customDimensions/5678
Creates a CustomDimension.
Required. Example format: properties/1234
Lookup for a single CustomDimension.
Required. The name of the CustomDimension to get. Example format: properties/1234/customDimensions/5678
Lists CustomDimensions on a property.
Required. Example format: properties/1234
Updates a CustomDimension on a property.
Output only. Resource name for this CustomDimension resource. Format: properties/{property}/customDimensions/{customDimension}
Archives a CustomMetric on a property.
Required. The name of the CustomMetric to archive. Example format: properties/1234/customMetrics/5678
Creates a CustomMetric.
Required. Example format: properties/1234
Lookup for a single CustomMetric.
Required. The name of the CustomMetric to get. Example format: properties/1234/customMetrics/5678
Lists CustomMetrics on a property.
Required. Example format: properties/1234
Updates a CustomMetric on a property.
Output only. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}
Creates a DataStream.
Required. Example format: properties/1234
Deletes a DataStream on a property.
Required. The name of the DataStream to delete. Example format: properties/1234/dataStreams/5678
Lookup for a single DataStream.
Required. The name of the DataStream to get. Example format: properties/1234/dataStreams/5678
Lists DataStreams on a property.
Required. Example format: properties/1234
Creates a measurement protocol secret.
Required. The parent resource where this secret will be created. Format: properties/{property}/dataStreams/{dataStream}
Deletes target MeasurementProtocolSecret.
Required. The name of the MeasurementProtocolSecret to delete. Format: properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}
Lookup for a single "GA4" MeasurementProtocolSecret.
Required. The name of the measurement protocol secret to lookup. Format: properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}
Returns child MeasurementProtocolSecrets under the specified parent Property.
Required. The resource name of the parent stream. Format: properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets
Updates a measurement protocol secret.
Output only. Resource name of this secret. This secret may be a child of any type of stream. Format: properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}
Updates a DataStream on a property.
Output only. Resource name of this Data Stream. Format: properties/{property_id}/dataStreams/{stream_id} Example: "properties/1000/dataStreams/2000"
Marks target Property as soft-deleted (ie: "trashed") and returns it. This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash Can UI. If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, AccessBindings) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found, or is not a GA4 Property.
Required. The name of the Property to soft-delete. Format: properties/{property_id} Example: "properties/1000"
Creates a FirebaseLink. Properties can have at most one FirebaseLink.
Required. Format: properties/{property_id} Example: properties/1234
Deletes a FirebaseLink on a property
Required. Format: properties/{property_id}/firebaseLinks/{firebase_link_id} Example: properties/1234/firebaseLinks/5678
Lists FirebaseLinks on a property. Properties can have at most one FirebaseLink.
Required. Format: properties/{property_id} Example: properties/1234
Lookup for a single "GA4" Property.
Required. The name of the property to lookup. Format: properties/{property_id} Example: "properties/1000"
Returns the singleton data retention settings for this property.
Required. The name of the settings to lookup. Format: properties/{property}/dataRetentionSettings Example: "properties/1000/dataRetentionSettings"
Creates a GoogleAdsLink.
Required. Example format: properties/1234
Deletes a GoogleAdsLink on a property
Required. Example format: properties/1234/googleAdsLinks/5678
Lists GoogleAdsLinks on a property.
Required. Example format: properties/1234
Updates a GoogleAdsLink on a property
Output only. Format: properties/{propertyId}/googleAdsLinks/{googleAdsLinkId} Note: googleAdsLinkId is not the Google Ads customer ID.
Creates a Key Event.
Required. The resource name of the parent property where this Key Event will be created. Format: properties/123
Deletes a Key Event.
Required. The resource name of the Key Event to delete. Format: properties/{property}/keyEvents/{key_event} Example: "properties/123/keyEvents/456"
Retrieve a single Key Event.
Required. The resource name of the Key Event to retrieve. Format: properties/{property}/keyEvents/{key_event} Example: "properties/123/keyEvents/456"
Returns a list of Key Events in the specified parent property. Returns an empty list if no Key Events are found.
Required. The resource name of the parent property. Example: 'properties/123'
Updates a Key Event.
Output only. Resource name of this key event. Format: properties/{property}/keyEvents/{key_event}
Returns child Properties under the specified parent Account. Only "GA4" properties will be returned. Properties will be excluded if the caller does not have access. Soft-deleted (ie: "trashed") properties are excluded by default. Returns an empty list if no relevant properties are found.
Updates a property.
Output only. Resource name of this property. Format: properties/{property_id} Example: "properties/1000"
Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. Reports may be requested for any property, but dimensions that aren't related to quota can only be requested on Google Analytics 360 properties. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see searchChangeHistoryEvents.
The Data Access Report supports requesting at the property level or account level. If requested at the account level, Data Access Reports include all access for all properties under that account. To request at the property level, entity should be for example 'properties/123' if "123" is your GA4 property ID. To request at the account level, entity should be for example 'accounts/1234' if "1234" is your GA4 Account ID.
Updates the singleton data retention settings for this property.
Output only. Resource name for this DataRetentionSetting resource. Format: properties/{property}/dataRetentionSettings