Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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.

class AnalyticsAdmin {
constructor(client?: CredentialsClient, baseUrl?: string);
async accountsDelete(name: string): Promise<GoogleProtobufEmpty>;
async accountsGet(name: string): Promise<GoogleAnalyticsAdminV1betaAccount>;
async accountsGetDataSharingSettings(name: string): Promise<GoogleAnalyticsAdminV1betaDataSharingSettings>;
async accountsPatch(
name: string,
): Promise<GoogleAnalyticsAdminV1betaAccount>;
async propertiesConversionEventsCreate(parent: string, req: GoogleAnalyticsAdminV1betaConversionEvent): Promise<GoogleAnalyticsAdminV1betaConversionEvent>;
async propertiesConversionEventsDelete(name: string): Promise<GoogleProtobufEmpty>;
async propertiesConversionEventsGet(name: string): Promise<GoogleAnalyticsAdminV1betaConversionEvent>;
async propertiesConversionEventsList(parent: string, opts?: PropertiesConversionEventsListOptions): Promise<GoogleAnalyticsAdminV1betaListConversionEventsResponse>;
async propertiesCustomDimensionsArchive(name: string, req: GoogleAnalyticsAdminV1betaArchiveCustomDimensionRequest): Promise<GoogleProtobufEmpty>;
async propertiesCustomDimensionsCreate(parent: string, req: GoogleAnalyticsAdminV1betaCustomDimension): Promise<GoogleAnalyticsAdminV1betaCustomDimension>;
async propertiesCustomDimensionsGet(name: string): Promise<GoogleAnalyticsAdminV1betaCustomDimension>;
async propertiesCustomDimensionsList(parent: string, opts?: PropertiesCustomDimensionsListOptions): Promise<GoogleAnalyticsAdminV1betaListCustomDimensionsResponse>;
async propertiesCustomMetricsArchive(name: string, req: GoogleAnalyticsAdminV1betaArchiveCustomMetricRequest): Promise<GoogleProtobufEmpty>;
async propertiesCustomMetricsCreate(parent: string, req: GoogleAnalyticsAdminV1betaCustomMetric): Promise<GoogleAnalyticsAdminV1betaCustomMetric>;
async propertiesCustomMetricsGet(name: string): Promise<GoogleAnalyticsAdminV1betaCustomMetric>;
async propertiesCustomMetricsList(parent: string, opts?: PropertiesCustomMetricsListOptions): Promise<GoogleAnalyticsAdminV1betaListCustomMetricsResponse>;
async propertiesCustomMetricsPatch(
name: string,
): Promise<GoogleAnalyticsAdminV1betaCustomMetric>;
async propertiesDataStreamsCreate(parent: string, req: GoogleAnalyticsAdminV1betaDataStream): Promise<GoogleAnalyticsAdminV1betaDataStream>;
async propertiesDataStreamsDelete(name: string): Promise<GoogleProtobufEmpty>;
async propertiesDataStreamsGet(name: string): Promise<GoogleAnalyticsAdminV1betaDataStream>;
async propertiesDataStreamsList(parent: string, opts?: PropertiesDataStreamsListOptions): Promise<GoogleAnalyticsAdminV1betaListDataStreamsResponse>;
async propertiesDataStreamsMeasurementProtocolSecretsCreate(parent: string, req: GoogleAnalyticsAdminV1betaMeasurementProtocolSecret): Promise<GoogleAnalyticsAdminV1betaMeasurementProtocolSecret>;
async propertiesDataStreamsMeasurementProtocolSecretsDelete(name: string): Promise<GoogleProtobufEmpty>;
async propertiesDataStreamsMeasurementProtocolSecretsGet(name: string): Promise<GoogleAnalyticsAdminV1betaMeasurementProtocolSecret>;
async propertiesDataStreamsMeasurementProtocolSecretsList(parent: string, opts?: PropertiesDataStreamsMeasurementProtocolSecretsListOptions): Promise<GoogleAnalyticsAdminV1betaListMeasurementProtocolSecretsResponse>;
async propertiesDataStreamsPatch(
name: string,
): Promise<GoogleAnalyticsAdminV1betaDataStream>;
async propertiesDelete(name: string): Promise<GoogleAnalyticsAdminV1betaProperty>;
async propertiesFirebaseLinksCreate(parent: string, req: GoogleAnalyticsAdminV1betaFirebaseLink): Promise<GoogleAnalyticsAdminV1betaFirebaseLink>;
async propertiesFirebaseLinksDelete(name: string): Promise<GoogleProtobufEmpty>;
async propertiesFirebaseLinksList(parent: string, opts?: PropertiesFirebaseLinksListOptions): Promise<GoogleAnalyticsAdminV1betaListFirebaseLinksResponse>;
async propertiesGet(name: string): Promise<GoogleAnalyticsAdminV1betaProperty>;
async propertiesGetDataRetentionSettings(name: string): Promise<GoogleAnalyticsAdminV1betaDataRetentionSettings>;
async propertiesGoogleAdsLinksCreate(parent: string, req: GoogleAnalyticsAdminV1betaGoogleAdsLink): Promise<GoogleAnalyticsAdminV1betaGoogleAdsLink>;
async propertiesGoogleAdsLinksDelete(name: string): Promise<GoogleProtobufEmpty>;
async propertiesGoogleAdsLinksList(parent: string, opts?: PropertiesGoogleAdsLinksListOptions): Promise<GoogleAnalyticsAdminV1betaListGoogleAdsLinksResponse>;
async propertiesGoogleAdsLinksPatch(
name: string,
): Promise<GoogleAnalyticsAdminV1betaGoogleAdsLink>;
async propertiesKeyEventsCreate(parent: string, req: GoogleAnalyticsAdminV1betaKeyEvent): Promise<GoogleAnalyticsAdminV1betaKeyEvent>;
async propertiesKeyEventsDelete(name: string): Promise<GoogleProtobufEmpty>;
async propertiesKeyEventsGet(name: string): Promise<GoogleAnalyticsAdminV1betaKeyEvent>;
async propertiesKeyEventsList(parent: string, opts?: PropertiesKeyEventsListOptions): Promise<GoogleAnalyticsAdminV1betaListKeyEventsResponse>;
async propertiesKeyEventsPatch(
name: string,
): Promise<GoogleAnalyticsAdminV1betaKeyEvent>;
async propertiesPatch(
name: string,
): Promise<GoogleAnalyticsAdminV1betaProperty>;
async propertiesRunAccessReport(entity: string, req: GoogleAnalyticsAdminV1betaRunAccessReportRequest): Promise<GoogleAnalyticsAdminV1betaRunAccessReportResponse>;
}

