Google Analytics Admin API . properties

Instance Methods

androidAppDataStreams()

Returns the androidAppDataStreams Resource.

conversionEvents()

Returns the conversionEvents Resource.

customDimensions()

Returns the customDimensions Resource.

customMetrics()

Returns the customMetrics Resource.

dataStreams()

Returns the dataStreams Resource.

displayVideo360AdvertiserLinkProposals()

Returns the displayVideo360AdvertiserLinkProposals Resource.

displayVideo360AdvertiserLinks()

Returns the displayVideo360AdvertiserLinks Resource.

firebaseLinks()

Returns the firebaseLinks Resource.

googleAdsLinks()

Returns the googleAdsLinks Resource.

iosAppDataStreams()

Returns the iosAppDataStreams Resource.

userLinks()

Returns the userLinks Resource.

webDataStreams()

Returns the webDataStreams Resource.

acknowledgeUserDataCollection(property, body=None, x__xgafv=None)

Acknowledges the terms of user data collection for the specified property. This acknowledgement must be completed (either in the Google Analytics UI or via this API) before MeasurementProtocolSecret resources may be created.

close()

Close httplib2 connections.

create(body=None, x__xgafv=None)

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

delete(name, x__xgafv=None)

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, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found, or is not an GA4 Property.

get(name, x__xgafv=None)

Lookup for a single "GA4" Property.

getDataRetentionSettings(name, x__xgafv=None)

Returns the singleton data retention settings for this property.

getGoogleSignalsSettings(name, x__xgafv=None)

Lookup for Google Signals settings for a property.

list(filter=None, pageSize=None, pageToken=None, showDeleted=None, x__xgafv=None)

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.

list_next(previous_request, previous_response)

Retrieves the next page of results.

patch(name, body=None, updateMask=None, x__xgafv=None)

Updates a property.

updateDataRetentionSettings(name, body=None, updateMask=None, x__xgafv=None)

Updates the singleton data retention settings for this property.

updateGoogleSignalsSettings(name, body=None, updateMask=None, x__xgafv=None)

Updates Google Signals settings for a property.

Method Details

acknowledgeUserDataCollection(property, body=None, x__xgafv=None)
Acknowledges the terms of user data collection for the specified property. This acknowledgement must be completed (either in the Google Analytics UI or via this API) before MeasurementProtocolSecret resources may be created.

Args:
  property: string, Required. The property for which to acknowledge user data collection. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for AcknowledgeUserDataCollection RPC.
  "acknowledgement": "A String", # Required. An acknowledgement that the caller of this method understands the terms of user data collection. This field must contain the exact value: "I acknowledge that I have the necessary privacy disclosures and rights from my end users for the collection and processing of their data, including the association of such data with the visitation information Google Analytics collects from my site and/or app property."
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for AcknowledgeUserDataCollection RPC.
}
close()
Close httplib2 connections.
create(body=None, x__xgafv=None)
Creates an "GA4" property with the specified location and attributes.

Args:
  body: object, The request body.
    The object takes the form of:

