class Properties extends Resource (View source)

The "properties" collection of methods.

Typical usage is:

 $analyticsadminService = new Google\Service\GoogleAnalyticsAdmin(...);
 $properties = $analyticsadminService->properties;

Methods

acknowledgeUserDataCollection(string $property, GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionRequest $postBody, array $optParams = [])

Acknowledges the terms of user data collection for the specified property.

create(GoogleAnalyticsAdminV1betaProperty $postBody, array $optParams = [])

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

delete(string $name, array $optParams = [])

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.

get(string $name, array $optParams = [])

Lookup for a single "GA4" Property. (properties.get)

getDataRetentionSettings(string $name, array $optParams = [])

Returns the singleton data retention settings for this property.

listProperties(array $optParams = [])

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.

patch(string $name, GoogleAnalyticsAdminV1betaProperty $postBody, array $optParams = [])

Updates a property. (properties.patch)

runAccessReport(string $entity, GoogleAnalyticsAdminV1betaRunAccessReportRequest $postBody, array $optParams = [])

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. (properties.runAccessReport)

updateDataRetentionSettings(string $name, GoogleAnalyticsAdminV1betaDataRetentionSettings $postBody, array $optParams = [])

Updates the singleton data retention settings for this property.

Details

GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionResponse acknowledgeUserDataCollection(string $property, GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionRequest $postBody, array $optParams = [])

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. (properties.acknowledgeUserDataCollection)

Parameters

string $property

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

GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionResponse

Exceptions

Exception

GoogleAnalyticsAdminV1betaProperty create(GoogleAnalyticsAdminV1betaProperty $postBody, array $optParams = [])

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

(properties.create)

Parameters

GoogleAnalyticsAdminV1betaProperty $postBody
array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaProperty

Exceptions

Exception

GoogleAnalyticsAdminV1betaProperty delete(string $name, array $optParams = [])

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. (properties.delete)

Parameters

string $name

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

array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaProperty

Exceptions

Exception

GoogleAnalyticsAdminV1betaProperty get(string $name, array $optParams = [])

Lookup for a single "GA4" Property. (properties.get)

Parameters

string $name

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

array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaProperty

Exceptions

Exception

GoogleAnalyticsAdminV1betaDataRetentionSettings getDataRetentionSettings(string $name, array $optParams = [])

Returns the singleton data retention settings for this property.

(properties.getDataRetentionSettings)

Parameters

string $name

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

array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaDataRetentionSettings

Exceptions

Exception

GoogleAnalyticsAdminV1betaListPropertiesResponse listProperties(array $optParams = [])

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.

(properties.listProperties)

Parameters

array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaListPropertiesResponse

Exceptions

Exception

GoogleAnalyticsAdminV1betaProperty patch(string $name, GoogleAnalyticsAdminV1betaProperty $postBody, array $optParams = [])

Updates a property. (properties.patch)

Parameters

string $name

Output only. Resource name of this property. Format: properties/{property_id} Example: "properties/1000"

GoogleAnalyticsAdminV1betaProperty $postBody
array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaProperty

Exceptions

Exception

GoogleAnalyticsAdminV1betaRunAccessReportResponse runAccessReport(string $entity, GoogleAnalyticsAdminV1betaRunAccessReportRequest $postBody, array $optParams = [])

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. (properties.runAccessReport)

Parameters

string $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.

GoogleAnalyticsAdminV1betaRunAccessReportRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaRunAccessReportResponse

Exceptions

Exception

GoogleAnalyticsAdminV1betaDataRetentionSettings updateDataRetentionSettings(string $name, GoogleAnalyticsAdminV1betaDataRetentionSettings $postBody, array $optParams = [])

Updates the singleton data retention settings for this property.

(properties.updateDataRetentionSettings)

Parameters

string $name

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

GoogleAnalyticsAdminV1betaDataRetentionSettings $postBody
array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaDataRetentionSettings

Exceptions

Exception