§Constructors

§
new AnalyticsAdmin(client?: CredentialsClient, baseUrl?: string)
[src]

§Methods

§
accountsDelete(name: string): Promise<GoogleProtobufEmpty>
[src]

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.

@param name

Required. The name of the Account to soft-delete. Format: accounts/{account} Example: "accounts/100"

§
accountsGet(name: string): Promise<GoogleAnalyticsAdminV1betaAccount>
[src]

Lookup for a single Account.

@param name

Required. The name of the account to lookup. Format: accounts/{account} Example: "accounts/100"

§
accountsGetDataSharingSettings(name: string): Promise<GoogleAnalyticsAdminV1betaDataSharingSettings>
[src]

Get data sharing settings on an account. Data sharing settings are singletons.

@param name

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.

@param name

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.

@param entity

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.

@param account

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.

@param property

Required. The property for which to acknowledge user data collection.

§
propertiesConversionEventsCreate(parent: string, req: GoogleAnalyticsAdminV1betaConversionEvent): Promise<GoogleAnalyticsAdminV1betaConversionEvent>
[src]

Creates a conversion event with the specified attributes.

@param parent

Required. The resource name of the parent property where this conversion event will be created. Format: properties/123

§
propertiesConversionEventsDelete(name: string): Promise<GoogleProtobufEmpty>
[src]

Deletes a conversion event in a property.

@param name

Required. The resource name of the conversion event to delete. Format: properties/{property}/conversionEvents/{conversion_event} Example: "properties/123/conversionEvents/456"

§
propertiesConversionEventsGet(name: string): Promise<GoogleAnalyticsAdminV1betaConversionEvent>
[src]

Retrieve a single conversion event.

@param name

Required. The resource name of the conversion event to retrieve. Format: properties/{property}/conversionEvents/{conversion_event} Example: "properties/123/conversionEvents/456"

§
propertiesConversionEventsList(parent: string, opts?: PropertiesConversionEventsListOptions): Promise<GoogleAnalyticsAdminV1betaListConversionEventsResponse>
[src]

Returns a list of conversion events in the specified parent property. Returns an empty list if no conversion events are found.

@param parent

Required. The resource name of the parent property. Example: 'properties/123'

§

Updates a conversion event with the specified attributes.

@param name

Output only. Resource name of this conversion event. Format: properties/{property}/conversionEvents/{conversion_event}

