Google Analytics Admin V1beta Client - Class AnalyticsAdminServiceClient (0.14.0)

Reference documentation and code samples for the Google Analytics Admin V1beta Client class AnalyticsAdminServiceClient.

Service Description: Service Interface for the Analytics Admin API (GA4).

This class is currently experimental and may be subject to changes.

Namespace

Google \ Analytics \ Admin \ V1beta \ Client

Methods

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ credentialsConfig array

Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .

↳ disableRetries bool

Determines whether or not retries defined by the client configuration should be disabled. Defaults to false.

↳ clientConfig string|array

Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

acknowledgeUserDataCollection

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.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::acknowledgeUserDataCollectionAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\AcknowledgeUserDataCollectionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\AcknowledgeUserDataCollectionResponse

archiveCustomDimension

Archives a CustomDimension on a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::archiveCustomDimensionAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ArchiveCustomDimensionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

archiveCustomMetric

Archives a CustomMetric on a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::archiveCustomMetricAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ArchiveCustomMetricRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

createConversionEvent

Creates a conversion event with the specified attributes.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::createConversionEventAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateConversionEventRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\ConversionEvent

createCustomDimension

Creates a CustomDimension.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::createCustomDimensionAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateCustomDimensionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\CustomDimension

createCustomMetric

Creates a CustomMetric.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::createCustomMetricAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateCustomMetricRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\CustomMetric

createDataStream

Creates a DataStream.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::createDataStreamAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateDataStreamRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\DataStream

Creates a FirebaseLink.

Properties can have at most one FirebaseLink.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::createFirebaseLinkAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateFirebaseLinkRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\FirebaseLink

Creates a GoogleAdsLink.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::createGoogleAdsLinkAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateGoogleAdsLinkRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\GoogleAdsLink

createMeasurementProtocolSecret

Creates a measurement protocol secret.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::createMeasurementProtocolSecretAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateMeasurementProtocolSecretRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\MeasurementProtocolSecret

createProperty

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

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::createPropertyAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreatePropertyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\Property

deleteAccount

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, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772

Returns an error if the target is not found.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::deleteAccountAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteAccountRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

deleteConversionEvent

Deletes a conversion event in a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::deleteConversionEventAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteConversionEventRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

deleteDataStream

Deletes a DataStream on a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::deleteDataStreamAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteDataStreamRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Deletes a FirebaseLink on a property

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::deleteFirebaseLinkAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteFirebaseLinkRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Deletes a GoogleAdsLink on a property

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::deleteGoogleAdsLinkAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteGoogleAdsLinkRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

deleteMeasurementProtocolSecret

Deletes target MeasurementProtocolSecret.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::deleteMeasurementProtocolSecretAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteMeasurementProtocolSecretRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

deleteProperty

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 a GA4 Property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::deletePropertyAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeletePropertyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\Property

getAccount

Lookup for a single Account.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::getAccountAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetAccountRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\Account

getConversionEvent

Retrieve a single conversion event.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::getConversionEventAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetConversionEventRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\ConversionEvent

getCustomDimension

Lookup for a single CustomDimension.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::getCustomDimensionAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetCustomDimensionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\CustomDimension

getCustomMetric

Lookup for a single CustomMetric.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::getCustomMetricAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetCustomMetricRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\CustomMetric

getDataRetentionSettings

Returns the singleton data retention settings for this property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::getDataRetentionSettingsAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetDataRetentionSettingsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\DataRetentionSettings

getDataSharingSettings

Get data sharing settings on an account.

Data sharing settings are singletons.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::getDataSharingSettingsAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetDataSharingSettingsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\DataSharingSettings

getDataStream

Lookup for a single DataStream.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::getDataStreamAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetDataStreamRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\DataStream

getMeasurementProtocolSecret

Lookup for a single "GA4" MeasurementProtocolSecret.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::getMeasurementProtocolSecretAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetMeasurementProtocolSecretRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\MeasurementProtocolSecret

getProperty

Lookup for a single "GA4" Property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::getPropertyAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetPropertyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\Property

listAccountSummaries

Returns summaries of all accounts accessible by the caller.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::listAccountSummariesAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListAccountSummariesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listAccounts

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.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::listAccountsAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListAccountsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listConversionEvents

