class Accounts extends Resource (View source)

The "accounts" collection of methods.

Typical usage is:

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

Methods

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

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.

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

Lookup for a single Account. (accounts.get)

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

Get data sharing settings on an account. Data sharing settings are singletons. (accounts.getDataSharingSettings)

listAccounts(array $optParams = [])

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.

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

Updates an account. (accounts.patch)

provisionAccountTicket(GoogleAnalyticsAdminV1betaProvisionAccountTicketRequest $postBody, array $optParams = [])

Requests a ticket for creating an account. (accounts.provisionAccountTicket)

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

searchChangeHistoryEvents(string $account, GoogleAnalyticsAdminV1betaSearchChangeHistoryEventsRequest $postBody, array $optParams = [])

Searches through all changes to an account or its children given the specified set of filters. (accounts.searchChangeHistoryEvents)

Details

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

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

Parameters

string $name

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

array $optParams

Optional parameters.

Return Value

GoogleProtobufEmpty

Exceptions

Exception

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

Lookup for a single Account. (accounts.get)

Parameters

string $name

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

array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaAccount

Exceptions

Exception

GoogleAnalyticsAdminV1betaDataSharingSettings getDataSharingSettings(string $name, array $optParams = [])

Get data sharing settings on an account. Data sharing settings are singletons. (accounts.getDataSharingSettings)

Parameters

string $name

Required. The name of the settings to lookup. Format: accounts/{account}/dataSharingSettings Example: accounts/1000/dataSharingSettings

array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaDataSharingSettings

Exceptions

Exception

GoogleAnalyticsAdminV1betaListAccountsResponse listAccounts(array $optParams = [])

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.

(accounts.listAccounts)

Parameters

array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaListAccountsResponse

Exceptions

Exception

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

Updates an account. (accounts.patch)

Parameters

string $name

Output only. Resource name of this account. Format: accounts/{account} Example: "accounts/100"

GoogleAnalyticsAdminV1betaAccount $postBody
array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaAccount

Exceptions

Exception

GoogleAnalyticsAdminV1betaProvisionAccountTicketResponse provisionAccountTicket(GoogleAnalyticsAdminV1betaProvisionAccountTicketRequest $postBody, array $optParams = [])

Requests a ticket for creating an account. (accounts.provisionAccountTicket)

Parameters

GoogleAnalyticsAdminV1betaProvisionAccountTicketRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaProvisionAccountTicketResponse

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. (accounts.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

GoogleAnalyticsAdminV1betaSearchChangeHistoryEventsResponse searchChangeHistoryEvents(string $account, GoogleAnalyticsAdminV1betaSearchChangeHistoryEventsRequest $postBody, array $optParams = [])

Searches through all changes to an account or its children given the specified set of filters. (accounts.searchChangeHistoryEvents)

Parameters

string $account

Required. The account resource for which to return change history resources. Format: accounts/{account} Example: accounts/100

GoogleAnalyticsAdminV1betaSearchChangeHistoryEventsRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleAnalyticsAdminV1betaSearchChangeHistoryEventsResponse

Exceptions

Exception