{ # A resource message representing a Google Analytics GA4 property.
  "account": "A String", # Immutable. The resource name of the parent account Format: accounts/{account_id} Example: "accounts/123"
  "createTime": "A String", # Output only. Time when the entity was originally created.
  "currencyCode": "A String", # The currency type used in reports involving monetary values. Format: https://en.wikipedia.org/wiki/ISO_4217 Examples: "USD", "EUR", "JPY"
  "deleteTime": "A String", # Output only. If set, the time at which this property was trashed. If not set, then this property is not currently in the trash can.
  "displayName": "A String", # Required. Human-readable display name for this property. The max allowed display name length is 100 UTF-16 code units.
  "expireTime": "A String", # Output only. If set, the time at which this trashed property will be permanently deleted. If not set, then this property is not currently in the trash can and is not slated to be deleted.
  "industryCategory": "A String", # Industry associated with this property Example: AUTOMOTIVE, FOOD_AND_DRINK
  "name": "A String", # Output only. Resource name of this property. Format: properties/{property_id} Example: "properties/1000"
  "parent": "A String", # Immutable. Resource name of this property's logical parent. Note: The Property-Moving UI can be used to change the parent. Format: accounts/{account} Example: "accounts/100"
  "serviceLevel": "A String", # Output only. The Google Analytics service level that applies to this property.
  "timeZone": "A String", # Required. Reporting Time Zone, used as the day boundary for reports, regardless of where the data originates. If the time zone honors DST, Analytics will automatically adjust for the changes. NOTE: Changing the time zone only affects data going forward, and is not applied retroactively. Format: https://www.iana.org/time-zones Example: "America/Los_Angeles"
  "updateTime": "A String", # Output only. Time when entity payload fields were last updated.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A resource message representing a Google Analytics GA4 property.
  "account": "A String", # Immutable. The resource name of the parent account Format: accounts/{account_id} Example: "accounts/123"
  "createTime": "A String", # Output only. Time when the entity was originally created.
  "currencyCode": "A String", # The currency type used in reports involving monetary values. Format: https://en.wikipedia.org/wiki/ISO_4217 Examples: "USD", "EUR", "JPY"
  "deleteTime": "A String", # Output only. If set, the time at which this property was trashed. If not set, then this property is not currently in the trash can.
  "displayName": "A String", # Required. Human-readable display name for this property. The max allowed display name length is 100 UTF-16 code units.
  "expireTime": "A String", # Output only. If set, the time at which this trashed property will be permanently deleted. If not set, then this property is not currently in the trash can and is not slated to be deleted.
  "industryCategory": "A String", # Industry associated with this property Example: AUTOMOTIVE, FOOD_AND_DRINK
  "name": "A String", # Output only. Resource name of this property. Format: properties/{property_id} Example: "properties/1000"
  "parent": "A String", # Immutable. Resource name of this property's logical parent. Note: The Property-Moving UI can be used to change the parent. Format: accounts/{account} Example: "accounts/100"
  "serviceLevel": "A String", # Output only. The Google Analytics service level that applies to this property.
  "timeZone": "A String", # Required. Reporting Time Zone, used as the day boundary for reports, regardless of where the data originates. If the time zone honors DST, Analytics will automatically adjust for the changes. NOTE: Changing the time zone only affects data going forward, and is not applied retroactively. Format: https://www.iana.org/time-zones Example: "America/Los_Angeles"
  "updateTime": "A String", # Output only. Time when entity payload fields were last updated.
}
delete(name, x__xgafv=None)
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, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found, or is not an GA4 Property.

Args:
  name: string, Required. The name of the Property to soft-delete. Format: properties/{property_id} Example: "properties/1000" (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A resource message representing a Google Analytics GA4 property.
  "account": "A String", # Immutable. The resource name of the parent account Format: accounts/{account_id} Example: "accounts/123"
  "createTime": "A String", # Output only. Time when the entity was originally created.
  "currencyCode": "A String", # The currency type used in reports involving monetary values. Format: https://en.wikipedia.org/wiki/ISO_4217 Examples: "USD", "EUR", "JPY"
  "deleteTime": "A String", # Output only. If set, the time at which this property was trashed. If not set, then this property is not currently in the trash can.
  "displayName": "A String", # Required. Human-readable display name for this property. The max allowed display name length is 100 UTF-16 code units.
  "expireTime": "A String", # Output only. If set, the time at which this trashed property will be permanently deleted. If not set, then this property is not currently in the trash can and is not slated to be deleted.
  "industryCategory": "A String", # Industry associated with this property Example: AUTOMOTIVE, FOOD_AND_DRINK
  "name": "A String", # Output only. Resource name of this property. Format: properties/{property_id} Example: "properties/1000"
  "parent": "A String", # Immutable. Resource name of this property's logical parent. Note: The Property-Moving UI can be used to change the parent. Format: accounts/{account} Example: "accounts/100"
  "serviceLevel": "A String", # Output only. The Google Analytics service level that applies to this property.
  "timeZone": "A String", # Required. Reporting Time Zone, used as the day boundary for reports, regardless of where the data originates. If the time zone honors DST, Analytics will automatically adjust for the changes. NOTE: Changing the time zone only affects data going forward, and is not applied retroactively. Format: https://www.iana.org/time-zones Example: "America/Los_Angeles"
  "updateTime": "A String", # Output only. Time when entity payload fields were last updated.
}
get(name, x__xgafv=None)
Lookup for a single "GA4" Property.

