Google Analytics Admin V1alpha Client - Class AnalyticsAdminServiceClient (0.20.0)

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

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

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:

$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();
try {
    $formattedProperty = $analyticsAdminServiceClient->propertyName('[PROPERTY]');
    $acknowledgement = 'acknowledgement';
    $response = $analyticsAdminServiceClient->acknowledgeUserDataCollection($formattedProperty, $acknowledgement);
} finally {
    $analyticsAdminServiceClient->close();
}

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.

Namespace

Google \ Analytics \ Admin \ V1alpha

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.

Parameters
NameDescription
property string

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

acknowledgement 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."

optionalArgs 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\V1alpha\AcknowledgeUserDataCollectionResponse
Example
use Google\Analytics\Admin\V1alpha\AcknowledgeUserDataCollectionResponse;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedProperty The property for which to acknowledge user data collection. Please see
 *                                  {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 * @param string $acknowledgement   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."
 */
function acknowledge_user_data_collection_sample(
    string $formattedProperty,
    string $acknowledgement
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var AcknowledgeUserDataCollectionResponse $response */
        $response = $analyticsAdminServiceClient->acknowledgeUserDataCollection(
            $formattedProperty,
            $acknowledgement
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedProperty = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
    $acknowledgement = '[ACKNOWLEDGEMENT]';

    acknowledge_user_data_collection_sample($formattedProperty, $acknowledgement);
}

approveDisplayVideo360AdvertiserLinkProposal

Approves a DisplayVideo360AdvertiserLinkProposal.

The DisplayVideo360AdvertiserLinkProposal will be deleted and a new DisplayVideo360AdvertiserLink will be created.

Parameters
NameDescription
name string

Required. The name of the DisplayVideo360AdvertiserLinkProposal to approve. Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678

optionalArgs 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\V1alpha\ApproveDisplayVideo360AdvertiserLinkProposalResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ApproveDisplayVideo360AdvertiserLinkProposalResponse;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the DisplayVideo360AdvertiserLinkProposal to approve.
 *                              Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678
 *                              Please see {@see AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkProposalName()} for help formatting this field.
 */
function approve_display_video360_advertiser_link_proposal_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var ApproveDisplayVideo360AdvertiserLinkProposalResponse $response */
        $response = $analyticsAdminServiceClient->approveDisplayVideo360AdvertiserLinkProposal(
            $formattedName
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkProposalName(
        '[PROPERTY]',
        '[DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL]'
    );

    approve_display_video360_advertiser_link_proposal_sample($formattedName);
}

archiveAudience

Archives an Audience on a property.

Parameters
NameDescription
name string

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

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Example format: properties/1234/audiences/5678
 *                              Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function archive_audience_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->archiveAudience($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    archive_audience_sample($formattedName);
}

archiveCustomDimension

Archives a CustomDimension on a property.

Parameters
NameDescription
name string

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

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the CustomDimension to archive.
 *                              Example format: properties/1234/customDimensions/5678
 *                              Please see {@see AnalyticsAdminServiceClient::customDimensionName()} for help formatting this field.
 */
function archive_custom_dimension_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->archiveCustomDimension($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::customDimensionName(
        '[PROPERTY]',
        '[CUSTOM_DIMENSION]'
    );

    archive_custom_dimension_sample($formattedName);
}

archiveCustomMetric

Archives a CustomMetric on a property.

Parameters
NameDescription
name string

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

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the CustomMetric to archive.
 *                              Example format: properties/1234/customMetrics/5678
 *                              Please see {@see AnalyticsAdminServiceClient::customMetricName()} for help formatting this field.
 */
function archive_custom_metric_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->archiveCustomMetric($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::customMetricName('[PROPERTY]', '[CUSTOM_METRIC]');

    archive_custom_metric_sample($formattedName);
}

batchCreateAccessBindings

Creates information about multiple access bindings to an account or property.

This method is transactional. If any AccessBinding cannot be created, none of the AccessBindings will be created.

Parameters
NameDescription
parent string

Required. The account or property that owns the access bindings. The parent field in the CreateAccessBindingRequest messages must either be empty or match this field. Formats:

  • accounts/{account}
  • properties/{property}
requests array<Google\Analytics\Admin\V1alpha\CreateAccessBindingRequest>

Required. The requests specifying the access bindings to create. A maximum of 1000 access bindings can be created in a batch.

optionalArgs 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\V1alpha\BatchCreateAccessBindingsResponse
Example
use Google\Analytics\Admin\V1alpha\AccessBinding;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\BatchCreateAccessBindingsResponse;
use Google\Analytics\Admin\V1alpha\CreateAccessBindingRequest;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent         The account or property that owns the access bindings. The parent
 *                                        field in the CreateAccessBindingRequest messages must either be empty or
 *                                        match this field. Formats:
 *                                        - accounts/{account}
 *                                        - properties/{property}
 *                                        Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
 * @param string $formattedRequestsParent Formats:
 *                                        - accounts/{account}
 *                                        - properties/{property}
 *                                        Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
 */
function batch_create_access_bindings_sample(
    string $formattedParent,
    string $formattedRequestsParent
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $requestsAccessBinding = new AccessBinding();
    $createAccessBindingRequest = (new CreateAccessBindingRequest())
        ->setParent($formattedRequestsParent)
        ->setAccessBinding($requestsAccessBinding);
    $requests = [$createAccessBindingRequest,];

    // Call the API and handle any network failures.
    try {
        /** @var BatchCreateAccessBindingsResponse $response */
        $response = $analyticsAdminServiceClient->batchCreateAccessBindings($formattedParent, $requests);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');
    $formattedRequestsParent = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');

    batch_create_access_bindings_sample($formattedParent, $formattedRequestsParent);
}

batchDeleteAccessBindings

Deletes information about multiple users' links to an account or property.

Parameters
NameDescription
parent string

Required. The account or property that owns the access bindings. The parent of all provided values for the 'names' field in DeleteAccessBindingRequest messages must match this field. Formats:

  • accounts/{account}
  • properties/{property}
requests array<Google\Analytics\Admin\V1alpha\DeleteAccessBindingRequest>

Required. The requests specifying the access bindings to delete. A maximum of 1000 access bindings can be deleted in a batch.

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DeleteAccessBindingRequest;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent       The account or property that owns the access bindings. The parent
 *                                      of all provided values for the 'names' field in DeleteAccessBindingRequest
 *                                      messages must match this field. Formats:
 *                                      - accounts/{account}
 *                                      - properties/{property}
 *                                      Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
 * @param string $formattedRequestsName Formats:
 *                                      - accounts/{account}/accessBindings/{accessBinding}
 *                                      - properties/{property}/accessBindings/{accessBinding}
 *                                      Please see {@see AnalyticsAdminServiceClient::accessBindingName()} for help formatting this field.
 */
function batch_delete_access_bindings_sample(
    string $formattedParent,
    string $formattedRequestsName
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $deleteAccessBindingRequest = (new DeleteAccessBindingRequest())
        ->setName($formattedRequestsName);
    $requests = [$deleteAccessBindingRequest,];

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->batchDeleteAccessBindings($formattedParent, $requests);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');
    $formattedRequestsName = AnalyticsAdminServiceClient::accessBindingName(
        '[ACCOUNT]',
        '[ACCESS_BINDING]'
    );

    batch_delete_access_bindings_sample($formattedParent, $formattedRequestsName);
}

batchGetAccessBindings

Gets information about multiple access bindings to an account or property.

Parameters
NameDescription
parent string

Required. The account or property that owns the access bindings. The parent of all provided values for the 'names' field must match this field. Formats:

  • accounts/{account}
  • properties/{property}
names string[]

Required. The names of the access bindings to retrieve. A maximum of 1000 access bindings can be retrieved in a batch. Formats:

  • accounts/{account}/accessBindings/{accessBinding}
  • properties/{property}/accessBindings/{accessBinding}
optionalArgs 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\V1alpha\BatchGetAccessBindingsResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\BatchGetAccessBindingsResponse;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent       The account or property that owns the access bindings. The parent
 *                                      of all provided values for the 'names' field must match this field.
 *                                      Formats:
 *                                      - accounts/{account}
 *                                      - properties/{property}
 *                                      Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
 * @param string $formattedNamesElement The names of the access bindings to retrieve.
 *                                      A maximum of 1000 access bindings can be retrieved in a batch.
 *                                      Formats:
 *                                      - accounts/{account}/accessBindings/{accessBinding}
 *                                      - properties/{property}/accessBindings/{accessBinding}
 *                                      Please see {@see AnalyticsAdminServiceClient::accessBindingName()} for help formatting this field.
 */
function batch_get_access_bindings_sample(
    string $formattedParent,
    string $formattedNamesElement
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $formattedNames = [$formattedNamesElement,];

    // Call the API and handle any network failures.
    try {
        /** @var BatchGetAccessBindingsResponse $response */
        $response = $analyticsAdminServiceClient->batchGetAccessBindings($formattedParent, $formattedNames);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');
    $formattedNamesElement = AnalyticsAdminServiceClient::accessBindingName(
        '[ACCOUNT]',
        '[ACCESS_BINDING]'
    );

    batch_get_access_bindings_sample($formattedParent, $formattedNamesElement);
}

batchUpdateAccessBindings

Updates information about multiple access bindings to an account or property.

Parameters
NameDescription
parent string

Required. The account or property that owns the access bindings. The parent of all provided AccessBinding in UpdateAccessBindingRequest messages must match this field. Formats:

  • accounts/{account}
  • properties/{property}
requests array<Google\Analytics\Admin\V1alpha\UpdateAccessBindingRequest>

Required. The requests specifying the access bindings to update. A maximum of 1000 access bindings can be updated in a batch.

optionalArgs 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\V1alpha\BatchUpdateAccessBindingsResponse
Example
use Google\Analytics\Admin\V1alpha\AccessBinding;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\BatchUpdateAccessBindingsResponse;
use Google\Analytics\Admin\V1alpha\UpdateAccessBindingRequest;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent The account or property that owns the access bindings. The parent
 *                                of all provided AccessBinding in UpdateAccessBindingRequest messages must
 *                                match this field.
 *                                Formats:
 *                                - accounts/{account}
 *                                - properties/{property}
 *                                Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
 */
function batch_update_access_bindings_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $requestsAccessBinding = new AccessBinding();
    $updateAccessBindingRequest = (new UpdateAccessBindingRequest())
        ->setAccessBinding($requestsAccessBinding);
    $requests = [$updateAccessBindingRequest,];

    // Call the API and handle any network failures.
    try {
        /** @var BatchUpdateAccessBindingsResponse $response */
        $response = $analyticsAdminServiceClient->batchUpdateAccessBindings($formattedParent, $requests);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');

    batch_update_access_bindings_sample($formattedParent);
}

cancelDisplayVideo360AdvertiserLinkProposal

Cancels a DisplayVideo360AdvertiserLinkProposal.

Cancelling can mean either:

  • Declining a proposal initiated from Display & Video 360
  • Withdrawing a proposal initiated from Google Analytics After being cancelled, a proposal will eventually be deleted automatically.
Parameters
NameDescription
name string

Required. The name of the DisplayVideo360AdvertiserLinkProposal to cancel. Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678

optionalArgs 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\V1alpha\DisplayVideo360AdvertiserLinkProposal
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DisplayVideo360AdvertiserLinkProposal;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the DisplayVideo360AdvertiserLinkProposal to cancel.
 *                              Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678
 *                              Please see {@see AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkProposalName()} for help formatting this field.
 */
function cancel_display_video360_advertiser_link_proposal_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var DisplayVideo360AdvertiserLinkProposal $response */
        $response = $analyticsAdminServiceClient->cancelDisplayVideo360AdvertiserLinkProposal(
            $formattedName
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkProposalName(
        '[PROPERTY]',
        '[DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL]'
    );

    cancel_display_video360_advertiser_link_proposal_sample($formattedName);
}

createAccessBinding

Creates an access binding on an account or property.

Parameters
NameDescription
parent string

Required. Formats:

  • accounts/{account}
  • properties/{property}
accessBinding Google\Analytics\Admin\V1alpha\AccessBinding

Required. The access binding to create.

optionalArgs 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\V1alpha\AccessBinding
Example
use Google\Analytics\Admin\V1alpha\AccessBinding;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent Formats:
 *                                - accounts/{account}
 *                                - properties/{property}
 *                                Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
 */
function create_access_binding_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $accessBinding = new AccessBinding();

    // Call the API and handle any network failures.
    try {
        /** @var AccessBinding $response */
        $response = $analyticsAdminServiceClient->createAccessBinding($formattedParent, $accessBinding);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');

    create_access_binding_sample($formattedParent);
}

Creates an AdSenseLink.

Parameters
NameDescription
parent string

Required. The property for which to create an AdSense Link. Format: properties/{propertyId} Example: properties/1234

adsenseLink Google\Analytics\Admin\V1alpha\AdSenseLink

Required. The AdSense Link to create

optionalArgs 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\V1alpha\AdSenseLink
Example
use Google\Analytics\Admin\V1alpha\AdSenseLink;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent The property for which to create an AdSense Link.
 *                                Format: properties/{propertyId}
 *                                Example: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function create_ad_sense_link_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $adsenseLink = new AdSenseLink();

    // Call the API and handle any network failures.
    try {
        /** @var AdSenseLink $response */
        $response = $analyticsAdminServiceClient->createAdSenseLink($formattedParent, $adsenseLink);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    create_ad_sense_link_sample($formattedParent);
}

createAudience

Creates an Audience.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

audience Google\Analytics\Admin\V1alpha\Audience

Required. The audience to create.

optionalArgs 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\V1alpha\Audience
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\Audience;
use Google\Analytics\Admin\V1alpha\AudienceFilterClause;
use Google\Analytics\Admin\V1alpha\AudienceFilterClause\AudienceClauseType;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent                 Example format: properties/1234
 *                                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 * @param string $audienceDisplayName             The display name of the Audience.
 * @param string $audienceDescription             The description of the Audience.
 * @param int    $audienceMembershipDurationDays  Immutable. The duration a user should stay in an Audience. It
 *                                                cannot be set to more than 540 days.
 * @param int    $audienceFilterClausesClauseType Specifies whether this is an include or exclude filter clause.
 */
function create_audience_sample(
    string $formattedParent,
    string $audienceDisplayName,
    string $audienceDescription,
    int $audienceMembershipDurationDays,
    int $audienceFilterClausesClauseType
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $audienceFilterClause = (new AudienceFilterClause())
        ->setClauseType($audienceFilterClausesClauseType);
    $audienceFilterClauses = [$audienceFilterClause,];
    $audience = (new Audience())
        ->setDisplayName($audienceDisplayName)
        ->setDescription($audienceDescription)
        ->setMembershipDurationDays($audienceMembershipDurationDays)
        ->setFilterClauses($audienceFilterClauses);

    // Call the API and handle any network failures.
    try {
        /** @var Audience $response */
        $response = $analyticsAdminServiceClient->createAudience($formattedParent, $audience);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
    $audienceDisplayName = '[DISPLAY_NAME]';
    $audienceDescription = '[DESCRIPTION]';
    $audienceMembershipDurationDays = 0;
    $audienceFilterClausesClauseType = AudienceClauseType::AUDIENCE_CLAUSE_TYPE_UNSPECIFIED;

    create_audience_sample(
        $formattedParent,
        $audienceDisplayName,
        $audienceDescription,
        $audienceMembershipDurationDays,
        $audienceFilterClausesClauseType
    );
}

createChannelGroup

Creates a ChannelGroup.

Parameters
NameDescription
parent string

Required. The property for which to create a ChannelGroup. Example format: properties/1234

channelGroup Google\Analytics\Admin\V1alpha\ChannelGroup

Required. The ChannelGroup to create.

optionalArgs 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\V1alpha\ChannelGroup
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ChannelGroup;
use Google\Analytics\Admin\V1alpha\ChannelGroupFilterExpression;
use Google\Analytics\Admin\V1alpha\GroupingRule;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent                     The property for which to create a ChannelGroup.
 *                                                    Example format: properties/1234
 *                                                    Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 * @param string $channelGroupDisplayName             The display name of the Channel Group. Max length of 80
 *                                                    characters.
 * @param string $channelGroupGroupingRuleDisplayName Customer defined display name for the channel.
 */
function create_channel_group_sample(
    string $formattedParent,
    string $channelGroupDisplayName,
    string $channelGroupGroupingRuleDisplayName
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $channelGroupGroupingRuleExpression = new ChannelGroupFilterExpression();
    $groupingRule = (new GroupingRule())
        ->setDisplayName($channelGroupGroupingRuleDisplayName)
        ->setExpression($channelGroupGroupingRuleExpression);
    $channelGroupGroupingRule = [$groupingRule,];
    $channelGroup = (new ChannelGroup())
        ->setDisplayName($channelGroupDisplayName)
        ->setGroupingRule($channelGroupGroupingRule);

    // Call the API and handle any network failures.
    try {
        /** @var ChannelGroup $response */
        $response = $analyticsAdminServiceClient->createChannelGroup($formattedParent, $channelGroup);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
    $channelGroupDisplayName = '[DISPLAY_NAME]';
    $channelGroupGroupingRuleDisplayName = '[DISPLAY_NAME]';

    create_channel_group_sample(
        $formattedParent,
        $channelGroupDisplayName,
        $channelGroupGroupingRuleDisplayName
    );
}

createConnectedSiteTag

Creates a connected site tag for a Universal Analytics property. You can create a maximum of 20 connected site tags per property.

Note: This API cannot be used on GA4 properties.

Parameters
NameDescription
connectedSiteTag Google\Analytics\Admin\V1alpha\ConnectedSiteTag

Required. The tag to add to the Universal Analytics property

optionalArgs array

Optional.

↳ property string

The Universal Analytics property to create connected site tags for. This API does not support GA4 properties. Format: properties/{universalAnalyticsPropertyId} Example: properties/1234

↳ 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\V1alpha\CreateConnectedSiteTagResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ConnectedSiteTag;
use Google\Analytics\Admin\V1alpha\CreateConnectedSiteTagResponse;
use Google\ApiCore\ApiException;

/**
 * @param string $connectedSiteTagDisplayName User-provided display name for the connected site tag. Must be
 *                                            less than 256 characters.
 * @param string $connectedSiteTagTagId       "Tag ID to forward events to. Also known as the Measurement ID,
 *                                            or the "G-ID"  (For example: G-12345).
 */
function create_connected_site_tag_sample(
    string $connectedSiteTagDisplayName,
    string $connectedSiteTagTagId
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $connectedSiteTag = (new ConnectedSiteTag())
        ->setDisplayName($connectedSiteTagDisplayName)
        ->setTagId($connectedSiteTagTagId);

    // Call the API and handle any network failures.
    try {
        /** @var CreateConnectedSiteTagResponse $response */
        $response = $analyticsAdminServiceClient->createConnectedSiteTag($connectedSiteTag);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $connectedSiteTagDisplayName = '[DISPLAY_NAME]';
    $connectedSiteTagTagId = '[TAG_ID]';

    create_connected_site_tag_sample($connectedSiteTagDisplayName, $connectedSiteTagTagId);
}

createConversionEvent

Creates a conversion event with the specified attributes.

Parameters
NameDescription
conversionEvent Google\Analytics\Admin\V1alpha\ConversionEvent

Required. The conversion event to create.

parent string

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

optionalArgs 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\V1alpha\ConversionEvent
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ConversionEvent;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent The resource name of the parent property where this conversion
 *                                event will be created. Format: properties/123
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function create_conversion_event_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $conversionEvent = new ConversionEvent();

    // Call the API and handle any network failures.
    try {
        /** @var ConversionEvent $response */
        $response = $analyticsAdminServiceClient->createConversionEvent($conversionEvent, $formattedParent);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    create_conversion_event_sample($formattedParent);
}

createCustomDimension

Creates a CustomDimension.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

customDimension Google\Analytics\Admin\V1alpha\CustomDimension

Required. The CustomDimension to create.

optionalArgs 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\V1alpha\CustomDimension
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\CustomDimension;
use Google\Analytics\Admin\V1alpha\CustomDimension\DimensionScope;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent              Example format: properties/1234
 *                                             Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 * @param string $customDimensionParameterName Immutable. Tagging parameter name for this custom dimension.
 *
 *                                             If this is a user-scoped dimension, then this is the user property name.
 *                                             If this is an event-scoped dimension, then this is the event parameter
 *                                             name.
 *
 *                                             If this is an item-scoped dimension, then this is the parameter
 *                                             name found in the eCommerce items array.
 *
 *                                             May only contain alphanumeric and underscore characters, starting with a
 *                                             letter. Max length of 24 characters for user-scoped dimensions, 40
 *                                             characters for event-scoped dimensions.
 * @param string $customDimensionDisplayName   Display name for this custom dimension as shown in the Analytics
 *                                             UI. Max length of 82 characters, alphanumeric plus space and underscore
 *                                             starting with a letter. Legacy system-generated display names may contain
 *                                             square brackets, but updates to this field will never permit square
 *                                             brackets.
 * @param int    $customDimensionScope         Immutable. The scope of this dimension.
 */
function create_custom_dimension_sample(
    string $formattedParent,
    string $customDimensionParameterName,
    string $customDimensionDisplayName,
    int $customDimensionScope
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $customDimension = (new CustomDimension())
        ->setParameterName($customDimensionParameterName)
        ->setDisplayName($customDimensionDisplayName)
        ->setScope($customDimensionScope);

    // Call the API and handle any network failures.
    try {
        /** @var CustomDimension $response */
        $response = $analyticsAdminServiceClient->createCustomDimension($formattedParent, $customDimension);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
    $customDimensionParameterName = '[PARAMETER_NAME]';
    $customDimensionDisplayName = '[DISPLAY_NAME]';
    $customDimensionScope = DimensionScope::DIMENSION_SCOPE_UNSPECIFIED;

    create_custom_dimension_sample(
        $formattedParent,
        $customDimensionParameterName,
        $customDimensionDisplayName,
        $customDimensionScope
    );
}

createCustomMetric

Creates a CustomMetric.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

customMetric Google\Analytics\Admin\V1alpha\CustomMetric

Required. The CustomMetric to create.

optionalArgs 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\V1alpha\CustomMetric
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\CustomMetric;
use Google\Analytics\Admin\V1alpha\CustomMetric\MeasurementUnit;
use Google\Analytics\Admin\V1alpha\CustomMetric\MetricScope;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent             Example format: properties/1234
 *                                            Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 * @param string $customMetricParameterName   Immutable. Tagging name for this custom metric.
 *
 *                                            If this is an event-scoped metric, then this is the event parameter
 *                                            name.
 *
 *                                            May only contain alphanumeric and underscore charactes, starting with a
 *                                            letter. Max length of 40 characters for event-scoped metrics.
 * @param string $customMetricDisplayName     Display name for this custom metric as shown in the Analytics UI.
 *                                            Max length of 82 characters, alphanumeric plus space and underscore
 *                                            starting with a letter. Legacy system-generated display names may contain
 *                                            square brackets, but updates to this field will never permit square
 *                                            brackets.
 * @param int    $customMetricMeasurementUnit The type for the custom metric's value.
 * @param int    $customMetricScope           Immutable. The scope of this custom metric.
 */
function create_custom_metric_sample(
    string $formattedParent,
    string $customMetricParameterName,
    string $customMetricDisplayName,
    int $customMetricMeasurementUnit,
    int $customMetricScope
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $customMetric = (new CustomMetric())
        ->setParameterName($customMetricParameterName)
        ->setDisplayName($customMetricDisplayName)
        ->setMeasurementUnit($customMetricMeasurementUnit)
        ->setScope($customMetricScope);

    // Call the API and handle any network failures.
    try {
        /** @var CustomMetric $response */
        $response = $analyticsAdminServiceClient->createCustomMetric($formattedParent, $customMetric);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
    $customMetricParameterName = '[PARAMETER_NAME]';
    $customMetricDisplayName = '[DISPLAY_NAME]';
    $customMetricMeasurementUnit = MeasurementUnit::MEASUREMENT_UNIT_UNSPECIFIED;
    $customMetricScope = MetricScope::METRIC_SCOPE_UNSPECIFIED;

    create_custom_metric_sample(
        $formattedParent,
        $customMetricParameterName,
        $customMetricDisplayName,
        $customMetricMeasurementUnit,
        $customMetricScope
    );
}

createDataStream

Creates a DataStream.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

dataStream Google\Analytics\Admin\V1alpha\DataStream

Required. The DataStream to create.

optionalArgs 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\V1alpha\DataStream
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DataStream;
use Google\Analytics\Admin\V1alpha\DataStream\DataStreamType;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 * @param int    $dataStreamType  Immutable. The type of this DataStream resource.
 */
function create_data_stream_sample(string $formattedParent, int $dataStreamType): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $dataStream = (new DataStream())
        ->setType($dataStreamType);

    // Call the API and handle any network failures.
    try {
        /** @var DataStream $response */
        $response = $analyticsAdminServiceClient->createDataStream($formattedParent, $dataStream);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
    $dataStreamType = DataStreamType::DATA_STREAM_TYPE_UNSPECIFIED;

    create_data_stream_sample($formattedParent, $dataStreamType);
}

Creates a DisplayVideo360AdvertiserLink.

This can only be utilized by users who have proper authorization both on the Google Analytics property and on the Display & Video 360 advertiser. Users who do not have access to the Display & Video 360 advertiser should instead seek to create a DisplayVideo360LinkProposal.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

displayVideo360AdvertiserLink Google\Analytics\Admin\V1alpha\DisplayVideo360AdvertiserLink

Required. The DisplayVideo360AdvertiserLink to create.

optionalArgs 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\V1alpha\DisplayVideo360AdvertiserLink
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DisplayVideo360AdvertiserLink;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function create_display_video360_advertiser_link_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $displayVideo360AdvertiserLink = new DisplayVideo360AdvertiserLink();

    // Call the API and handle any network failures.
    try {
        /** @var DisplayVideo360AdvertiserLink $response */
        $response = $analyticsAdminServiceClient->createDisplayVideo360AdvertiserLink(
            $formattedParent,
            $displayVideo360AdvertiserLink
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    create_display_video360_advertiser_link_sample($formattedParent);
}

createDisplayVideo360AdvertiserLinkProposal

Creates a DisplayVideo360AdvertiserLinkProposal.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

displayVideo360AdvertiserLinkProposal Google\Analytics\Admin\V1alpha\DisplayVideo360AdvertiserLinkProposal

Required. The DisplayVideo360AdvertiserLinkProposal to create.

optionalArgs 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\V1alpha\DisplayVideo360AdvertiserLinkProposal
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DisplayVideo360AdvertiserLinkProposal;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function create_display_video360_advertiser_link_proposal_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $displayVideo360AdvertiserLinkProposal = new DisplayVideo360AdvertiserLinkProposal();

    // Call the API and handle any network failures.
    try {
        /** @var DisplayVideo360AdvertiserLinkProposal $response */
        $response = $analyticsAdminServiceClient->createDisplayVideo360AdvertiserLinkProposal(
            $formattedParent,
            $displayVideo360AdvertiserLinkProposal
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    create_display_video360_advertiser_link_proposal_sample($formattedParent);
}

createEventCreateRule

Creates an EventCreateRule.

Parameters
NameDescription
parent string

Required. Example format: properties/123/dataStreams/456

eventCreateRule Google\Analytics\Admin\V1alpha\EventCreateRule

Required. The EventCreateRule to create.

optionalArgs 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\V1alpha\EventCreateRule
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\EventCreateRule;
use Google\Analytics\Admin\V1alpha\MatchingCondition;
use Google\Analytics\Admin\V1alpha\MatchingCondition\ComparisonType;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent                              Example format: properties/123/dataStreams/456
 *                                                             Please see {@see AnalyticsAdminServiceClient::dataStreamName()} for help formatting this field.
 * @param string $eventCreateRuleDestinationEvent              The name of the new event to be created.
 *
 *                                                             This value must:
 *                                                             * be less than 40 characters
 *                                                             * consist only of letters, digits or _ (underscores)
 *                                                             * start with a letter
 * @param string $eventCreateRuleEventConditionsField          The name of the field that is compared against for the condition.
 *                                                             If 'event_name' is specified this condition will apply to the name of the
 *                                                             event.  Otherwise the condition will apply to a parameter with the
 *                                                             specified name.
 *
 *                                                             This value cannot contain spaces.
 * @param int    $eventCreateRuleEventConditionsComparisonType The type of comparison to be applied to the value.
 * @param string $eventCreateRuleEventConditionsValue          The value being compared against for this condition.  The runtime
 *                                                             implementation may perform type coercion of this value to evaluate this
 *                                                             condition based on the type of the parameter value.
 */
function create_event_create_rule_sample(
    string $formattedParent,
    string $eventCreateRuleDestinationEvent,
    string $eventCreateRuleEventConditionsField,
    int $eventCreateRuleEventConditionsComparisonType,
    string $eventCreateRuleEventConditionsValue
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $matchingCondition = (new MatchingCondition())
        ->setField($eventCreateRuleEventConditionsField)
        ->setComparisonType($eventCreateRuleEventConditionsComparisonType)
        ->setValue($eventCreateRuleEventConditionsValue);
    $eventCreateRuleEventConditions = [$matchingCondition,];
    $eventCreateRule = (new EventCreateRule())
        ->setDestinationEvent($eventCreateRuleDestinationEvent)
        ->setEventConditions($eventCreateRuleEventConditions);

    // Call the API and handle any network failures.
    try {
        /** @var EventCreateRule $response */
        $response = $analyticsAdminServiceClient->createEventCreateRule($formattedParent, $eventCreateRule);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::dataStreamName('[PROPERTY]', '[DATA_STREAM]');
    $eventCreateRuleDestinationEvent = '[DESTINATION_EVENT]';
    $eventCreateRuleEventConditionsField = '[FIELD]';
    $eventCreateRuleEventConditionsComparisonType = ComparisonType::COMPARISON_TYPE_UNSPECIFIED;
    $eventCreateRuleEventConditionsValue = '[VALUE]';

    create_event_create_rule_sample(
        $formattedParent,
        $eventCreateRuleDestinationEvent,
        $eventCreateRuleEventConditionsField,
        $eventCreateRuleEventConditionsComparisonType,
        $eventCreateRuleEventConditionsValue
    );
}

createExpandedDataSet

Creates a ExpandedDataSet.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

expandedDataSet Google\Analytics\Admin\V1alpha\ExpandedDataSet

Required. The ExpandedDataSet to create.

optionalArgs 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\V1alpha\ExpandedDataSet
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ExpandedDataSet;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent            Example format: properties/1234
 *                                           Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 * @param string $expandedDataSetDisplayName The display name of the ExpandedDataSet.
 *                                           Max 200 chars.
 */
function create_expanded_data_set_sample(
    string $formattedParent,
    string $expandedDataSetDisplayName
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $expandedDataSet = (new ExpandedDataSet())
        ->setDisplayName($expandedDataSetDisplayName);

    // Call the API and handle any network failures.
    try {
        /** @var ExpandedDataSet $response */
        $response = $analyticsAdminServiceClient->createExpandedDataSet($formattedParent, $expandedDataSet);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
    $expandedDataSetDisplayName = '[DISPLAY_NAME]';

    create_expanded_data_set_sample($formattedParent, $expandedDataSetDisplayName);
}

Creates a FirebaseLink.

Properties can have at most one FirebaseLink.

Parameters
NameDescription
parent string

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

firebaseLink Google\Analytics\Admin\V1alpha\FirebaseLink

Required. The Firebase link to create.

optionalArgs 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\V1alpha\FirebaseLink
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\FirebaseLink;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent Format: properties/{property_id}
 *                                Example: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function create_firebase_link_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $firebaseLink = new FirebaseLink();

    // Call the API and handle any network failures.
    try {
        /** @var FirebaseLink $response */
        $response = $analyticsAdminServiceClient->createFirebaseLink($formattedParent, $firebaseLink);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    create_firebase_link_sample($formattedParent);
}

Creates a GoogleAdsLink.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

googleAdsLink Google\Analytics\Admin\V1alpha\GoogleAdsLink

Required. The GoogleAdsLink to create.

optionalArgs 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\V1alpha\GoogleAdsLink
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\GoogleAdsLink;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function create_google_ads_link_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $googleAdsLink = new GoogleAdsLink();

    // Call the API and handle any network failures.
    try {
        /** @var GoogleAdsLink $response */
        $response = $analyticsAdminServiceClient->createGoogleAdsLink($formattedParent, $googleAdsLink);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    create_google_ads_link_sample($formattedParent);
}

createMeasurementProtocolSecret

Creates a measurement protocol secret.

Parameters
NameDescription
parent string

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

measurementProtocolSecret Google\Analytics\Admin\V1alpha\MeasurementProtocolSecret

Required. The measurement protocol secret to create.

optionalArgs 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\V1alpha\MeasurementProtocolSecret
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\MeasurementProtocolSecret;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent                      The parent resource where this secret will be created.
 *                                                     Format: properties/{property}/dataStreams/{dataStream}
 *                                                     Please see {@see AnalyticsAdminServiceClient::dataStreamName()} for help formatting this field.
 * @param string $measurementProtocolSecretDisplayName Human-readable display name for this secret.
 */
function create_measurement_protocol_secret_sample(
    string $formattedParent,
    string $measurementProtocolSecretDisplayName
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $measurementProtocolSecret = (new MeasurementProtocolSecret())
        ->setDisplayName($measurementProtocolSecretDisplayName);

    // Call the API and handle any network failures.
    try {
        /** @var MeasurementProtocolSecret $response */
        $response = $analyticsAdminServiceClient->createMeasurementProtocolSecret(
            $formattedParent,
            $measurementProtocolSecret
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::dataStreamName('[PROPERTY]', '[DATA_STREAM]');
    $measurementProtocolSecretDisplayName = '[DISPLAY_NAME]';

    create_measurement_protocol_secret_sample($formattedParent, $measurementProtocolSecretDisplayName);
}

createProperty

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

Parameters
NameDescription
property Google\Analytics\Admin\V1alpha\Property

Required. The property to create. Note: the supplied property must specify its parent.

optionalArgs 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\V1alpha\Property
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\Property;
use Google\ApiCore\ApiException;

/**
 * @param string $propertyDisplayName Human-readable display name for this property.
 *
 *                                    The max allowed display name length is 100 UTF-16 code units.
 * @param string $propertyTimeZone    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"
 */
function create_property_sample(string $propertyDisplayName, string $propertyTimeZone): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $property = (new Property())
        ->setDisplayName($propertyDisplayName)
        ->setTimeZone($propertyTimeZone);

    // Call the API and handle any network failures.
    try {
        /** @var Property $response */
        $response = $analyticsAdminServiceClient->createProperty($property);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $propertyDisplayName = '[DISPLAY_NAME]';
    $propertyTimeZone = '[TIME_ZONE]';

    create_property_sample($propertyDisplayName, $propertyTimeZone);
}

createRollupProperty

Create a roll-up property and all roll-up property source links.

Parameters
NameDescription
rollupProperty Google\Analytics\Admin\V1alpha\Property

Required. The roll-up property to create.

optionalArgs array

Optional.

↳ sourceProperties string[]

Optional. The resource names of properties that will be sources to the created roll-up property.

↳ 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\V1alpha\CreateRollupPropertyResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\CreateRollupPropertyResponse;
use Google\Analytics\Admin\V1alpha\Property;
use Google\ApiCore\ApiException;

/**
 * @param string $rollupPropertyDisplayName Human-readable display name for this property.
 *
 *                                          The max allowed display name length is 100 UTF-16 code units.
 * @param string $rollupPropertyTimeZone    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"
 */
function create_rollup_property_sample(
    string $rollupPropertyDisplayName,
    string $rollupPropertyTimeZone
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $rollupProperty = (new Property())
        ->setDisplayName($rollupPropertyDisplayName)
        ->setTimeZone($rollupPropertyTimeZone);

    // Call the API and handle any network failures.
    try {
        /** @var CreateRollupPropertyResponse $response */
        $response = $analyticsAdminServiceClient->createRollupProperty($rollupProperty);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $rollupPropertyDisplayName = '[DISPLAY_NAME]';
    $rollupPropertyTimeZone = '[TIME_ZONE]';

    create_rollup_property_sample($rollupPropertyDisplayName, $rollupPropertyTimeZone);
}

Creates a roll-up property source link.

Only roll-up properties can have source links, so this method will throw an error if used on other types of properties.

Parameters
NameDescription
parent string

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

rollupPropertySourceLink Google\Analytics\Admin\V1alpha\RollupPropertySourceLink

Required. The roll-up property source link to create.

optionalArgs 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\V1alpha\RollupPropertySourceLink
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\RollupPropertySourceLink;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent Format: properties/{property_id}
 *                                Example: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function create_rollup_property_source_link_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $rollupPropertySourceLink = new RollupPropertySourceLink();

    // Call the API and handle any network failures.
    try {
        /** @var RollupPropertySourceLink $response */
        $response = $analyticsAdminServiceClient->createRollupPropertySourceLink(
            $formattedParent,
            $rollupPropertySourceLink
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    create_rollup_property_source_link_sample($formattedParent);
}

createSKAdNetworkConversionValueSchema

Creates a SKAdNetworkConversionValueSchema.

Parameters
NameDescription
parent string

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

skadnetworkConversionValueSchema Google\Analytics\Admin\V1alpha\SKAdNetworkConversionValueSchema

Required. SKAdNetwork conversion value schema to create.

optionalArgs 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\V1alpha\SKAdNetworkConversionValueSchema
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\PostbackWindow;
use Google\Analytics\Admin\V1alpha\SKAdNetworkConversionValueSchema;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent The parent resource where this schema will be created.
 *                                Format: properties/{property}/dataStreams/{dataStream}
 *                                Please see {@see AnalyticsAdminServiceClient::dataStreamName()} for help formatting this field.
 */
function create_sk_ad_network_conversion_value_schema_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $skadnetworkConversionValueSchemaPostbackWindowOne = new PostbackWindow();
    $skadnetworkConversionValueSchema = (new SKAdNetworkConversionValueSchema())
        ->setPostbackWindowOne($skadnetworkConversionValueSchemaPostbackWindowOne);

    // Call the API and handle any network failures.
    try {
        /** @var SKAdNetworkConversionValueSchema $response */
        $response = $analyticsAdminServiceClient->createSKAdNetworkConversionValueSchema(
            $formattedParent,
            $skadnetworkConversionValueSchema
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::dataStreamName('[PROPERTY]', '[DATA_STREAM]');

    create_sk_ad_network_conversion_value_schema_sample($formattedParent);
}

Creates a SearchAds360Link.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

searchAds360Link Google\Analytics\Admin\V1alpha\SearchAds360Link

Required. The SearchAds360Link to create.

optionalArgs 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\V1alpha\SearchAds360Link
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SearchAds360Link;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function create_search_ads360_link_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $searchAds360Link = new SearchAds360Link();

    // Call the API and handle any network failures.
    try {
        /** @var SearchAds360Link $response */
        $response = $analyticsAdminServiceClient->createSearchAds360Link(
            $formattedParent,
            $searchAds360Link
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    create_search_ads360_link_sample($formattedParent);
}

createSubproperty

Create a subproperty and a subproperty event filter that applies to the created subproperty.

Parameters
NameDescription
parent string

Required. The ordinary property for which to create a subproperty. Format: properties/property_id Example: properties/123

subproperty Google\Analytics\Admin\V1alpha\Property

Required. The subproperty to create.

optionalArgs array

Optional.

↳ subpropertyEventFilter SubpropertyEventFilter

Optional. The subproperty event filter to create on an ordinary property.

↳ 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\V1alpha\CreateSubpropertyResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\CreateSubpropertyResponse;
use Google\Analytics\Admin\V1alpha\Property;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent        The ordinary property for which to create a subproperty.
 *                                       Format: properties/property_id
 *                                       Example: properties/123
 *                                       Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 * @param string $subpropertyDisplayName Human-readable display name for this property.
 *
 *                                       The max allowed display name length is 100 UTF-16 code units.
 * @param string $subpropertyTimeZone    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"
 */
function create_subproperty_sample(
    string $formattedParent,
    string $subpropertyDisplayName,
    string $subpropertyTimeZone
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $subproperty = (new Property())
        ->setDisplayName($subpropertyDisplayName)
        ->setTimeZone($subpropertyTimeZone);

    // Call the API and handle any network failures.
    try {
        /** @var CreateSubpropertyResponse $response */
        $response = $analyticsAdminServiceClient->createSubproperty($formattedParent, $subproperty);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
    $subpropertyDisplayName = '[DISPLAY_NAME]';
    $subpropertyTimeZone = '[TIME_ZONE]';

    create_subproperty_sample($formattedParent, $subpropertyDisplayName, $subpropertyTimeZone);
}

createSubpropertyEventFilter

Creates a subproperty Event Filter.

Parameters
NameDescription
parent string

Required. The ordinary property for which to create a subproperty event filter. Format: properties/property_id Example: properties/123

subpropertyEventFilter Google\Analytics\Admin\V1alpha\SubpropertyEventFilter

Required. The subproperty event filter to create.

optionalArgs 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\V1alpha\SubpropertyEventFilter
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SubpropertyEventFilter;
use Google\Analytics\Admin\V1alpha\SubpropertyEventFilterClause;
use Google\Analytics\Admin\V1alpha\SubpropertyEventFilterClause\FilterClauseType;
use Google\Analytics\Admin\V1alpha\SubpropertyEventFilterExpression;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent                                     The ordinary property for which to create a subproperty event
 *                                                                    filter. Format: properties/property_id Example: properties/123
 *                                                                    Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 * @param int    $subpropertyEventFilterFilterClausesFilterClauseType The type for the filter clause.
 */
function create_subproperty_event_filter_sample(
    string $formattedParent,
    int $subpropertyEventFilterFilterClausesFilterClauseType
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $subpropertyEventFilterFilterClausesFilterExpression = new SubpropertyEventFilterExpression();
    $subpropertyEventFilterClause = (new SubpropertyEventFilterClause())
        ->setFilterClauseType($subpropertyEventFilterFilterClausesFilterClauseType)
        ->setFilterExpression($subpropertyEventFilterFilterClausesFilterExpression);
    $subpropertyEventFilterFilterClauses = [$subpropertyEventFilterClause,];
    $subpropertyEventFilter = (new SubpropertyEventFilter())
        ->setFilterClauses($subpropertyEventFilterFilterClauses);

    // Call the API and handle any network failures.
    try {
        /** @var SubpropertyEventFilter $response */
        $response = $analyticsAdminServiceClient->createSubpropertyEventFilter(
            $formattedParent,
            $subpropertyEventFilter
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');
    $subpropertyEventFilterFilterClausesFilterClauseType = FilterClauseType::FILTER_CLAUSE_TYPE_UNSPECIFIED;

    create_subproperty_event_filter_sample(
        $formattedParent,
        $subpropertyEventFilterFilterClausesFilterClauseType
    );
}

deleteAccessBinding

Deletes an access binding on an account or property.

Parameters
NameDescription
name string

Required. Formats:

  • accounts/{account}/accessBindings/{accessBinding}
  • properties/{property}/accessBindings/{accessBinding}
optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Formats:
 *                              - accounts/{account}/accessBindings/{accessBinding}
 *                              - properties/{property}/accessBindings/{accessBinding}
 *                              Please see {@see AnalyticsAdminServiceClient::accessBindingName()} for help formatting this field.
 */
function delete_access_binding_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteAccessBinding($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::accessBindingName('[ACCOUNT]', '[ACCESS_BINDING]');

    delete_access_binding_sample($formattedName);
}

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

Returns an error if the target is not found.

Parameters
NameDescription
name string

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

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the Account to soft-delete.
 *                              Format: accounts/{account}
 *                              Example: "accounts/100"
 *                              Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
 */
function delete_account_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteAccount($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');

    delete_account_sample($formattedName);
}

Deletes an AdSenseLink.

Parameters
NameDescription
name string

Required. Unique identifier for the AdSense Link to be deleted. Format: properties/{propertyId}/adSenseLinks/{linkId} Example: properties/1234/adSenseLinks/5678

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Unique identifier for the AdSense Link to be deleted.
 *                              Format: properties/{propertyId}/adSenseLinks/{linkId}
 *                              Example: properties/1234/adSenseLinks/5678
 *                              Please see {@see AnalyticsAdminServiceClient::adSenseLinkName()} for help formatting this field.
 */
function delete_ad_sense_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteAdSenseLink($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::adSenseLinkName('[PROPERTY]', '[ADSENSE_LINK]');

    delete_ad_sense_link_sample($formattedName);
}

deleteChannelGroup

Deletes a ChannelGroup on a property.

Parameters
NameDescription
name string

Required. The ChannelGroup to delete. Example format: properties/1234/channelGroups/5678

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The ChannelGroup to delete.
 *                              Example format: properties/1234/channelGroups/5678
 *                              Please see {@see AnalyticsAdminServiceClient::channelGroupName()} for help formatting this field.
 */
function delete_channel_group_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteChannelGroup($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::channelGroupName('[PROPERTY]', '[CHANNEL_GROUP]');

    delete_channel_group_sample($formattedName);
}

deleteConnectedSiteTag

Deletes a connected site tag for a Universal Analytics property.

Note: this has no effect on GA4 properties.

Parameters
NameDescription
optionalArgs array

Optional.

↳ property string

The Universal Analytics property to delete connected site tags for. This API does not support GA4 properties. Format: properties/{universalAnalyticsPropertyId} Example: properties/1234

↳ tagId string

Tag ID to forward events to. Also known as the Measurement ID, or the "G-ID" (For example: G-12345).

↳ 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function delete_connected_site_tag_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteConnectedSiteTag();
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

deleteConversionEvent

Deletes a conversion event in a property.

Parameters
NameDescription
name string

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

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The resource name of the conversion event to delete.
 *                              Format: properties/{property}/conversionEvents/{conversion_event}
 *                              Example: "properties/123/conversionEvents/456"
 *                              Please see {@see AnalyticsAdminServiceClient::conversionEventName()} for help formatting this field.
 */
function delete_conversion_event_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteConversionEvent($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::conversionEventName(
        '[PROPERTY]',
        '[CONVERSION_EVENT]'
    );

    delete_conversion_event_sample($formattedName);
}

deleteDataStream

Deletes a DataStream on a property.

Parameters
NameDescription
name string

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

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the DataStream to delete.
 *                              Example format: properties/1234/dataStreams/5678
 *                              Please see {@see AnalyticsAdminServiceClient::dataStreamName()} for help formatting this field.
 */
function delete_data_stream_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteDataStream($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::dataStreamName('[PROPERTY]', '[DATA_STREAM]');

    delete_data_stream_sample($formattedName);
}

Deletes a DisplayVideo360AdvertiserLink on a property.

Parameters
NameDescription
name string

Required. The name of the DisplayVideo360AdvertiserLink to delete. Example format: properties/1234/displayVideo360AdvertiserLinks/5678

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the DisplayVideo360AdvertiserLink to delete.
 *                              Example format: properties/1234/displayVideo360AdvertiserLinks/5678
 *                              Please see {@see AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkName()} for help formatting this field.
 */
function delete_display_video360_advertiser_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteDisplayVideo360AdvertiserLink($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkName(
        '[PROPERTY]',
        '[DISPLAY_VIDEO_360_ADVERTISER_LINK]'
    );

    delete_display_video360_advertiser_link_sample($formattedName);
}

deleteDisplayVideo360AdvertiserLinkProposal

Deletes a DisplayVideo360AdvertiserLinkProposal on a property.

This can only be used on cancelled proposals.

Parameters
NameDescription
name string

Required. The name of the DisplayVideo360AdvertiserLinkProposal to delete. Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the DisplayVideo360AdvertiserLinkProposal to delete.
 *                              Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678
 *                              Please see {@see AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkProposalName()} for help formatting this field.
 */
function delete_display_video360_advertiser_link_proposal_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteDisplayVideo360AdvertiserLinkProposal($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkProposalName(
        '[PROPERTY]',
        '[DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL]'
    );

    delete_display_video360_advertiser_link_proposal_sample($formattedName);
}

deleteEventCreateRule

Deletes an EventCreateRule.

Parameters
NameDescription
name string

Required. Example format: properties/123/dataStreams/456/eventCreateRules/789

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Example format:
 *                              properties/123/dataStreams/456/eventCreateRules/789
 *                              Please see {@see AnalyticsAdminServiceClient::eventCreateRuleName()} for help formatting this field.
 */
function delete_event_create_rule_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteEventCreateRule($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::eventCreateRuleName(
        '[PROPERTY]',
        '[DATA_STREAM]',
        '[EVENT_CREATE_RULE]'
    );

    delete_event_create_rule_sample($formattedName);
}

deleteExpandedDataSet

Deletes a ExpandedDataSet on a property.

Parameters
NameDescription
name string

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

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Example format: properties/1234/expandedDataSets/5678
 *                              Please see {@see AnalyticsAdminServiceClient::expandedDataSetName()} for help formatting this field.
 */
function delete_expanded_data_set_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteExpandedDataSet($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::expandedDataSetName(
        '[PROPERTY]',
        '[EXPANDED_DATA_SET]'
    );

    delete_expanded_data_set_sample($formattedName);
}

Deletes a FirebaseLink on a property

Parameters
NameDescription
name string

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

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Format: properties/{property_id}/firebaseLinks/{firebase_link_id}
 *                              Example: properties/1234/firebaseLinks/5678
 *                              Please see {@see AnalyticsAdminServiceClient::firebaseLinkName()} for help formatting this field.
 */
function delete_firebase_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteFirebaseLink($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::firebaseLinkName('[PROPERTY]', '[FIREBASE_LINK]');

    delete_firebase_link_sample($formattedName);
}

Deletes a GoogleAdsLink on a property

Parameters
NameDescription
name string

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

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Example format: properties/1234/googleAdsLinks/5678
 *                              Please see {@see AnalyticsAdminServiceClient::googleAdsLinkName()} for help formatting this field.
 */
function delete_google_ads_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteGoogleAdsLink($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::googleAdsLinkName('[PROPERTY]', '[GOOGLE_ADS_LINK]');

    delete_google_ads_link_sample($formattedName);
}

deleteMeasurementProtocolSecret

Deletes target MeasurementProtocolSecret.

Parameters
NameDescription
name string

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

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the MeasurementProtocolSecret to delete.
 *                              Format:
 *                              properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}
 *                              Please see {@see AnalyticsAdminServiceClient::measurementProtocolSecretName()} for help formatting this field.
 */
function delete_measurement_protocol_secret_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteMeasurementProtocolSecret($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::measurementProtocolSecretName(
        '[PROPERTY]',
        '[DATA_STREAM]',
        '[MEASUREMENT_PROTOCOL_SECRET]'
    );

    delete_measurement_protocol_secret_sample($formattedName);
}

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, 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.

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\Property
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\Property;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the Property to soft-delete.
 *                              Format: properties/{property_id}
 *                              Example: "properties/1000"
 *                              Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function delete_property_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var Property $response */
        $response = $analyticsAdminServiceClient->deleteProperty($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    delete_property_sample($formattedName);
}

Deletes a roll-up property source link.

Only roll-up properties can have source links, so this method will throw an error if used on other types of properties.

Parameters
NameDescription
name string

Required. Format: properties/{property_id}/rollupPropertySourceLinks/{rollup_property_source_link_id} Example: properties/1234/rollupPropertySourceLinks/5678

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Format:
 *                              properties/{property_id}/rollupPropertySourceLinks/{rollup_property_source_link_id}
 *                              Example: properties/1234/rollupPropertySourceLinks/5678
 *                              Please see {@see AnalyticsAdminServiceClient::rollupPropertySourceLinkName()} for help formatting this field.
 */
function delete_rollup_property_source_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteRollupPropertySourceLink($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::rollupPropertySourceLinkName(
        '[PROPERTY]',
        '[ROLLUP_PROPERTY_SOURCE_LINK]'
    );

    delete_rollup_property_source_link_sample($formattedName);
}

deleteSKAdNetworkConversionValueSchema

Deletes target SKAdNetworkConversionValueSchema.

Parameters
NameDescription
name string

Required. The name of the SKAdNetworkConversionValueSchema to delete. Format: properties/{property}/dataStreams/{dataStream}/sKAdNetworkConversionValueSchema/{skadnetwork_conversion_value_schema}

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the SKAdNetworkConversionValueSchema to delete.
 *                              Format:
 *                              properties/{property}/dataStreams/{dataStream}/sKAdNetworkConversionValueSchema/{skadnetwork_conversion_value_schema}
 *                              Please see {@see AnalyticsAdminServiceClient::sKAdNetworkConversionValueSchemaName()} for help formatting this field.
 */
function delete_sk_ad_network_conversion_value_schema_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteSKAdNetworkConversionValueSchema($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::sKAdNetworkConversionValueSchemaName(
        '[PROPERTY]',
        '[DATA_STREAM]',
        '[SKADNETWORK_CONVERSION_VALUE_SCHEMA]'
    );

    delete_sk_ad_network_conversion_value_schema_sample($formattedName);
}

Deletes a SearchAds360Link on a property.

Parameters
NameDescription
name string

Required. The name of the SearchAds360Link to delete. Example format: properties/1234/SearchAds360Links/5678

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the SearchAds360Link to delete.
 *                              Example format: properties/1234/SearchAds360Links/5678
 *                              Please see {@see AnalyticsAdminServiceClient::searchAds360LinkName()} for help formatting this field.
 */
function delete_search_ads360_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteSearchAds360Link($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::searchAds360LinkName(
        '[PROPERTY]',
        '[SEARCH_ADS_360_LINK]'
    );

    delete_search_ads360_link_sample($formattedName);
}

deleteSubpropertyEventFilter

Deletes a subproperty event filter.

Parameters
NameDescription
name string

Required. Resource name of the subproperty event filter to delete. Format: properties/property_id/subpropertyEventFilters/subproperty_event_filter Example: properties/123/subpropertyEventFilters/456

optionalArgs 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.

Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Resource name of the subproperty event filter to delete.
 *                              Format:
 *                              properties/property_id/subpropertyEventFilters/subproperty_event_filter
 *                              Example: properties/123/subpropertyEventFilters/456
 *                              Please see {@see AnalyticsAdminServiceClient::subpropertyEventFilterName()} for help formatting this field.
 */
function delete_subproperty_event_filter_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        $analyticsAdminServiceClient->deleteSubpropertyEventFilter($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::subpropertyEventFilterName(
        '[PROPERTY]',
        '[SUB_PROPERTY_EVENT_FILTER]'
    );

    delete_subproperty_event_filter_sample($formattedName);
}

fetchAutomatedGa4ConfigurationOptOut

Fetches the opt out status for the automated GA4 setup process for a UA property.

Note: this has no effect on GA4 property.

Parameters
NameDescription
property string

Required. The UA property to get the opt out status. Note this request uses the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. Format: properties/{internalWebPropertyId} Example: properties/1234

optionalArgs 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\V1alpha\FetchAutomatedGa4ConfigurationOptOutResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\FetchAutomatedGa4ConfigurationOptOutResponse;
use Google\ApiCore\ApiException;

/**
 * @param string $property The UA property to get the opt out status. Note this request uses
 *                         the internal property ID, not the tracking ID of the form UA-XXXXXX-YY.
 *                         Format: properties/{internalWebPropertyId}
 *                         Example: properties/1234
 */
function fetch_automated_ga4_configuration_opt_out_sample(string $property): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var FetchAutomatedGa4ConfigurationOptOutResponse $response */
        $response = $analyticsAdminServiceClient->fetchAutomatedGa4ConfigurationOptOut($property);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $property = '[PROPERTY]';

    fetch_automated_ga4_configuration_opt_out_sample($property);
}

fetchConnectedGa4Property

Given a specified UA property, looks up the GA4 property connected to it.

Note: this cannot be used with GA4 properties.

Parameters
NameDescription
property string

Required. The UA property for which to look up the connected GA4 property. Note this request uses the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. Format: properties/{internal_web_property_id} Example: properties/1234

optionalArgs 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\V1alpha\FetchConnectedGa4PropertyResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\FetchConnectedGa4PropertyResponse;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedProperty The UA property for which to look up the connected GA4 property.
 *                                  Note this request uses the
 *                                  internal property ID, not the tracking ID of the form UA-XXXXXX-YY.
 *                                  Format: properties/{internal_web_property_id}
 *                                  Example: properties/1234
 *                                  Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function fetch_connected_ga4_property_sample(string $formattedProperty): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var FetchConnectedGa4PropertyResponse $response */
        $response = $analyticsAdminServiceClient->fetchConnectedGa4Property($formattedProperty);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedProperty = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    fetch_connected_ga4_property_sample($formattedProperty);
}

getAccessBinding

Gets information about an access binding.

Parameters
NameDescription
name string

Required. The name of the access binding to retrieve. Formats:

  • accounts/{account}/accessBindings/{accessBinding}
  • properties/{property}/accessBindings/{accessBinding}
optionalArgs 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\V1alpha\AccessBinding
Example
use Google\Analytics\Admin\V1alpha\AccessBinding;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the access binding to retrieve.
 *                              Formats:
 *                              - accounts/{account}/accessBindings/{accessBinding}
 *                              - properties/{property}/accessBindings/{accessBinding}
 *                              Please see {@see AnalyticsAdminServiceClient::accessBindingName()} for help formatting this field.
 */
function get_access_binding_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var AccessBinding $response */
        $response = $analyticsAdminServiceClient->getAccessBinding($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::accessBindingName('[ACCOUNT]', '[ACCESS_BINDING]');

    get_access_binding_sample($formattedName);
}

getAccount

Lookup for a single Account.

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\Account
Example
use Google\Analytics\Admin\V1alpha\Account;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the account to lookup.
 *                              Format: accounts/{account}
 *                              Example: "accounts/100"
 *                              Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
 */
function get_account_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var Account $response */
        $response = $analyticsAdminServiceClient->getAccount($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');

    get_account_sample($formattedName);
}

Looks up a single AdSenseLink.

Parameters
NameDescription
name string

Required. Unique identifier for the AdSense Link requested. Format: properties/{propertyId}/adSenseLinks/{linkId} Example: properties/1234/adSenseLinks/5678

optionalArgs 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\V1alpha\AdSenseLink
Example
use Google\Analytics\Admin\V1alpha\AdSenseLink;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Unique identifier for the AdSense Link requested.
 *                              Format: properties/{propertyId}/adSenseLinks/{linkId}
 *                              Example: properties/1234/adSenseLinks/5678
 *                              Please see {@see AnalyticsAdminServiceClient::adSenseLinkName()} for help formatting this field.
 */
function get_ad_sense_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var AdSenseLink $response */
        $response = $analyticsAdminServiceClient->getAdSenseLink($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::adSenseLinkName('[PROPERTY]', '[ADSENSE_LINK]');

    get_ad_sense_link_sample($formattedName);
}

getAttributionSettings

Lookup for a AttributionSettings singleton.

Parameters
NameDescription
name string

Required. The name of the attribution settings to retrieve. Format: properties/{property}/attributionSettings

optionalArgs 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\V1alpha\AttributionSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\AttributionSettings;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the attribution settings to retrieve.
 *                              Format: properties/{property}/attributionSettings
 *                              Please see {@see AnalyticsAdminServiceClient::attributionSettingsName()} for help formatting this field.
 */
function get_attribution_settings_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var AttributionSettings $response */
        $response = $analyticsAdminServiceClient->getAttributionSettings($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::attributionSettingsName('[PROPERTY]');

    get_attribution_settings_sample($formattedName);
}

getAudience

Lookup for a single Audience.

Audiences created before 2020 may not be supported. Default audiences will not show filter definitions.

Parameters
NameDescription
name string

Required. The name of the Audience to get. Example format: properties/1234/audiences/5678

optionalArgs 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\V1alpha\Audience
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\Audience;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the Audience to get.
 *                              Example format: properties/1234/audiences/5678
 *                              Please see {@see AnalyticsAdminServiceClient::audienceName()} for help formatting this field.
 */
function get_audience_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var Audience $response */
        $response = $analyticsAdminServiceClient->getAudience($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::audienceName('[PROPERTY]', '[AUDIENCE]');

    get_audience_sample($formattedName);
}

Lookup for a single BigQuery Link.

Parameters
NameDescription
name string

Required. The name of the BigQuery link to lookup. Format: properties/{property_id}/bigQueryLinks/{bigquery_link_id} Example: properties/123/bigQueryLinks/456

optionalArgs 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\V1alpha\BigQueryLink
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\BigQueryLink;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the BigQuery link to lookup.
 *                              Format: properties/{property_id}/bigQueryLinks/{bigquery_link_id}
 *                              Example: properties/123/bigQueryLinks/456
 *                              Please see {@see AnalyticsAdminServiceClient::bigQueryLinkName()} for help formatting this field.
 */
function get_big_query_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var BigQueryLink $response */
        $response = $analyticsAdminServiceClient->getBigQueryLink($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::bigQueryLinkName('[PROPERTY]', '[BIGQUERY_LINK]');

    get_big_query_link_sample($formattedName);
}

getChannelGroup

Lookup for a single ChannelGroup.

Parameters
NameDescription
name string

Required. The ChannelGroup to get. Example format: properties/1234/channelGroups/5678

optionalArgs 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\V1alpha\ChannelGroup
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ChannelGroup;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The ChannelGroup to get.
 *                              Example format: properties/1234/channelGroups/5678
 *                              Please see {@see AnalyticsAdminServiceClient::channelGroupName()} for help formatting this field.
 */
function get_channel_group_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var ChannelGroup $response */
        $response = $analyticsAdminServiceClient->getChannelGroup($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::channelGroupName('[PROPERTY]', '[CHANNEL_GROUP]');

    get_channel_group_sample($formattedName);
}

getConversionEvent

Retrieve a single conversion event.

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\ConversionEvent
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ConversionEvent;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The resource name of the conversion event to retrieve.
 *                              Format: properties/{property}/conversionEvents/{conversion_event}
 *                              Example: "properties/123/conversionEvents/456"
 *                              Please see {@see AnalyticsAdminServiceClient::conversionEventName()} for help formatting this field.
 */
function get_conversion_event_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var ConversionEvent $response */
        $response = $analyticsAdminServiceClient->getConversionEvent($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::conversionEventName(
        '[PROPERTY]',
        '[CONVERSION_EVENT]'
    );

    get_conversion_event_sample($formattedName);
}

getCustomDimension

Lookup for a single CustomDimension.

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\CustomDimension
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\CustomDimension;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the CustomDimension to get.
 *                              Example format: properties/1234/customDimensions/5678
 *                              Please see {@see AnalyticsAdminServiceClient::customDimensionName()} for help formatting this field.
 */
function get_custom_dimension_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var CustomDimension $response */
        $response = $analyticsAdminServiceClient->getCustomDimension($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::customDimensionName(
        '[PROPERTY]',
        '[CUSTOM_DIMENSION]'
    );

    get_custom_dimension_sample($formattedName);
}

getCustomMetric

Lookup for a single CustomMetric.

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\CustomMetric
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\CustomMetric;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the CustomMetric to get.
 *                              Example format: properties/1234/customMetrics/5678
 *                              Please see {@see AnalyticsAdminServiceClient::customMetricName()} for help formatting this field.
 */
function get_custom_metric_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var CustomMetric $response */
        $response = $analyticsAdminServiceClient->getCustomMetric($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::customMetricName('[PROPERTY]', '[CUSTOM_METRIC]');

    get_custom_metric_sample($formattedName);
}

getDataRedactionSettings

Lookup for a single DataRedactionSettings.

Parameters
NameDescription
name string

Required. The name of the settings to lookup. Format: properties/{property}/dataStreams/{data_stream}/dataRedactionSettings Example: "properties/1000/dataStreams/2000/dataRedactionSettings"

optionalArgs 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\V1alpha\DataRedactionSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DataRedactionSettings;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the settings to lookup.
 *                              Format:
 *                              properties/{property}/dataStreams/{data_stream}/dataRedactionSettings
 *                              Example: "properties/1000/dataStreams/2000/dataRedactionSettings"
 *                              Please see {@see AnalyticsAdminServiceClient::dataRedactionSettingsName()} for help formatting this field.
 */
function get_data_redaction_settings_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var DataRedactionSettings $response */
        $response = $analyticsAdminServiceClient->getDataRedactionSettings($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::dataRedactionSettingsName(
        '[PROPERTY]',
        '[DATA_STREAM]'
    );

    get_data_redaction_settings_sample($formattedName);
}

getDataRetentionSettings

Returns the singleton data retention settings for this property.

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\DataRetentionSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DataRetentionSettings;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the settings to lookup.
 *                              Format:
 *                              properties/{property}/dataRetentionSettings
 *                              Example: "properties/1000/dataRetentionSettings"
 *                              Please see {@see AnalyticsAdminServiceClient::dataRetentionSettingsName()} for help formatting this field.
 */
function get_data_retention_settings_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var DataRetentionSettings $response */
        $response = $analyticsAdminServiceClient->getDataRetentionSettings($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::dataRetentionSettingsName('[PROPERTY]');

    get_data_retention_settings_sample($formattedName);
}

getDataSharingSettings

Get data sharing settings on an account.

Data sharing settings are singletons.

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\DataSharingSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DataSharingSettings;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the settings to lookup.
 *                              Format: accounts/{account}/dataSharingSettings
 *                              Example: "accounts/1000/dataSharingSettings"
 *                              Please see {@see AnalyticsAdminServiceClient::dataSharingSettingsName()} for help formatting this field.
 */
function get_data_sharing_settings_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var DataSharingSettings $response */
        $response = $analyticsAdminServiceClient->getDataSharingSettings($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::dataSharingSettingsName('[ACCOUNT]');

    get_data_sharing_settings_sample($formattedName);
}

getDataStream

Lookup for a single DataStream.

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\DataStream
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DataStream;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the DataStream to get.
 *                              Example format: properties/1234/dataStreams/5678
 *                              Please see {@see AnalyticsAdminServiceClient::dataStreamName()} for help formatting this field.
 */
function get_data_stream_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var DataStream $response */
        $response = $analyticsAdminServiceClient->getDataStream($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::dataStreamName('[PROPERTY]', '[DATA_STREAM]');

    get_data_stream_sample($formattedName);
}

Look up a single DisplayVideo360AdvertiserLink

Parameters
NameDescription
name string

Required. The name of the DisplayVideo360AdvertiserLink to get. Example format: properties/1234/displayVideo360AdvertiserLink/5678

optionalArgs 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\V1alpha\DisplayVideo360AdvertiserLink
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DisplayVideo360AdvertiserLink;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the DisplayVideo360AdvertiserLink to get.
 *                              Example format: properties/1234/displayVideo360AdvertiserLink/5678
 *                              Please see {@see AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkName()} for help formatting this field.
 */
function get_display_video360_advertiser_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var DisplayVideo360AdvertiserLink $response */
        $response = $analyticsAdminServiceClient->getDisplayVideo360AdvertiserLink($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkName(
        '[PROPERTY]',
        '[DISPLAY_VIDEO_360_ADVERTISER_LINK]'
    );

    get_display_video360_advertiser_link_sample($formattedName);
}

getDisplayVideo360AdvertiserLinkProposal

Lookup for a single DisplayVideo360AdvertiserLinkProposal.

Parameters
NameDescription
name string

Required. The name of the DisplayVideo360AdvertiserLinkProposal to get. Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678

optionalArgs 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\V1alpha\DisplayVideo360AdvertiserLinkProposal
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DisplayVideo360AdvertiserLinkProposal;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the DisplayVideo360AdvertiserLinkProposal to get.
 *                              Example format: properties/1234/displayVideo360AdvertiserLinkProposals/5678
 *                              Please see {@see AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkProposalName()} for help formatting this field.
 */
function get_display_video360_advertiser_link_proposal_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var DisplayVideo360AdvertiserLinkProposal $response */
        $response = $analyticsAdminServiceClient->getDisplayVideo360AdvertiserLinkProposal($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::displayVideo360AdvertiserLinkProposalName(
        '[PROPERTY]',
        '[DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL]'
    );

    get_display_video360_advertiser_link_proposal_sample($formattedName);
}

getEnhancedMeasurementSettings

Returns the enhanced measurement settings for this data stream.

Note that the stream must enable enhanced measurement for these settings to take effect.

Parameters
NameDescription
name string

Required. The name of the settings to lookup. Format: properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings Example: "properties/1000/dataStreams/2000/enhancedMeasurementSettings"

optionalArgs 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\V1alpha\EnhancedMeasurementSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\EnhancedMeasurementSettings;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the settings to lookup.
 *                              Format:
 *                              properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings
 *                              Example: "properties/1000/dataStreams/2000/enhancedMeasurementSettings"
 *                              Please see {@see AnalyticsAdminServiceClient::enhancedMeasurementSettingsName()} for help formatting this field.
 */
function get_enhanced_measurement_settings_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var EnhancedMeasurementSettings $response */
        $response = $analyticsAdminServiceClient->getEnhancedMeasurementSettings($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::enhancedMeasurementSettingsName(
        '[PROPERTY]',
        '[DATA_STREAM]'
    );

    get_enhanced_measurement_settings_sample($formattedName);
}

getEventCreateRule

Lookup for a single EventCreateRule.

Parameters
NameDescription
name string

Required. The name of the EventCreateRule to get. Example format: properties/123/dataStreams/456/eventCreateRules/789

optionalArgs 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\V1alpha\EventCreateRule
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\EventCreateRule;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the EventCreateRule to get.
 *                              Example format: properties/123/dataStreams/456/eventCreateRules/789
 *                              Please see {@see AnalyticsAdminServiceClient::eventCreateRuleName()} for help formatting this field.
 */
function get_event_create_rule_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var EventCreateRule $response */
        $response = $analyticsAdminServiceClient->getEventCreateRule($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::eventCreateRuleName(
        '[PROPERTY]',
        '[DATA_STREAM]',
        '[EVENT_CREATE_RULE]'
    );

    get_event_create_rule_sample($formattedName);
}

getExpandedDataSet

Lookup for a single ExpandedDataSet.

Parameters
NameDescription
name string

Required. The name of the ExpandedDataSet to get. Example format: properties/1234/expandedDataSets/5678

optionalArgs 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\V1alpha\ExpandedDataSet
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ExpandedDataSet;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the ExpandedDataSet to get.
 *                              Example format: properties/1234/expandedDataSets/5678
 *                              Please see {@see AnalyticsAdminServiceClient::expandedDataSetName()} for help formatting this field.
 */
function get_expanded_data_set_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var ExpandedDataSet $response */
        $response = $analyticsAdminServiceClient->getExpandedDataSet($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::expandedDataSetName(
        '[PROPERTY]',
        '[EXPANDED_DATA_SET]'
    );

    get_expanded_data_set_sample($formattedName);
}

getGlobalSiteTag

Returns the Site Tag for the specified web stream.

Site Tags are immutable singletons.

Parameters
NameDescription
name string

Required. The name of the site tag to lookup. Note that site tags are singletons and do not have unique IDs. Format: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag Example: "properties/123/dataStreams/456/globalSiteTag"

optionalArgs 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\V1alpha\GlobalSiteTag
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\GlobalSiteTag;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the site tag to lookup.
 *                              Note that site tags are singletons and do not have unique IDs.
 *                              Format: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag
 *                              Example: "properties/123/dataStreams/456/globalSiteTag"
 *                              Please see {@see AnalyticsAdminServiceClient::globalSiteTagName()} for help formatting this field.
 */
function get_global_site_tag_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var GlobalSiteTag $response */
        $response = $analyticsAdminServiceClient->getGlobalSiteTag($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::globalSiteTagName('[PROPERTY]', '[DATA_STREAM]');

    get_global_site_tag_sample($formattedName);
}

getGoogleSignalsSettings

Lookup for Google Signals settings for a property.

Parameters
NameDescription
name string

Required. The name of the google signals settings to retrieve. Format: properties/{property}/googleSignalsSettings

optionalArgs 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\V1alpha\GoogleSignalsSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\GoogleSignalsSettings;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the google signals settings to retrieve.
 *                              Format: properties/{property}/googleSignalsSettings
 *                              Please see {@see AnalyticsAdminServiceClient::googleSignalsSettingsName()} for help formatting this field.
 */
function get_google_signals_settings_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var GoogleSignalsSettings $response */
        $response = $analyticsAdminServiceClient->getGoogleSignalsSettings($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::googleSignalsSettingsName('[PROPERTY]');

    get_google_signals_settings_sample($formattedName);
}

getMeasurementProtocolSecret

Lookup for a single "GA4" MeasurementProtocolSecret.

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\MeasurementProtocolSecret
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\MeasurementProtocolSecret;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the measurement protocol secret to lookup.
 *                              Format:
 *                              properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}
 *                              Please see {@see AnalyticsAdminServiceClient::measurementProtocolSecretName()} for help formatting this field.
 */
function get_measurement_protocol_secret_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var MeasurementProtocolSecret $response */
        $response = $analyticsAdminServiceClient->getMeasurementProtocolSecret($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::measurementProtocolSecretName(
        '[PROPERTY]',
        '[DATA_STREAM]',
        '[MEASUREMENT_PROTOCOL_SECRET]'
    );

    get_measurement_protocol_secret_sample($formattedName);
}

getProperty

Lookup for a single "GA4" Property.

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\Property
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\Property;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the property to lookup.
 *                              Format: properties/{property_id}
 *                              Example: "properties/1000"
 *                              Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function get_property_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var Property $response */
        $response = $analyticsAdminServiceClient->getProperty($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    get_property_sample($formattedName);
}

Lookup for a single roll-up property source Link.

Only roll-up properties can have source links, so this method will throw an error if used on other types of properties.

Parameters
NameDescription
name string

Required. The name of the roll-up property source link to lookup. Format: properties/{property_id}/rollupPropertySourceLinks/{rollup_property_source_link_id} Example: properties/123/rollupPropertySourceLinks/456

optionalArgs 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\V1alpha\RollupPropertySourceLink
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\RollupPropertySourceLink;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the roll-up property source link to lookup.
 *                              Format:
 *                              properties/{property_id}/rollupPropertySourceLinks/{rollup_property_source_link_id}
 *                              Example: properties/123/rollupPropertySourceLinks/456
 *                              Please see {@see AnalyticsAdminServiceClient::rollupPropertySourceLinkName()} for help formatting this field.
 */
function get_rollup_property_source_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var RollupPropertySourceLink $response */
        $response = $analyticsAdminServiceClient->getRollupPropertySourceLink($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::rollupPropertySourceLinkName(
        '[PROPERTY]',
        '[ROLLUP_PROPERTY_SOURCE_LINK]'
    );

    get_rollup_property_source_link_sample($formattedName);
}

getSKAdNetworkConversionValueSchema

Looks up a single SKAdNetworkConversionValueSchema.

Parameters
NameDescription
name string

Required. The resource name of SKAdNetwork conversion value schema to look up. Format: properties/{property}/dataStreams/{dataStream}/sKAdNetworkConversionValueSchema/{skadnetwork_conversion_value_schema}

optionalArgs 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\V1alpha\SKAdNetworkConversionValueSchema
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SKAdNetworkConversionValueSchema;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The resource name of SKAdNetwork conversion value schema to look
 *                              up. Format:
 *                              properties/{property}/dataStreams/{dataStream}/sKAdNetworkConversionValueSchema/{skadnetwork_conversion_value_schema}
 *                              Please see {@see AnalyticsAdminServiceClient::sKAdNetworkConversionValueSchemaName()} for help formatting this field.
 */
function get_sk_ad_network_conversion_value_schema_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var SKAdNetworkConversionValueSchema $response */
        $response = $analyticsAdminServiceClient->getSKAdNetworkConversionValueSchema($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::sKAdNetworkConversionValueSchemaName(
        '[PROPERTY]',
        '[DATA_STREAM]',
        '[SKADNETWORK_CONVERSION_VALUE_SCHEMA]'
    );

    get_sk_ad_network_conversion_value_schema_sample($formattedName);
}

Look up a single SearchAds360Link

Parameters
NameDescription
name string

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

optionalArgs 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\V1alpha\SearchAds360Link
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SearchAds360Link;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The name of the SearchAds360Link to get.
 *                              Example format: properties/1234/SearchAds360Link/5678
 *                              Please see {@see AnalyticsAdminServiceClient::searchAds360LinkName()} for help formatting this field.
 */
function get_search_ads360_link_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var SearchAds360Link $response */
        $response = $analyticsAdminServiceClient->getSearchAds360Link($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::searchAds360LinkName(
        '[PROPERTY]',
        '[SEARCH_ADS_360_LINK]'
    );

    get_search_ads360_link_sample($formattedName);
}

getSubpropertyEventFilter

Lookup for a single subproperty Event Filter.

Parameters
NameDescription
name string

Required. Resource name of the subproperty event filter to lookup. Format: properties/property_id/subpropertyEventFilters/subproperty_event_filter Example: properties/123/subpropertyEventFilters/456

optionalArgs 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\V1alpha\SubpropertyEventFilter
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SubpropertyEventFilter;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName Resource name of the subproperty event filter to lookup.
 *                              Format:
 *                              properties/property_id/subpropertyEventFilters/subproperty_event_filter
 *                              Example: properties/123/subpropertyEventFilters/456
 *                              Please see {@see AnalyticsAdminServiceClient::subpropertyEventFilterName()} for help formatting this field.
 */
function get_subproperty_event_filter_sample(string $formattedName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var SubpropertyEventFilter $response */
        $response = $analyticsAdminServiceClient->getSubpropertyEventFilter($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = AnalyticsAdminServiceClient::subpropertyEventFilterName(
        '[PROPERTY]',
        '[SUB_PROPERTY_EVENT_FILTER]'
    );

    get_subproperty_event_filter_sample($formattedName);
}

listAccessBindings

Lists all access bindings on an account or property.

Parameters
NameDescription
parent string

Required. Formats:

  • accounts/{account}
  • properties/{property}
optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AccessBinding;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Formats:
 *                                - accounts/{account}
 *                                - properties/{property}
 *                                Please see {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
 */
function list_access_bindings_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listAccessBindings($formattedParent);

        /** @var AccessBinding $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');

    list_access_bindings_sample($formattedParent);
}

listAccountSummaries

Returns summaries of all accounts accessible by the caller.

Parameters
NameDescription
optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AccountSummary;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function list_account_summaries_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listAccountSummaries();

        /** @var AccountSummary $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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.

Parameters
NameDescription
optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ showDeleted bool

Whether to include soft-deleted (ie: "trashed") Accounts in the results. Accounts can be inspected to determine whether they are deleted or not.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\Account;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function list_accounts_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listAccounts();

        /** @var Account $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

Lists AdSenseLinks on a property.

Parameters
NameDescription
parent string

Required. Resource name of the parent property. Format: properties/{propertyId} Example: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AdSenseLink;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Resource name of the parent property.
 *                                Format: properties/{propertyId}
 *                                Example: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_ad_sense_links_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listAdSenseLinks($formattedParent);

        /** @var AdSenseLink $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_ad_sense_links_sample($formattedParent);
}

listAudiences

Lists Audiences on a property.

Audiences created before 2020 may not be supported. Default audiences will not show filter definitions.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\Audience;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_audiences_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listAudiences($formattedParent);

        /** @var Audience $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_audiences_sample($formattedParent);
}

Lists BigQuery Links on a property.

Parameters
NameDescription
parent string

Required. The name of the property to list BigQuery links under. Format: properties/{property_id} Example: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\BigQueryLink;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent The name of the property to list BigQuery links under.
 *                                Format: properties/{property_id}
 *                                Example: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_big_query_links_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listBigQueryLinks($formattedParent);

        /** @var BigQueryLink $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_big_query_links_sample($formattedParent);
}

listChannelGroups

Lists ChannelGroups on a property.

Parameters
NameDescription
parent string

Required. The property for which to list ChannelGroups. Example format: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ChannelGroup;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent The property for which to list ChannelGroups.
 *                                Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_channel_groups_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listChannelGroups($formattedParent);

        /** @var ChannelGroup $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_channel_groups_sample($formattedParent);
}

listConnectedSiteTags

Lists the connected site tags for a Universal Analytics property. A maximum of 20 connected site tags will be returned. Note: this has no effect on GA4 property.

Parameters
NameDescription
optionalArgs array

Optional.

↳ property string

The Universal Analytics property to fetch connected site tags for. This does not work on GA4 properties. A maximum of 20 connected site tags will be returned. Example Format: properties/1234

↳ 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\V1alpha\ListConnectedSiteTagsResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ListConnectedSiteTagsResponse;
use Google\ApiCore\ApiException;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function list_connected_site_tags_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var ListConnectedSiteTagsResponse $response */
        $response = $analyticsAdminServiceClient->listConnectedSiteTags();
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

listConversionEvents

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

Returns an empty list if no conversion events are found.

Parameters
NameDescription
parent string

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

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ConversionEvent;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent The resource name of the parent property.
 *                                Example: 'properties/123'
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_conversion_events_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listConversionEvents($formattedParent);

        /** @var ConversionEvent $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_conversion_events_sample($formattedParent);
}

listCustomDimensions

Lists CustomDimensions on a property.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\CustomDimension;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_custom_dimensions_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listCustomDimensions($formattedParent);

        /** @var CustomDimension $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_custom_dimensions_sample($formattedParent);
}

listCustomMetrics

Lists CustomMetrics on a property.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\CustomMetric;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_custom_metrics_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listCustomMetrics($formattedParent);

        /** @var CustomMetric $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_custom_metrics_sample($formattedParent);
}

listDataStreams

Lists DataStreams on a property.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DataStream;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_data_streams_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listDataStreams($formattedParent);

        /** @var DataStream $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_data_streams_sample($formattedParent);
}

listDisplayVideo360AdvertiserLinkProposals

Lists DisplayVideo360AdvertiserLinkProposals on a property.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DisplayVideo360AdvertiserLinkProposal;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_display_video360_advertiser_link_proposals_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listDisplayVideo360AdvertiserLinkProposals(
            $formattedParent
        );

        /** @var DisplayVideo360AdvertiserLinkProposal $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_display_video360_advertiser_link_proposals_sample($formattedParent);
}

Lists all DisplayVideo360AdvertiserLinks on a property.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DisplayVideo360AdvertiserLink;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_display_video360_advertiser_links_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listDisplayVideo360AdvertiserLinks($formattedParent);

        /** @var DisplayVideo360AdvertiserLink $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_display_video360_advertiser_links_sample($formattedParent);
}

listEventCreateRules

Lists EventCreateRules on a web data stream.

Parameters
NameDescription
parent string

Required. Example format: properties/123/dataStreams/456

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\EventCreateRule;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Example format: properties/123/dataStreams/456
 *                                Please see {@see AnalyticsAdminServiceClient::dataStreamName()} for help formatting this field.
 */
function list_event_create_rules_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listEventCreateRules($formattedParent);

        /** @var EventCreateRule $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::dataStreamName('[PROPERTY]', '[DATA_STREAM]');

    list_event_create_rules_sample($formattedParent);
}

listExpandedDataSets

Lists ExpandedDataSets on a property.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ExpandedDataSet;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_expanded_data_sets_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listExpandedDataSets($formattedParent);

        /** @var ExpandedDataSet $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_expanded_data_sets_sample($formattedParent);
}

Lists FirebaseLinks on a property.

Properties can have at most one FirebaseLink.

Parameters
NameDescription
parent string

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

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\FirebaseLink;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Format: properties/{property_id}
 *                                Example: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_firebase_links_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listFirebaseLinks($formattedParent);

        /** @var FirebaseLink $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_firebase_links_sample($formattedParent);
}

Lists GoogleAdsLinks on a property.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\GoogleAdsLink;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_google_ads_links_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listGoogleAdsLinks($formattedParent);

        /** @var GoogleAdsLink $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_google_ads_links_sample($formattedParent);
}

listMeasurementProtocolSecrets

Returns child MeasurementProtocolSecrets under the specified parent Property.

Parameters
NameDescription
parent string

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

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\MeasurementProtocolSecret;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent The resource name of the parent stream.
 *                                Format:
 *                                properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets
 *                                Please see {@see AnalyticsAdminServiceClient::dataStreamName()} for help formatting this field.
 */
function list_measurement_protocol_secrets_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listMeasurementProtocolSecrets($formattedParent);

        /** @var MeasurementProtocolSecret $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::dataStreamName('[PROPERTY]', '[DATA_STREAM]');

    list_measurement_protocol_secrets_sample($formattedParent);
}

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.

Parameters
NameDescription
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/property) or ancestor:(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.       |
| parent:properties/123       | The property with property id: 123.       |
| ancestor: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.    |
optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ showDeleted bool

Whether to include soft-deleted (ie: "trashed") Properties in the results. Properties can be inspected to determine whether they are deleted or not.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\Property;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $filter An expression for filtering the results of the request.
 *                       Fields eligible for filtering are:
 *                       `parent:`(The resource name of the parent account/property) or
 *                       `ancestor:`(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.       |
 *                       | parent:properties/123       | The property with property id: 123.       |
 *                       | ancestor: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.    |
 *                       ```
 */
function list_properties_sample(string $filter): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listProperties($filter);

        /** @var Property $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $filter = '[FILTER]';

    list_properties_sample($filter);
}

Lists roll-up property source Links on a property.

Only roll-up properties can have source links, so this method will throw an error if used on other types of properties.

Parameters
NameDescription
parent string

Required. The name of the roll-up property to list roll-up property source links under. Format: properties/{property_id} Example: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\RollupPropertySourceLink;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent The name of the roll-up property to list roll-up property source
 *                                links under. Format: properties/{property_id} Example: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_rollup_property_source_links_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listRollupPropertySourceLinks($formattedParent);

        /** @var RollupPropertySourceLink $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_rollup_property_source_links_sample($formattedParent);
}

listSKAdNetworkConversionValueSchemas

Lists SKAdNetworkConversionValueSchema on a stream.

Properties can have at most one SKAdNetworkConversionValueSchema.

Parameters
NameDescription
parent string

Required. The DataStream resource to list schemas for. Format: properties/{property_id}/dataStreams/{dataStream} Example: properties/1234/dataStreams/5678

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SKAdNetworkConversionValueSchema;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent The DataStream resource to list schemas for.
 *                                Format:
 *                                properties/{property_id}/dataStreams/{dataStream}
 *                                Example: properties/1234/dataStreams/5678
 *                                Please see {@see AnalyticsAdminServiceClient::dataStreamName()} for help formatting this field.
 */
function list_sk_ad_network_conversion_value_schemas_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listSKAdNetworkConversionValueSchemas($formattedParent);

        /** @var SKAdNetworkConversionValueSchema $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::dataStreamName('[PROPERTY]', '[DATA_STREAM]');

    list_sk_ad_network_conversion_value_schemas_sample($formattedParent);
}

Lists all SearchAds360Links on a property.

Parameters
NameDescription
parent string

Required. Example format: properties/1234

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SearchAds360Link;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Example format: properties/1234
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_search_ads360_links_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listSearchAds360Links($formattedParent);

        /** @var SearchAds360Link $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_search_ads360_links_sample($formattedParent);
}

listSubpropertyEventFilters

List all subproperty Event Filters on a property.

Parameters
NameDescription
parent string

Required. Resource name of the ordinary property. Format: properties/property_id Example: properties/123

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SubpropertyEventFilter;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent Resource name of the ordinary property.
 *                                Format: properties/property_id
 *                                Example: properties/123
 *                                Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
 */
function list_subproperty_event_filters_sample(string $formattedParent): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->listSubpropertyEventFilters($formattedParent);

        /** @var SubpropertyEventFilter $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = AnalyticsAdminServiceClient::propertyName('[PROPERTY]');

    list_subproperty_event_filters_sample($formattedParent);
}

provisionAccountTicket

Requests a ticket for creating an account.

Parameters
NameDescription
optionalArgs array

Optional.

↳ account Account

The account to create.

↳ redirectUri string

Redirect URI where the user will be sent after accepting Terms of Service. Must be configured in Cloud Console as a Redirect URI.

↳ 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\V1alpha\ProvisionAccountTicketResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ProvisionAccountTicketResponse;
use Google\ApiCore\ApiException;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function provision_account_ticket_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var ProvisionAccountTicketResponse $response */
        $response = $analyticsAdminServiceClient->provisionAccountTicket();
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

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

Parameters
NameDescription
optionalArgs array

Optional.

↳ entity string

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.

↳ dimensions AccessDimension[]

The dimensions requested and displayed in the response. Requests are allowed up to 9 dimensions.

↳ metrics AccessMetric[]

The metrics requested and displayed in the response. Requests are allowed up to 10 metrics.

↳ dateRanges AccessDateRange[]

Date ranges of access records to read. If multiple date ranges are requested, each response row will contain a zero based date range index. If two date ranges overlap, the access records for the overlapping days is included in the response rows for both date ranges. Requests are allowed up to 2 date ranges.

↳ dimensionFilter AccessFilterExpression

Dimension filters let you restrict report response to specific dimension values which match the filter. For example, filtering on access records of a single user. To learn more, see Fundamentals of Dimension Filters for examples. Metrics cannot be used in this filter.

↳ metricFilter AccessFilterExpression

Metric filters allow you to restrict report response to specific metric values which match the filter. Metric filters are applied after aggregating the report's rows, similar to SQL having-clause. Dimensions cannot be used in this filter.

↳ offset int

The row count of the start row. The first row is counted as row 0. If offset is unspecified, it is treated as 0. If offset is zero, then this method will return the first page of results with limit entries. To learn more about this pagination parameter, see Pagination.

↳ limit int

The number of rows to return. If unspecified, 10,000 rows are returned. The API returns a maximum of 100,000 rows per request, no matter how many you ask for. limit must be positive. The API may return fewer rows than the requested limit, if there aren't as many remaining rows as the limit. For instance, there are fewer than 300 possible values for the dimension country, so when reporting on only country, you can't get more than 300 rows, even if you set limit to a higher value. To learn more about this pagination parameter, see Pagination.

↳ timeZone string

This request's time zone if specified. If unspecified, the property's time zone is used. The request's time zone is used to interpret the start & end dates of the report. Formatted as strings from the IANA Time Zone database (https://www.iana.org/time-zones); for example "America/New_York" or "Asia/Tokyo".

↳ orderBys AccessOrderBy[]

Specifies how rows are ordered in the response.

↳ returnEntityQuota bool

Toggles whether to return the current state of this Analytics Property's quota. Quota is returned in AccessQuota. For account-level requests, this field must be false.

↳ includeAllUsers bool

Optional. Determines whether to include users who have never made an API call in the response. If true, all users with access to the specified property or account are included in the response, regardless of whether they have made an API call or not. If false, only the users who have made an API call will be included.

↳ expandGroups bool

Optional. Decides whether to return the users within user groups. This field works only when include_all_users is set to true. If true, it will return all users with access to the specified property or account. If false, only the users with direct access will be returned.

↳ 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\V1alpha\RunAccessReportResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\RunAccessReportResponse;
use Google\ApiCore\ApiException;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function run_access_report_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var RunAccessReportResponse $response */
        $response = $analyticsAdminServiceClient->runAccessReport();
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

searchChangeHistoryEvents

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

Parameters
NameDescription
account string

Required. The account resource for which to return change history resources.

optionalArgs array

Optional.

↳ property string

Optional. Resource name for a child property. If set, only return changes made to this property or its child resources.

↳ resourceType int[]

Optional. If set, only return changes if they are for a resource that matches at least one of these types. For allowed values, use constants defined on Google\Analytics\Admin\V1alpha\ChangeHistoryResourceType

↳ action int[]

Optional. If set, only return changes that match one or more of these types of actions. For allowed values, use constants defined on Google\Analytics\Admin\V1alpha\ActionType

↳ actorEmail string[]

Optional. If set, only return changes if they are made by a user in this list.

↳ earliestChangeTime Timestamp

Optional. If set, only return changes made after this time (inclusive).

↳ latestChangeTime Timestamp

Optional. If set, only return changes made before this time (inclusive).

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ 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
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ChangeHistoryEvent;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedAccount The account resource for which to return change history
 *                                 resources. Please see
 *                                 {@see AnalyticsAdminServiceClient::accountName()} for help formatting this field.
 */
function search_change_history_events_sample(string $formattedAccount): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $analyticsAdminServiceClient->searchChangeHistoryEvents($formattedAccount);

        /** @var ChangeHistoryEvent $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedAccount = AnalyticsAdminServiceClient::accountName('[ACCOUNT]');

    search_change_history_events_sample($formattedAccount);
}

setAutomatedGa4ConfigurationOptOut

Sets the opt out status for the automated GA4 setup process for a UA property.

Note: this has no effect on GA4 property.

Parameters
NameDescription
property string

Required. The UA property to set the opt out status. Note this request uses the internal property ID, not the tracking ID of the form UA-XXXXXX-YY. Format: properties/{internalWebPropertyId} Example: properties/1234

optionalArgs array

Optional.

↳ optOut bool

The status to set.

↳ 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\V1alpha\SetAutomatedGa4ConfigurationOptOutResponse
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SetAutomatedGa4ConfigurationOptOutResponse;
use Google\ApiCore\ApiException;

/**
 * @param string $property The UA property to set the opt out status. Note this request uses
 *                         the internal property ID, not the tracking ID of the form UA-XXXXXX-YY.
 *                         Format: properties/{internalWebPropertyId}
 *                         Example: properties/1234
 */
function set_automated_ga4_configuration_opt_out_sample(string $property): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var SetAutomatedGa4ConfigurationOptOutResponse $response */
        $response = $analyticsAdminServiceClient->setAutomatedGa4ConfigurationOptOut($property);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $property = '[PROPERTY]';

    set_automated_ga4_configuration_opt_out_sample($property);
}

updateAccessBinding

Updates an access binding on an account or property.

Parameters
NameDescription
accessBinding Google\Analytics\Admin\V1alpha\AccessBinding

Required. The access binding to update.

optionalArgs 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\V1alpha\AccessBinding
Example
use Google\Analytics\Admin\V1alpha\AccessBinding;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_access_binding_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $accessBinding = new AccessBinding();

    // Call the API and handle any network failures.
    try {
        /** @var AccessBinding $response */
        $response = $analyticsAdminServiceClient->updateAccessBinding($accessBinding);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateAccount

Updates an account.

Parameters
NameDescription
account Google\Analytics\Admin\V1alpha\Account

Required. The account to update. The account's name field is used to identify the account.

updateMask Google\Protobuf\FieldMask

Required. The list of fields to be updated. Field names must be in snake case (for example, "field_to_update"). Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.

optionalArgs 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\V1alpha\Account
Example
use Google\Analytics\Admin\V1alpha\Account;
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * @param string $accountDisplayName Human-readable display name for this account.
 */
function update_account_sample(string $accountDisplayName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $account = (new Account())
        ->setDisplayName($accountDisplayName);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var Account $response */
        $response = $analyticsAdminServiceClient->updateAccount($account, $updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $accountDisplayName = '[DISPLAY_NAME]';

    update_account_sample($accountDisplayName);
}

updateAttributionSettings

Updates attribution settings on a property.

Parameters
NameDescription
attributionSettings Google\Analytics\Admin\V1alpha\AttributionSettings

Required. The attribution settings to update. The name field is used to identify the settings to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\AttributionSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\AttributionSettings;
use Google\Analytics\Admin\V1alpha\AttributionSettings\AcquisitionConversionEventLookbackWindow;
use Google\Analytics\Admin\V1alpha\AttributionSettings\AdsWebConversionDataExportScope;
use Google\Analytics\Admin\V1alpha\AttributionSettings\OtherConversionEventLookbackWindow;
use Google\Analytics\Admin\V1alpha\AttributionSettings\ReportingAttributionModel;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * @param int $attributionSettingsAcquisitionConversionEventLookbackWindow The lookback window configuration for acquisition conversion
 *                                                                         events. The default window size is 30 days.
 * @param int $attributionSettingsOtherConversionEventLookbackWindow       The lookback window for all other, non-acquisition conversion
 *                                                                         events. The default window size is 90 days.
 * @param int $attributionSettingsReportingAttributionModel                The reporting attribution model used to calculate conversion
 *                                                                         credit in this property's reports.
 *
 *                                                                         Changing the attribution model will apply to both historical and future
 *                                                                         data. These changes will be reflected in reports with conversion and
 *                                                                         revenue data. User and session data will be unaffected.
 * @param int $attributionSettingsAdsWebConversionDataExportScope          The Conversion Export Scope for data exported to linked Ads
 *                                                                         Accounts.
 */
function update_attribution_settings_sample(
    int $attributionSettingsAcquisitionConversionEventLookbackWindow,
    int $attributionSettingsOtherConversionEventLookbackWindow,
    int $attributionSettingsReportingAttributionModel,
    int $attributionSettingsAdsWebConversionDataExportScope
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $attributionSettings = (new AttributionSettings())
        ->setAcquisitionConversionEventLookbackWindow(
            $attributionSettingsAcquisitionConversionEventLookbackWindow
        )
        ->setOtherConversionEventLookbackWindow($attributionSettingsOtherConversionEventLookbackWindow)
        ->setReportingAttributionModel($attributionSettingsReportingAttributionModel)
        ->setAdsWebConversionDataExportScope($attributionSettingsAdsWebConversionDataExportScope);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var AttributionSettings $response */
        $response = $analyticsAdminServiceClient->updateAttributionSettings(
            $attributionSettings,
            $updateMask
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $attributionSettingsAcquisitionConversionEventLookbackWindow = AcquisitionConversionEventLookbackWindow::ACQUISITION_CONVERSION_EVENT_LOOKBACK_WINDOW_UNSPECIFIED;
    $attributionSettingsOtherConversionEventLookbackWindow = OtherConversionEventLookbackWindow::OTHER_CONVERSION_EVENT_LOOKBACK_WINDOW_UNSPECIFIED;
    $attributionSettingsReportingAttributionModel = ReportingAttributionModel::REPORTING_ATTRIBUTION_MODEL_UNSPECIFIED;
    $attributionSettingsAdsWebConversionDataExportScope = AdsWebConversionDataExportScope::ADS_WEB_CONVERSION_DATA_EXPORT_SCOPE_UNSPECIFIED;

    update_attribution_settings_sample(
        $attributionSettingsAcquisitionConversionEventLookbackWindow,
        $attributionSettingsOtherConversionEventLookbackWindow,
        $attributionSettingsReportingAttributionModel,
        $attributionSettingsAdsWebConversionDataExportScope
    );
}

updateAudience

Updates an Audience on a property.

Parameters
NameDescription
audience Google\Analytics\Admin\V1alpha\Audience

Required. The audience to update. The audience's name field is used to identify the audience to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\Audience
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\Audience;
use Google\Analytics\Admin\V1alpha\AudienceFilterClause;
use Google\Analytics\Admin\V1alpha\AudienceFilterClause\AudienceClauseType;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * @param string $audienceDisplayName             The display name of the Audience.
 * @param string $audienceDescription             The description of the Audience.
 * @param int    $audienceMembershipDurationDays  Immutable. The duration a user should stay in an Audience. It
 *                                                cannot be set to more than 540 days.
 * @param int    $audienceFilterClausesClauseType Specifies whether this is an include or exclude filter clause.
 */
function update_audience_sample(
    string $audienceDisplayName,
    string $audienceDescription,
    int $audienceMembershipDurationDays,
    int $audienceFilterClausesClauseType
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $audienceFilterClause = (new AudienceFilterClause())
        ->setClauseType($audienceFilterClausesClauseType);
    $audienceFilterClauses = [$audienceFilterClause,];
    $audience = (new Audience())
        ->setDisplayName($audienceDisplayName)
        ->setDescription($audienceDescription)
        ->setMembershipDurationDays($audienceMembershipDurationDays)
        ->setFilterClauses($audienceFilterClauses);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var Audience $response */
        $response = $analyticsAdminServiceClient->updateAudience($audience, $updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $audienceDisplayName = '[DISPLAY_NAME]';
    $audienceDescription = '[DESCRIPTION]';
    $audienceMembershipDurationDays = 0;
    $audienceFilterClausesClauseType = AudienceClauseType::AUDIENCE_CLAUSE_TYPE_UNSPECIFIED;

    update_audience_sample(
        $audienceDisplayName,
        $audienceDescription,
        $audienceMembershipDurationDays,
        $audienceFilterClausesClauseType
    );
}

updateChannelGroup

Updates a ChannelGroup.

Parameters
NameDescription
channelGroup Google\Analytics\Admin\V1alpha\ChannelGroup

Required. The ChannelGroup to update. The resource's name field is used to identify the ChannelGroup to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\ChannelGroup
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ChannelGroup;
use Google\Analytics\Admin\V1alpha\ChannelGroupFilterExpression;
use Google\Analytics\Admin\V1alpha\GroupingRule;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * @param string $channelGroupDisplayName             The display name of the Channel Group. Max length of 80
 *                                                    characters.
 * @param string $channelGroupGroupingRuleDisplayName Customer defined display name for the channel.
 */
function update_channel_group_sample(
    string $channelGroupDisplayName,
    string $channelGroupGroupingRuleDisplayName
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $channelGroupGroupingRuleExpression = new ChannelGroupFilterExpression();
    $groupingRule = (new GroupingRule())
        ->setDisplayName($channelGroupGroupingRuleDisplayName)
        ->setExpression($channelGroupGroupingRuleExpression);
    $channelGroupGroupingRule = [$groupingRule,];
    $channelGroup = (new ChannelGroup())
        ->setDisplayName($channelGroupDisplayName)
        ->setGroupingRule($channelGroupGroupingRule);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var ChannelGroup $response */
        $response = $analyticsAdminServiceClient->updateChannelGroup($channelGroup, $updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $channelGroupDisplayName = '[DISPLAY_NAME]';
    $channelGroupGroupingRuleDisplayName = '[DISPLAY_NAME]';

    update_channel_group_sample($channelGroupDisplayName, $channelGroupGroupingRuleDisplayName);
}

updateConversionEvent

Updates a conversion event with the specified attributes.

Parameters
NameDescription
conversionEvent Google\Analytics\Admin\V1alpha\ConversionEvent

Required. The conversion event to update. The name field is used to identify the settings to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\ConversionEvent
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ConversionEvent;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_conversion_event_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $conversionEvent = new ConversionEvent();
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var ConversionEvent $response */
        $response = $analyticsAdminServiceClient->updateConversionEvent($conversionEvent, $updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateCustomDimension

Updates a CustomDimension on a property.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. The list of fields to be updated. Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.

optionalArgs array

Optional.

↳ customDimension CustomDimension

The CustomDimension to update

↳ 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\V1alpha\CustomDimension
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\CustomDimension;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_custom_dimension_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var CustomDimension $response */
        $response = $analyticsAdminServiceClient->updateCustomDimension($updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateCustomMetric

Updates a CustomMetric on a property.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. The list of fields to be updated. Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.

optionalArgs array

Optional.

↳ customMetric CustomMetric

The CustomMetric to update

↳ 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\V1alpha\CustomMetric
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\CustomMetric;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_custom_metric_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var CustomMetric $response */
        $response = $analyticsAdminServiceClient->updateCustomMetric($updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateDataRedactionSettings

Updates a DataRedactionSettings on a property.

Parameters
NameDescription
dataRedactionSettings Google\Analytics\Admin\V1alpha\DataRedactionSettings

Required. The settings to update. The name field is used to identify the settings to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\DataRedactionSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DataRedactionSettings;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_data_redaction_settings_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $dataRedactionSettings = new DataRedactionSettings();
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var DataRedactionSettings $response */
        $response = $analyticsAdminServiceClient->updateDataRedactionSettings(
            $dataRedactionSettings,
            $updateMask
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateDataRetentionSettings

Updates the singleton data retention settings for this property.

Parameters
NameDescription
dataRetentionSettings Google\Analytics\Admin\V1alpha\DataRetentionSettings

Required. The settings to update. The name field is used to identify the settings to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\DataRetentionSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DataRetentionSettings;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_data_retention_settings_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $dataRetentionSettings = new DataRetentionSettings();
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var DataRetentionSettings $response */
        $response = $analyticsAdminServiceClient->updateDataRetentionSettings(
            $dataRetentionSettings,
            $updateMask
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateDataStream

Updates a DataStream on a property.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. The list of fields to be updated. Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.

optionalArgs array

Optional.

↳ dataStream DataStream

The DataStream to update

↳ 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\V1alpha\DataStream
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DataStream;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_data_stream_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var DataStream $response */
        $response = $analyticsAdminServiceClient->updateDataStream($updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

Updates a DisplayVideo360AdvertiserLink on a property.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. The list of fields to be updated. Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.

optionalArgs array

Optional.

↳ displayVideo360AdvertiserLink DisplayVideo360AdvertiserLink

The DisplayVideo360AdvertiserLink to update

↳ 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\V1alpha\DisplayVideo360AdvertiserLink
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\DisplayVideo360AdvertiserLink;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_display_video360_advertiser_link_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var DisplayVideo360AdvertiserLink $response */
        $response = $analyticsAdminServiceClient->updateDisplayVideo360AdvertiserLink($updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateEnhancedMeasurementSettings

Updates the enhanced measurement settings for this data stream.

Note that the stream must enable enhanced measurement for these settings to take effect.

Parameters
NameDescription
enhancedMeasurementSettings Google\Analytics\Admin\V1alpha\EnhancedMeasurementSettings

Required. The settings to update. The name field is used to identify the settings to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\EnhancedMeasurementSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\EnhancedMeasurementSettings;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * @param string $enhancedMeasurementSettingsSearchQueryParameter URL query parameters to interpret as site search parameters.
 *                                                                Max length is 1024 characters. Must not be empty.
 */
function update_enhanced_measurement_settings_sample(
    string $enhancedMeasurementSettingsSearchQueryParameter
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $enhancedMeasurementSettings = (new EnhancedMeasurementSettings())
        ->setSearchQueryParameter($enhancedMeasurementSettingsSearchQueryParameter);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var EnhancedMeasurementSettings $response */
        $response = $analyticsAdminServiceClient->updateEnhancedMeasurementSettings(
            $enhancedMeasurementSettings,
            $updateMask
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $enhancedMeasurementSettingsSearchQueryParameter = '[SEARCH_QUERY_PARAMETER]';

    update_enhanced_measurement_settings_sample($enhancedMeasurementSettingsSearchQueryParameter);
}

updateEventCreateRule

Updates an EventCreateRule.

Parameters
NameDescription
eventCreateRule Google\Analytics\Admin\V1alpha\EventCreateRule

Required. The EventCreateRule to update. The resource's name field is used to identify the EventCreateRule to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\EventCreateRule
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\EventCreateRule;
use Google\Analytics\Admin\V1alpha\MatchingCondition;
use Google\Analytics\Admin\V1alpha\MatchingCondition\ComparisonType;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * @param string $eventCreateRuleDestinationEvent              The name of the new event to be created.
 *
 *                                                             This value must:
 *                                                             * be less than 40 characters
 *                                                             * consist only of letters, digits or _ (underscores)
 *                                                             * start with a letter
 * @param string $eventCreateRuleEventConditionsField          The name of the field that is compared against for the condition.
 *                                                             If 'event_name' is specified this condition will apply to the name of the
 *                                                             event.  Otherwise the condition will apply to a parameter with the
 *                                                             specified name.
 *
 *                                                             This value cannot contain spaces.
 * @param int    $eventCreateRuleEventConditionsComparisonType The type of comparison to be applied to the value.
 * @param string $eventCreateRuleEventConditionsValue          The value being compared against for this condition.  The runtime
 *                                                             implementation may perform type coercion of this value to evaluate this
 *                                                             condition based on the type of the parameter value.
 */
function update_event_create_rule_sample(
    string $eventCreateRuleDestinationEvent,
    string $eventCreateRuleEventConditionsField,
    int $eventCreateRuleEventConditionsComparisonType,
    string $eventCreateRuleEventConditionsValue
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $matchingCondition = (new MatchingCondition())
        ->setField($eventCreateRuleEventConditionsField)
        ->setComparisonType($eventCreateRuleEventConditionsComparisonType)
        ->setValue($eventCreateRuleEventConditionsValue);
    $eventCreateRuleEventConditions = [$matchingCondition,];
    $eventCreateRule = (new EventCreateRule())
        ->setDestinationEvent($eventCreateRuleDestinationEvent)
        ->setEventConditions($eventCreateRuleEventConditions);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var EventCreateRule $response */
        $response = $analyticsAdminServiceClient->updateEventCreateRule($eventCreateRule, $updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $eventCreateRuleDestinationEvent = '[DESTINATION_EVENT]';
    $eventCreateRuleEventConditionsField = '[FIELD]';
    $eventCreateRuleEventConditionsComparisonType = ComparisonType::COMPARISON_TYPE_UNSPECIFIED;
    $eventCreateRuleEventConditionsValue = '[VALUE]';

    update_event_create_rule_sample(
        $eventCreateRuleDestinationEvent,
        $eventCreateRuleEventConditionsField,
        $eventCreateRuleEventConditionsComparisonType,
        $eventCreateRuleEventConditionsValue
    );
}

updateExpandedDataSet

Updates a ExpandedDataSet on a property.

Parameters
NameDescription
expandedDataSet Google\Analytics\Admin\V1alpha\ExpandedDataSet

Required. The ExpandedDataSet to update. The resource's name field is used to identify the ExpandedDataSet to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\ExpandedDataSet
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\ExpandedDataSet;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * @param string $expandedDataSetDisplayName The display name of the ExpandedDataSet.
 *                                           Max 200 chars.
 */
function update_expanded_data_set_sample(string $expandedDataSetDisplayName): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $expandedDataSet = (new ExpandedDataSet())
        ->setDisplayName($expandedDataSetDisplayName);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var ExpandedDataSet $response */
        $response = $analyticsAdminServiceClient->updateExpandedDataSet($expandedDataSet, $updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $expandedDataSetDisplayName = '[DISPLAY_NAME]';

    update_expanded_data_set_sample($expandedDataSetDisplayName);
}

Updates a GoogleAdsLink on a property

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

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.

optionalArgs array

Optional.

↳ googleAdsLink GoogleAdsLink

The GoogleAdsLink to update

↳ 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\V1alpha\GoogleAdsLink
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\GoogleAdsLink;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_google_ads_link_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var GoogleAdsLink $response */
        $response = $analyticsAdminServiceClient->updateGoogleAdsLink($updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateGoogleSignalsSettings

Updates Google Signals settings for a property.

Parameters
NameDescription
googleSignalsSettings Google\Analytics\Admin\V1alpha\GoogleSignalsSettings

Required. The settings to update. The name field is used to identify the settings to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\GoogleSignalsSettings
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\GoogleSignalsSettings;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_google_signals_settings_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $googleSignalsSettings = new GoogleSignalsSettings();
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var GoogleSignalsSettings $response */
        $response = $analyticsAdminServiceClient->updateGoogleSignalsSettings(
            $googleSignalsSettings,
            $updateMask
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateMeasurementProtocolSecret

Updates a measurement protocol secret.

Parameters
NameDescription
measurementProtocolSecret Google\Analytics\Admin\V1alpha\MeasurementProtocolSecret

Required. The measurement protocol secret to update.

updateMask Google\Protobuf\FieldMask

Required. The list of fields to be updated. Omitted fields will not be updated.

optionalArgs 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\V1alpha\MeasurementProtocolSecret
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\MeasurementProtocolSecret;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * @param string $measurementProtocolSecretDisplayName Human-readable display name for this secret.
 */
function update_measurement_protocol_secret_sample(
    string $measurementProtocolSecretDisplayName
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $measurementProtocolSecret = (new MeasurementProtocolSecret())
        ->setDisplayName($measurementProtocolSecretDisplayName);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var MeasurementProtocolSecret $response */
        $response = $analyticsAdminServiceClient->updateMeasurementProtocolSecret(
            $measurementProtocolSecret,
            $updateMask
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $measurementProtocolSecretDisplayName = '[DISPLAY_NAME]';

    update_measurement_protocol_secret_sample($measurementProtocolSecretDisplayName);
}

updateProperty

Updates a property.

Parameters
NameDescription
property Google\Analytics\Admin\V1alpha\Property

Required. The property to update. The property's name field is used to identify the property to be updated.

updateMask Google\Protobuf\FieldMask

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.

optionalArgs 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\V1alpha\Property
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\Property;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * @param string $propertyDisplayName Human-readable display name for this property.
 *
 *                                    The max allowed display name length is 100 UTF-16 code units.
 * @param string $propertyTimeZone    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"
 */
function update_property_sample(string $propertyDisplayName, string $propertyTimeZone): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $property = (new Property())
        ->setDisplayName($propertyDisplayName)
        ->setTimeZone($propertyTimeZone);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var Property $response */
        $response = $analyticsAdminServiceClient->updateProperty($property, $updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $propertyDisplayName = '[DISPLAY_NAME]';
    $propertyTimeZone = '[TIME_ZONE]';

    update_property_sample($propertyDisplayName, $propertyTimeZone);
}

updateSKAdNetworkConversionValueSchema

Updates a SKAdNetworkConversionValueSchema.

Parameters
NameDescription
skadnetworkConversionValueSchema Google\Analytics\Admin\V1alpha\SKAdNetworkConversionValueSchema

Required. SKAdNetwork conversion value schema to update.

updateMask Google\Protobuf\FieldMask

Required. The list of fields to be updated. Omitted fields will not be updated.

optionalArgs 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\V1alpha\SKAdNetworkConversionValueSchema
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\PostbackWindow;
use Google\Analytics\Admin\V1alpha\SKAdNetworkConversionValueSchema;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_sk_ad_network_conversion_value_schema_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $skadnetworkConversionValueSchemaPostbackWindowOne = new PostbackWindow();
    $skadnetworkConversionValueSchema = (new SKAdNetworkConversionValueSchema())
        ->setPostbackWindowOne($skadnetworkConversionValueSchemaPostbackWindowOne);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var SKAdNetworkConversionValueSchema $response */
        $response = $analyticsAdminServiceClient->updateSKAdNetworkConversionValueSchema(
            $skadnetworkConversionValueSchema,
            $updateMask
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

Updates a SearchAds360Link on a property.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. The list of fields to be updated. Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.

optionalArgs array

Optional.

↳ searchAds360Link SearchAds360Link

The SearchAds360Link to update

↳ 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\V1alpha\SearchAds360Link
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SearchAds360Link;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_search_ads360_link_sample(): void
{
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var SearchAds360Link $response */
        $response = $analyticsAdminServiceClient->updateSearchAds360Link($updateMask);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateSubpropertyEventFilter

Updates a subproperty Event Filter.

Parameters
NameDescription
subpropertyEventFilter Google\Analytics\Admin\V1alpha\SubpropertyEventFilter

Required. The subproperty event filter to update.

updateMask Google\Protobuf\FieldMask

Required. The list of fields to update. Field names must be in snake case (for example, "field_to_update"). Omitted fields will not be updated. To replace the entire entity, use one path with the string "*" to match all fields.

optionalArgs 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\V1alpha\SubpropertyEventFilter
Example
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1alpha\SubpropertyEventFilter;
use Google\Analytics\Admin\V1alpha\SubpropertyEventFilterClause;
use Google\Analytics\Admin\V1alpha\SubpropertyEventFilterClause\FilterClauseType;
use Google\Analytics\Admin\V1alpha\SubpropertyEventFilterExpression;
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;

/**
 * @param int $subpropertyEventFilterFilterClausesFilterClauseType The type for the filter clause.
 */
function update_subproperty_event_filter_sample(
    int $subpropertyEventFilterFilterClausesFilterClauseType
): void {
    // Create a client.
    $analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $subpropertyEventFilterFilterClausesFilterExpression = new SubpropertyEventFilterExpression();
    $subpropertyEventFilterClause = (new SubpropertyEventFilterClause())
        ->setFilterClauseType($subpropertyEventFilterFilterClausesFilterClauseType)
        ->setFilterExpression($subpropertyEventFilterFilterClausesFilterExpression);
    $subpropertyEventFilterFilterClauses = [$subpropertyEventFilterClause,];
    $subpropertyEventFilter = (new SubpropertyEventFilter())
        ->setFilterClauses($subpropertyEventFilterFilterClauses);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var SubpropertyEventFilter $response */
        $response = $analyticsAdminServiceClient->updateSubpropertyEventFilter(
            $subpropertyEventFilter,
            $updateMask
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $subpropertyEventFilterFilterClausesFilterClauseType = FilterClauseType::FILTER_CLAUSE_TYPE_UNSPECIFIED;

    update_subproperty_event_filter_sample($subpropertyEventFilterFilterClausesFilterClauseType);
}

static::accessBindingName

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

Parameters
NameDescription
account string
accessBinding string
Returns
TypeDescription
stringThe formatted access_binding resource.

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::accountAccessBindingName

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

Parameters
NameDescription
account string
accessBinding string
Returns
TypeDescription
stringThe formatted account_access_binding resource.

static::adSenseLinkName

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

Parameters
NameDescription
property string
adsenseLink string
Returns
TypeDescription
stringThe formatted ad_sense_link resource.

static::attributionSettingsName

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

Parameter
NameDescription
property string
Returns
TypeDescription
stringThe formatted attribution_settings resource.

static::audienceName

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

Parameters
NameDescription
property string
audience string
Returns
TypeDescription
stringThe formatted audience resource.

static::bigQueryLinkName

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

Parameters
NameDescription
property string
bigqueryLink string
Returns
TypeDescription
stringThe formatted big_query_link resource.

static::channelGroupName

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

Parameters
NameDescription
property string
channelGroup string
Returns
TypeDescription
stringThe formatted channel_group 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::dataRedactionSettingsName

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

Parameters
NameDescription
property string
dataStream string
Returns
TypeDescription
stringThe formatted data_redaction_settings 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::displayVideo360AdvertiserLinkName

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

Parameters
NameDescription
property string
displayVideo360AdvertiserLink string
Returns
TypeDescription
stringThe formatted display_video360_advertiser_link resource.

static::displayVideo360AdvertiserLinkProposalName

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

Parameters
NameDescription
property string
displayVideo360AdvertiserLinkProposal string
Returns
TypeDescription
stringThe formatted display_video360_advertiser_link_proposal resource.

static::enhancedMeasurementSettingsName

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

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

static::eventCreateRuleName

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

Parameters
NameDescription
property string
dataStream string
eventCreateRule string
Returns
TypeDescription
stringThe formatted event_create_rule resource.

static::expandedDataSetName

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

Parameters
NameDescription
property string
expandedDataSet string
Returns
TypeDescription
stringThe formatted expanded_data_set 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::globalSiteTagName

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

Parameters
NameDescription
property string
dataStream string
Returns
TypeDescription
stringThe formatted global_site_tag 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::googleSignalsSettingsName

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

Parameter
NameDescription
property string
Returns
TypeDescription
stringThe formatted google_signals_settings 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::propertyAccessBindingName

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

Parameters
NameDescription
property string
accessBinding string
Returns
TypeDescription
stringThe formatted property_access_binding resource.

static::rollupPropertySourceLinkName

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

Parameters
NameDescription
property string
rollupPropertySourceLink string
Returns
TypeDescription
stringThe formatted rollup_property_source_link resource.

static::sKAdNetworkConversionValueSchemaName

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

Parameters
NameDescription
property string
dataStream string
skadnetworkConversionValueSchema string
Returns
TypeDescription
stringThe formatted sk_ad_network_conversion_value_schema resource.

static::searchAds360LinkName

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

Parameters
NameDescription
property string
searchAds360Link string
Returns
TypeDescription
stringThe formatted search_ads360_link resource.

static::subpropertyEventFilterName

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

Parameters
NameDescription
property string
subPropertyEventFilter string
Returns
TypeDescription
stringThe formatted subproperty_event_filter 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

  • accessBinding: accounts/{account}/accessBindings/{access_binding}
  • account: accounts/{account}
  • accountAccessBinding: accounts/{account}/accessBindings/{access_binding}
  • adSenseLink: properties/{property}/adSenseLinks/{adsense_link}
  • attributionSettings: properties/{property}/attributionSettings
  • audience: properties/{property}/audiences/{audience}
  • bigQueryLink: properties/{property}/bigQueryLinks/{bigquery_link}
  • channelGroup: properties/{property}/channelGroups/{channel_group}
  • conversionEvent: properties/{property}/conversionEvents/{conversion_event}
  • customDimension: properties/{property}/customDimensions/{custom_dimension}
  • customMetric: properties/{property}/customMetrics/{custom_metric}
  • dataRedactionSettings: properties/{property}/dataStreams/{data_stream}/dataRedactionSettings
  • dataRetentionSettings: properties/{property}/dataRetentionSettings
  • dataSharingSettings: accounts/{account}/dataSharingSettings
  • dataStream: properties/{property}/dataStreams/{data_stream}
  • displayVideo360AdvertiserLink: properties/{property}/displayVideo360AdvertiserLinks/{display_video_360_advertiser_link}
  • displayVideo360AdvertiserLinkProposal: properties/{property}/displayVideo360AdvertiserLinkProposals/{display_video_360_advertiser_link_proposal}
  • enhancedMeasurementSettings: properties/{property}/dataStreams/{data_stream}/enhancedMeasurementSettings
  • eventCreateRule: properties/{property}/dataStreams/{data_stream}/eventCreateRules/{event_create_rule}
  • expandedDataSet: properties/{property}/expandedDataSets/{expanded_data_set}
  • firebaseLink: properties/{property}/firebaseLinks/{firebase_link}
  • globalSiteTag: properties/{property}/dataStreams/{data_stream}/globalSiteTag
  • googleAdsLink: properties/{property}/googleAdsLinks/{google_ads_link}
  • googleSignalsSettings: properties/{property}/googleSignalsSettings
  • measurementProtocolSecret: properties/{property}/dataStreams/{data_stream}/measurementProtocolSecrets/{measurement_protocol_secret}
  • property: properties/{property}
  • propertyAccessBinding: properties/{property}/accessBindings/{access_binding}
  • rollupPropertySourceLink: properties/{property}/rollupPropertySourceLinks/{rollup_property_source_link}
  • sKAdNetworkConversionValueSchema: properties/{property}/dataStreams/{data_stream}/sKAdNetworkConversionValueSchema/{skadnetwork_conversion_value_schema}
  • searchAds360Link: properties/{property}/searchAds360Links/{search_ads_360_link}
  • subpropertyEventFilter: properties/{property}/subpropertyEventFilters/{sub_property_event_filter}

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.

Constants

SERVICE_NAME

Value: 'google.analytics.admin.v1alpha.AnalyticsAdminService'

The name of the service.

SERVICE_ADDRESS

Value: 'analyticsadmin.googleapis.com'

The default address of the service.

DEFAULT_SERVICE_PORT

Value: 443

The default port of the service.

CODEGEN_NAME

Value: 'gapic'

The name of the code generator, to be included in the agent header.