Returns a list of conversion events in the specified parent property.

Returns an empty list if no conversion events are found.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::listConversionEventsAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListConversionEventsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listCustomDimensions

Lists CustomDimensions on a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::listCustomDimensionsAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListCustomDimensionsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listCustomMetrics

Lists CustomMetrics on a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::listCustomMetricsAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListCustomMetricsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listDataStreams

Lists DataStreams on a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::listDataStreamsAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListDataStreamsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

Lists FirebaseLinks on a property.

Properties can have at most one FirebaseLink.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::listFirebaseLinksAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListFirebaseLinksRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

Lists GoogleAdsLinks on a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::listGoogleAdsLinksAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListGoogleAdsLinksRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listMeasurementProtocolSecrets

Returns child MeasurementProtocolSecrets under the specified parent Property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::listMeasurementProtocolSecretsAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListMeasurementProtocolSecretsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listProperties

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.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::listPropertiesAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListPropertiesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

provisionAccountTicket

Requests a ticket for creating an account.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::provisionAccountTicketAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ProvisionAccountTicketRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\ProvisionAccountTicketResponse

runAccessReport

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. The property must be in Google Analytics 360. 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 async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::runAccessReportAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\RunAccessReportRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\RunAccessReportResponse

searchChangeHistoryEvents

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

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::searchChangeHistoryEventsAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\SearchChangeHistoryEventsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

updateAccount

Updates an account.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::updateAccountAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateAccountRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\Account

updateCustomDimension

Updates a CustomDimension on a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::updateCustomDimensionAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateCustomDimensionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\CustomDimension

updateCustomMetric

Updates a CustomMetric on a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::updateCustomMetricAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateCustomMetricRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\CustomMetric

updateDataRetentionSettings

Updates the singleton data retention settings for this property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::updateDataRetentionSettingsAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateDataRetentionSettingsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\DataRetentionSettings

updateDataStream

Updates a DataStream on a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::updateDataStreamAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateDataStreamRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\DataStream

Updates a GoogleAdsLink on a property

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::updateGoogleAdsLinkAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateGoogleAdsLinkRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\GoogleAdsLink

updateMeasurementProtocolSecret

Updates a measurement protocol secret.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::updateMeasurementProtocolSecretAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateMeasurementProtocolSecretRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\MeasurementProtocolSecret

updateProperty

Updates a property.

The async variant is Google\Analytics\Admin\V1beta\Client\BaseClient\self::updatePropertyAsync() .

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdatePropertyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Analytics\Admin\V1beta\Property

acknowledgeUserDataCollectionAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\AcknowledgeUserDataCollectionRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

archiveCustomDimensionAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ArchiveCustomDimensionRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

archiveCustomMetricAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ArchiveCustomMetricRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createConversionEventAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateConversionEventRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createCustomDimensionAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateCustomDimensionRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createCustomMetricAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateCustomMetricRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createDataStreamAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateDataStreamRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createFirebaseLinkAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateFirebaseLinkRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createGoogleAdsLinkAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateGoogleAdsLinkRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createMeasurementProtocolSecretAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreateMeasurementProtocolSecretRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createPropertyAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\CreatePropertyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteAccountAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteAccountRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteConversionEventAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteConversionEventRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteDataStreamAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteDataStreamRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteFirebaseLinkAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteFirebaseLinkRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteGoogleAdsLinkAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteGoogleAdsLinkRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteMeasurementProtocolSecretAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeleteMeasurementProtocolSecretRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deletePropertyAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\DeletePropertyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getAccountAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetAccountRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getConversionEventAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetConversionEventRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getCustomDimensionAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetCustomDimensionRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getCustomMetricAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetCustomMetricRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getDataRetentionSettingsAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetDataRetentionSettingsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getDataSharingSettingsAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetDataSharingSettingsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getDataStreamAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetDataStreamRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getMeasurementProtocolSecretAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetMeasurementProtocolSecretRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getPropertyAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\GetPropertyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listAccountSummariesAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListAccountSummariesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listAccountsAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListAccountsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listConversionEventsAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListConversionEventsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listCustomDimensionsAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListCustomDimensionsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listCustomMetricsAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListCustomMetricsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listDataStreamsAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListDataStreamsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listFirebaseLinksAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListFirebaseLinksRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listGoogleAdsLinksAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListGoogleAdsLinksRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listMeasurementProtocolSecretsAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListMeasurementProtocolSecretsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listPropertiesAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ListPropertiesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

provisionAccountTicketAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\ProvisionAccountTicketRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

runAccessReportAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\RunAccessReportRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

searchChangeHistoryEventsAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\SearchChangeHistoryEventsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateAccountAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateAccountRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateCustomDimensionAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateCustomDimensionRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateCustomMetricAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateCustomMetricRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateDataRetentionSettingsAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateDataRetentionSettingsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateDataStreamAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateDataStreamRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateGoogleAdsLinkAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateGoogleAdsLinkRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateMeasurementProtocolSecretAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdateMeasurementProtocolSecretRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updatePropertyAsync

Parameters
NameDescription
request Google\Analytics\Admin\V1beta\UpdatePropertyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

static::accountName

Formats a string containing the fully-qualified path to represent a account resource.

Parameter
NameDescription
account string
Returns
TypeDescription
stringThe formatted account resource.

static::conversionEventName

Formats a string containing the fully-qualified path to represent a conversion_event resource.

Parameters
NameDescription
property string
conversionEvent string
Returns
TypeDescription
stringThe formatted conversion_event resource.

static::customDimensionName

Formats a string containing the fully-qualified path to represent a custom_dimension resource.

Parameters
NameDescription
property string
customDimension string
Returns
TypeDescription
stringThe formatted custom_dimension resource.

static::customMetricName

Formats a string containing the fully-qualified path to represent a custom_metric resource.

Parameters
NameDescription
property string
customMetric string
Returns
TypeDescription
stringThe formatted custom_metric resource.

static::dataRetentionSettingsName

Formats a string containing the fully-qualified path to represent a data_retention_settings resource.

Parameter
NameDescription
property string
Returns
TypeDescription
stringThe formatted data_retention_settings resource.

static::dataSharingSettingsName

Formats a string containing the fully-qualified path to represent a data_sharing_settings resource.

Parameter
NameDescription
account string
Returns
TypeDescription
stringThe formatted data_sharing_settings resource.

static::dataStreamName

Formats a string containing the fully-qualified path to represent a data_stream resource.

Parameters
NameDescription
property string
dataStream string
Returns
TypeDescription
stringThe formatted data_stream resource.

static::firebaseLinkName

Formats a string containing the fully-qualified path to represent a firebase_link resource.

Parameters
NameDescription
property string
firebaseLink string
Returns
TypeDescription
stringThe formatted firebase_link resource.

static::googleAdsLinkName

Formats a string containing the fully-qualified path to represent a google_ads_link resource.

Parameters
NameDescription
property string
googleAdsLink string
Returns
TypeDescription
stringThe formatted google_ads_link resource.

static::measurementProtocolSecretName

Formats a string containing the fully-qualified path to represent a measurement_protocol_secret resource.

Parameters
NameDescription
property string
dataStream string
measurementProtocolSecret string
Returns
TypeDescription
stringThe formatted measurement_protocol_secret resource.

static::propertyName

Formats a string containing the fully-qualified path to represent a property resource.

Parameter
NameDescription
property string
Returns
TypeDescription
stringThe formatted property resource.

static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported: Template: Pattern

  • account: accounts/{account}
  • conversionEvent: properties/{property}/conversionEvents/{conversion_event}
  • customDimension: properties/{property}/customDimensions/{custom_dimension}
  • customMetric: properties/{property}/customMetrics/{custom_metric}
  • dataRetentionSettings: properties/{property}/dataRetentionSettings
  • dataSharingSettings: accounts/{account}/dataSharingSettings
  • dataStream: properties/{property}/dataStreams/{data_stream}
  • firebaseLink: properties/{property}/firebaseLinks/{firebase_link}
  • googleAdsLink: properties/{property}/googleAdsLinks/{google_ads_link}
  • measurementProtocolSecret: properties/{property}/dataStreams/{data_stream}/measurementProtocolSecrets/{measurement_protocol_secret}
  • property: properties/{property}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.