Args:
  name: string, Required. The name of the property to lookup. Format: properties/{property_id} Example: "properties/1000" (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A resource message representing a Google Analytics GA4 property.
  "account": "A String", # Immutable. The resource name of the parent account Format: accounts/{account_id} Example: "accounts/123"
  "createTime": "A String", # Output only. Time when the entity was originally created.
  "currencyCode": "A String", # The currency type used in reports involving monetary values. Format: https://en.wikipedia.org/wiki/ISO_4217 Examples: "USD", "EUR", "JPY"
  "deleteTime": "A String", # Output only. If set, the time at which this property was trashed. If not set, then this property is not currently in the trash can.
  "displayName": "A String", # Required. Human-readable display name for this property. The max allowed display name length is 100 UTF-16 code units.
  "expireTime": "A String", # Output only. If set, the time at which this trashed property will be permanently deleted. If not set, then this property is not currently in the trash can and is not slated to be deleted.
  "industryCategory": "A String", # Industry associated with this property Example: AUTOMOTIVE, FOOD_AND_DRINK
  "name": "A String", # Output only. Resource name of this property. Format: properties/{property_id} Example: "properties/1000"
  "parent": "A String", # Immutable. Resource name of this property's logical parent. Note: The Property-Moving UI can be used to change the parent. Format: accounts/{account} Example: "accounts/100"
  "serviceLevel": "A String", # Output only. The Google Analytics service level that applies to this property.
  "timeZone": "A String", # Required. Reporting Time Zone, used as the day boundary for reports, regardless of where the data originates. If the time zone honors DST, Analytics will automatically adjust for the changes. NOTE: Changing the time zone only affects data going forward, and is not applied retroactively. Format: https://www.iana.org/time-zones Example: "America/Los_Angeles"
  "updateTime": "A String", # Output only. Time when entity payload fields were last updated.
}
getDataRetentionSettings(name, x__xgafv=None)
Returns the singleton data retention settings for this property.

Args:
  name: string, Required. The name of the settings to lookup. Format: properties/{property}/dataRetentionSettings Example: "properties/1000/dataRetentionSettings" (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Settings values for data retention. This is a singleton resource.
  "eventDataRetention": "A String", # The length of time that event-level data is retained.
  "name": "A String", # Output only. Resource name for this DataRetentionSetting resource. Format: properties/{property}/dataRetentionSettings
  "resetUserDataOnNewActivity": True or False, # If true, reset the retention period for the user identifier with every event from that user.
}
getGoogleSignalsSettings(name, x__xgafv=None)
Lookup for Google Signals settings for a property.

Args:
  name: string, Required. The name of the google signals settings to retrieve. Format: properties/{property}/googleSignalsSettings (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Settings values for Google Signals. This is a singleton resource.
  "consent": "A String", # Output only. Terms of Service acceptance.
  "name": "A String", # Output only. Resource name of this setting. Format: properties/{property_id}/googleSignalsSettings Example: "properties/1000/googleSignalsSettings"
  "state": "A String", # Status of this setting.
}
list(filter=None, pageSize=None, pageToken=None, showDeleted=None, x__xgafv=None)
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.