§

Creates an "GA4" property with the specified location and attributes.

§
propertiesCustomDimensionsArchive(name: string, req: GoogleAnalyticsAdminV1betaArchiveCustomDimensionRequest): Promise<GoogleProtobufEmpty>
[src]

Archives a CustomDimension on a property.

@param name

Required. The name of the CustomDimension to archive. Example format: properties/1234/customDimensions/5678

§
propertiesCustomDimensionsCreate(parent: string, req: GoogleAnalyticsAdminV1betaCustomDimension): Promise<GoogleAnalyticsAdminV1betaCustomDimension>
[src]

Creates a CustomDimension.

@param parent

Required. Example format: properties/1234

§
propertiesCustomDimensionsGet(name: string): Promise<GoogleAnalyticsAdminV1betaCustomDimension>
[src]

Lookup for a single CustomDimension.

@param name

Required. The name of the CustomDimension to get. Example format: properties/1234/customDimensions/5678

§
propertiesCustomDimensionsList(parent: string, opts?: PropertiesCustomDimensionsListOptions): Promise<GoogleAnalyticsAdminV1betaListCustomDimensionsResponse>
[src]

Lists CustomDimensions on a property.

@param parent

Required. Example format: properties/1234

§

Updates a CustomDimension on a property.

@param name

Output only. Resource name for this CustomDimension resource. Format: properties/{property}/customDimensions/{customDimension}

§
propertiesCustomMetricsArchive(name: string, req: GoogleAnalyticsAdminV1betaArchiveCustomMetricRequest): Promise<GoogleProtobufEmpty>
[src]

Archives a CustomMetric on a property.

@param name

Required. The name of the CustomMetric to archive. Example format: properties/1234/customMetrics/5678

§
propertiesCustomMetricsCreate(parent: string, req: GoogleAnalyticsAdminV1betaCustomMetric): Promise<GoogleAnalyticsAdminV1betaCustomMetric>
[src]

Creates a CustomMetric.

@param parent

Required. Example format: properties/1234

§
propertiesCustomMetricsGet(name: string): Promise<GoogleAnalyticsAdminV1betaCustomMetric>
[src]

Lookup for a single CustomMetric.

@param name

Required. The name of the CustomMetric to get. Example format: properties/1234/customMetrics/5678

§
propertiesCustomMetricsList(parent: string, opts?: PropertiesCustomMetricsListOptions): Promise<GoogleAnalyticsAdminV1betaListCustomMetricsResponse>
[src]

Lists CustomMetrics on a property.

@param parent

Required. Example format: properties/1234

§

Updates a CustomMetric on a property.

@param name

Output only. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}

§
propertiesDataStreamsCreate(parent: string, req: GoogleAnalyticsAdminV1betaDataStream): Promise<GoogleAnalyticsAdminV1betaDataStream>
[src]

Creates a DataStream.

@param parent

Required. Example format: properties/1234

§
propertiesDataStreamsDelete(name: string): Promise<GoogleProtobufEmpty>
[src]

Deletes a DataStream on a property.

@param name

Required. The name of the DataStream to delete. Example format: properties/1234/dataStreams/5678

§
propertiesDataStreamsGet(name: string): Promise<GoogleAnalyticsAdminV1betaDataStream>
[src]

Lookup for a single DataStream.

@param name

Required. The name of the DataStream to get. Example format: properties/1234/dataStreams/5678

§
propertiesDataStreamsList(parent: string, opts?: PropertiesDataStreamsListOptions): Promise<GoogleAnalyticsAdminV1betaListDataStreamsResponse>
[src]

Lists DataStreams on a property.

@param parent

Required. Example format: properties/1234

§
propertiesDataStreamsMeasurementProtocolSecretsCreate(parent: string, req: GoogleAnalyticsAdminV1betaMeasurementProtocolSecret): Promise<GoogleAnalyticsAdminV1betaMeasurementProtocolSecret>
[src]

Creates a measurement protocol secret.

@param parent

Required. The parent resource where this secret will be created. Format: properties/{property}/dataStreams/{dataStream}

§
propertiesDataStreamsMeasurementProtocolSecretsDelete(name: string): Promise<GoogleProtobufEmpty>
[src]

Deletes target MeasurementProtocolSecret.

@param name

Required. The name of the MeasurementProtocolSecret to delete. Format: properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}

§
propertiesDataStreamsMeasurementProtocolSecretsGet(name: string): Promise<GoogleAnalyticsAdminV1betaMeasurementProtocolSecret>
[src]