Args:
  filter: string, Required. An expression for filtering the results of the request. Fields eligible for filtering are: `parent:`(The resource name of the parent account) or `firebase_project:`(The id or number of the linked firebase project). Some examples of filters: ``` | Filter | Description | |-----------------------------|-------------------------------------------| | parent:accounts/123 | The account with account id: 123. | | firebase_project:project-id | The firebase project with id: project-id. | | firebase_project:123 | The firebase project with number: 123. | ```
  pageSize: integer, The maximum number of resources to return. The service may return fewer than this value, even if there are additional pages. If unspecified, at most 50 resources will be returned. The maximum value is 200; (higher values will be coerced to the maximum)
  pageToken: string, A page token, received from a previous `ListProperties` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListProperties` must match the call that provided the page token.
  showDeleted: boolean, Whether to include soft-deleted (ie: "trashed") Properties in the results. Properties can be inspected to determine whether they are deleted or not.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for ListProperties RPC.
  "nextPageToken": "A String", # A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
  "properties": [ # Results that matched the filter criteria and were accessible to the caller.
    { # A resource message representing a Google Analytics GA4 property.
      "account": "A String", # Immutable. The resource name of the parent account Format: accounts/{account_id} Example: "accounts/123"
      "createTime": "A String", # Output only. Time when the entity was originally created.
      "currencyCode": "A String", # The currency type used in reports involving monetary values. Format: https://en.wikipedia.org/wiki/ISO_4217 Examples: "USD", "EUR", "JPY"
      "deleteTime": "A String", # Output only. If set, the time at which this property was trashed. If not set, then this property is not currently in the trash can.
      "displayName": "A String", # Required. Human-readable display name for this property. The max allowed display name length is 100 UTF-16 code units.
      "expireTime": "A String", # Output only. If set, the time at which this trashed property will be permanently deleted. If not set, then this property is not currently in the trash can and is not slated to be deleted.
      "industryCategory": "A String", # Industry associated with this property Example: AUTOMOTIVE, FOOD_AND_DRINK
      "name": "A String", # Output only. Resource name of this property. Format: properties/{property_id} Example: "properties/1000"
      "parent": "A String", # Immutable. Resource name of this property's logical parent. Note: The Property-Moving UI can be used to change the parent. Format: accounts/{account} Example: "accounts/100"
      "serviceLevel": "A String", # Output only. The Google Analytics service level that applies to this property.
      "timeZone": "A String", # Required. Reporting Time Zone, used as the day boundary for reports, regardless of where the data originates. If the time zone honors DST, Analytics will automatically adjust for the changes. NOTE: Changing the time zone only affects data going forward, and is not applied retroactively. Format: https://www.iana.org/time-zones Example: "America/Los_Angeles"
      "updateTime": "A String", # Output only. Time when entity payload fields were last updated.
    },
  ],
}
list_next(previous_request, previous_response)
Retrieves the next page of results.

Args:
  previous_request: The request for the previous page. (required)
  previous_response: The response from the request for the previous page. (required)

Returns:
  A request object that you can call 'execute()' on to request the next
  page. Returns None if there are no more items in the collection.
    
patch(name, body=None, updateMask=None, x__xgafv=None)
Updates a property.

Args:
  name: string, Output only. Resource name of this property. Format: properties/{property_id} Example: "properties/1000" (required)
  body: object, The request body.
    The object takes the form of:

{ # A resource message representing a Google Analytics GA4 property.
  "account": "A String", # Immutable. The resource name of the parent account Format: accounts/{account_id} Example: "accounts/123"
  "createTime": "A String", # Output only. Time when the entity was originally created.
  "currencyCode": "A String", # The currency type used in reports involving monetary values. Format: https://en.wikipedia.org/wiki/ISO_4217 Examples: "USD", "EUR", "JPY"
  "deleteTime": "A String", # Output only. If set, the time at which this property was trashed. If not set, then this property is not currently in the trash can.
  "displayName": "A String", # Required. Human-readable display name for this property. The max allowed display name length is 100 UTF-16 code units.
  "expireTime": "A String", # Output only. If set, the time at which this trashed property will be permanently deleted. If not set, then this property is not currently in the trash can and is not slated to be deleted.
  "industryCategory": "A String", # Industry associated with this property Example: AUTOMOTIVE, FOOD_AND_DRINK
  "name": "A String", # Output only. Resource name of this property. Format: properties/{property_id} Example: "properties/1000"
  "parent": "A String", # Immutable. Resource name of this property's logical parent. Note: The Property-Moving UI can be used to change the parent. Format: accounts/{account} Example: "accounts/100"
  "serviceLevel": "A String", # Output only. The Google Analytics service level that applies to this property.
  "timeZone": "A String", # Required. Reporting Time Zone, used as the day boundary for reports, regardless of where the data originates. If the time zone honors DST, Analytics will automatically adjust for the changes. NOTE: Changing the time zone only affects data going forward, and is not applied retroactively. Format: https://www.iana.org/time-zones Example: "America/Los_Angeles"
  "updateTime": "A String", # Output only. Time when entity payload fields were last updated.
}

  updateMask: string, Required. The list of fields to be updated. Field names must be in snake case (e.g., "field_to_update"). Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A resource message representing a Google Analytics GA4 property.
  "account": "A String", # Immutable. The resource name of the parent account Format: accounts/{account_id} Example: "accounts/123"
  "createTime": "A String", # Output only. Time when the entity was originally created.
  "currencyCode": "A String", # The currency type used in reports involving monetary values. Format: https://en.wikipedia.org/wiki/ISO_4217 Examples: "USD", "EUR", "JPY"
  "deleteTime": "A String", # Output only. If set, the time at which this property was trashed. If not set, then this property is not currently in the trash can.
  "displayName": "A String", # Required. Human-readable display name for this property. The max allowed display name length is 100 UTF-16 code units.
  "expireTime": "A String", # Output only. If set, the time at which this trashed property will be permanently deleted. If not set, then this property is not currently in the trash can and is not slated to be deleted.
  "industryCategory": "A String", # Industry associated with this property Example: AUTOMOTIVE, FOOD_AND_DRINK
  "name": "A String", # Output only. Resource name of this property. Format: properties/{property_id} Example: "properties/1000"
  "parent": "A String", # Immutable. Resource name of this property's logical parent. Note: The Property-Moving UI can be used to change the parent. Format: accounts/{account} Example: "accounts/100"
  "serviceLevel": "A String", # Output only. The Google Analytics service level that applies to this property.
  "timeZone": "A String", # Required. Reporting Time Zone, used as the day boundary for reports, regardless of where the data originates. If the time zone honors DST, Analytics will automatically adjust for the changes. NOTE: Changing the time zone only affects data going forward, and is not applied retroactively. Format: https://www.iana.org/time-zones Example: "America/Los_Angeles"
  "updateTime": "A String", # Output only. Time when entity payload fields were last updated.
}
updateDataRetentionSettings(name, body=None, updateMask=None, x__xgafv=None)
Updates the singleton data retention settings for this property.

Args:
  name: string, Output only. Resource name for this DataRetentionSetting resource. Format: properties/{property}/dataRetentionSettings (required)
  body: object, The request body.
    The object takes the form of:

{ # Settings values for data retention. This is a singleton resource.
  "eventDataRetention": "A String", # The length of time that event-level data is retained.
  "name": "A String", # Output only. Resource name for this DataRetentionSetting resource. Format: properties/{property}/dataRetentionSettings
  "resetUserDataOnNewActivity": True or False, # If true, reset the retention period for the user identifier with every event from that user.
}

  updateMask: string, Required. The list of fields to be updated. Field names must be in snake case (e.g., "field_to_update"). Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Settings values for data retention. This is a singleton resource.
  "eventDataRetention": "A String", # The length of time that event-level data is retained.
  "name": "A String", # Output only. Resource name for this DataRetentionSetting resource. Format: properties/{property}/dataRetentionSettings
  "resetUserDataOnNewActivity": True or False, # If true, reset the retention period for the user identifier with every event from that user.
}
updateGoogleSignalsSettings(name, body=None, updateMask=None, x__xgafv=None)
Updates Google Signals settings for a property.

Args:
  name: string, Output only. Resource name of this setting. Format: properties/{property_id}/googleSignalsSettings Example: "properties/1000/googleSignalsSettings" (required)
  body: object, The request body.
    The object takes the form of:

{ # Settings values for Google Signals. This is a singleton resource.
  "consent": "A String", # Output only. Terms of Service acceptance.
  "name": "A String", # Output only. Resource name of this setting. Format: properties/{property_id}/googleSignalsSettings Example: "properties/1000/googleSignalsSettings"
  "state": "A String", # Status of this setting.
}

  updateMask: string, Required. The list of fields to be updated. Field names must be in snake case (e.g., "field_to_update"). Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Settings values for Google Signals. This is a singleton resource.
  "consent": "A String", # Output only. Terms of Service acceptance.
  "name": "A String", # Output only. Resource name of this setting. Format: properties/{property_id}/googleSignalsSettings Example: "properties/1000/googleSignalsSettings"
  "state": "A String", # Status of this setting.
}