Lookup for a single "GA4" MeasurementProtocolSecret.

@param name

Required. The name of the measurement protocol secret to lookup. Format: properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}

§
propertiesDataStreamsMeasurementProtocolSecretsList(parent: string, opts?: PropertiesDataStreamsMeasurementProtocolSecretsListOptions): Promise<GoogleAnalyticsAdminV1betaListMeasurementProtocolSecretsResponse>
[src]

Returns child MeasurementProtocolSecrets under the specified parent Property.

@param parent

Required. The resource name of the parent stream. Format: properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets

§

Updates a measurement protocol secret.

@param name

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.

@param name

Output only. Resource name of this Data Stream. Format: properties/{property_id}/dataStreams/{stream_id} Example: "properties/1000/dataStreams/2000"

§
propertiesDelete(name: string): Promise<GoogleAnalyticsAdminV1betaProperty>
[src]

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.

@param name

Required. The name of the Property to soft-delete. Format: properties/{property_id} Example: "properties/1000"

§
propertiesFirebaseLinksCreate(parent: string, req: GoogleAnalyticsAdminV1betaFirebaseLink): Promise<GoogleAnalyticsAdminV1betaFirebaseLink>
[src]

Creates a FirebaseLink. Properties can have at most one FirebaseLink.

@param parent

Required. Format: properties/{property_id} Example: properties/1234

§
propertiesFirebaseLinksDelete(name: string): Promise<GoogleProtobufEmpty>
[src]

Deletes a FirebaseLink on a property

@param name

Required. Format: properties/{property_id}/firebaseLinks/{firebase_link_id} Example: properties/1234/firebaseLinks/5678

§
propertiesGet(name: string): Promise<GoogleAnalyticsAdminV1betaProperty>
[src]

Lookup for a single "GA4" Property.

@param name

Required. The name of the property to lookup. Format: properties/{property_id} Example: "properties/1000"

§
propertiesGetDataRetentionSettings(name: string): Promise<GoogleAnalyticsAdminV1betaDataRetentionSettings>
[src]

Returns the singleton data retention settings for this property.

@param name

Required. The name of the settings to lookup. Format: properties/{property}/dataRetentionSettings Example: "properties/1000/dataRetentionSettings"

§
propertiesGoogleAdsLinksCreate(parent: string, req: GoogleAnalyticsAdminV1betaGoogleAdsLink): Promise<GoogleAnalyticsAdminV1betaGoogleAdsLink>
[src]

Creates a GoogleAdsLink.

@param parent

Required. Example format: properties/1234

§
propertiesGoogleAdsLinksDelete(name: string): Promise<GoogleProtobufEmpty>
[src]

Deletes a GoogleAdsLink on a property

@param name

Required. Example format: properties/1234/googleAdsLinks/5678

§

Updates a GoogleAdsLink on a property

@param name

Output only. Format: properties/{propertyId}/googleAdsLinks/{googleAdsLinkId} Note: googleAdsLinkId is not the Google Ads customer ID.

§
propertiesKeyEventsCreate(parent: string, req: GoogleAnalyticsAdminV1betaKeyEvent): Promise<GoogleAnalyticsAdminV1betaKeyEvent>
[src]

Creates a Key Event.

@param parent

Required. The resource name of the parent property where this Key Event will be created. Format: properties/123

§
propertiesKeyEventsDelete(name: string): Promise<GoogleProtobufEmpty>
[src]

Deletes a Key Event.

@param name

Required. The resource name of the Key Event to delete. Format: properties/{property}/keyEvents/{key_event} Example: "properties/123/keyEvents/456"

§
propertiesKeyEventsGet(name: string): Promise<GoogleAnalyticsAdminV1betaKeyEvent>
[src]

Retrieve a single Key Event.

@param name

Required. The resource name of the Key Event to retrieve. Format: properties/{property}/keyEvents/{key_event} Example: "properties/123/keyEvents/456"

§
propertiesKeyEventsList(parent: string, opts?: PropertiesKeyEventsListOptions): Promise<GoogleAnalyticsAdminV1betaListKeyEventsResponse>
[src]

Returns a list of Key Events in the specified parent property. Returns an empty list if no Key Events are found.

@param parent

Required. The resource name of the parent property. Example: 'properties/123'

§

Updates a Key Event.

@param name

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.

@param name

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.

@param entity

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.

@param name

Output only. Resource name for this DataRetentionSetting resource. Format: properties/{property}/dataRetentionSettings