Caution: You are viewing documentation for the API's REST interface. Most of our official client libraries use gRPC. See the REST Introduction for details.

REST Resource: customers.campaignExperiments

Resource: CampaignExperiment

An A/B experiment that compares the performance of the base campaign (the control) and a variation of that campaign (the experiment).

JSON representation
{
  "resourceName": string,
  "trafficSplitType": enum (CampaignExperimentTrafficSplitType),
  "status": enum (CampaignExperimentStatus),
  "id": string,
  "campaignDraft": string,
  "name": string,
  "description": string,
  "trafficSplitPercent": string,
  "experimentCampaign": string,
  "longRunningOperation": string,
  "startDate": string,
  "endDate": string
}
Fields
resourceName

string

Immutable. The resource name of the campaign experiment. Campaign experiment resource names have the form:

customers/{customerId}/campaignExperiments/{campaign_experiment_id}

trafficSplitType

enum (CampaignExperimentTrafficSplitType)

Immutable. Determines the behavior of the traffic split.

status

enum (CampaignExperimentStatus)

Output only. The status of the campaign experiment. This field is read-only.

id

string (int64 format)

Output only. The ID of the campaign experiment.

This field is read-only.

campaignDraft

string

Immutable. The campaign draft with staged changes to the base campaign.

name

string

The name of the campaign experiment.

This field is required when creating new campaign experiments and must not conflict with the name of another non-removed campaign experiment or campaign.

It must not contain any null (code point 0x0), NL line feed (code point 0xA) or carriage return (code point 0xD) characters.

description

string

The description of the experiment.

trafficSplitPercent

string (int64 format)

Immutable. Share of traffic directed to experiment as a percent (must be between 1 and 99 inclusive. Base campaign receives the remainder of the traffic (100 - trafficSplitPercent). Required for create.

experimentCampaign

string

Output only. The experiment campaign, as opposed to the base campaign.

longRunningOperation

string

Output only. The resource name of the long-running operation that can be used to poll for completion of experiment create or promote. The most recent long running operation is returned.

startDate

string

Date when the campaign experiment starts. By default, the experiment starts now or on the campaign's start date, whichever is later. If this field is set, then the experiment starts at the beginning of the specified date in the customer's time zone. Cannot be changed once the experiment starts.

Format: YYYY-MM-DD Example: 2019-03-14

endDate

string

The last day of the campaign experiment. By default, the experiment ends on the campaign's end date. If this field is set, then the experiment ends at the end of the specified date in the customer's time zone.

Format: YYYY-MM-DD Example: 2019-04-18

CampaignExperimentTrafficSplitType

Enum of strategies for splitting traffic between base and experiment campaigns in campaign experiment.

Enums
UNSPECIFIED Not specified.
UNKNOWN Used for return value only. Represents value unknown in this version.
RANDOM_QUERY Traffic is randomly assigned to the base or experiment arm for each query, independent of previous assignments for the same user.
COOKIE Traffic is split using cookies to keep users in the same arm (base or experiment) of the experiment.

CampaignExperimentStatus

Possible statuses of a campaign experiment.

Enums
UNSPECIFIED The status has not been specified.
UNKNOWN Used for return value only. Represents value unknown in this version.
INITIALIZING The experiment campaign is being initialized.
INITIALIZATION_FAILED Initialization of the experiment campaign failed.
ENABLED The experiment campaign is fully initialized. The experiment is currently running, scheduled to run in the future or has ended based on its end date. An experiment with the status INITIALIZING will be updated to ENABLED when it is fully created.
GRADUATED The experiment campaign was graduated to a stand-alone campaign, existing independently of the experiment.
REMOVED The experiment is removed.
PROMOTING The experiment's changes are being applied to the original campaign. The long running operation returned by the promote method can be polled to see the status of the promotion.
PROMOTION_FAILED Promote of the experiment campaign failed.
PROMOTED The changes of the experiment are promoted to their original campaign.
ENDED_MANUALLY The experiment was ended manually. It did not end based on its end date.

Methods

create

Creates a campaign experiment based on a campaign draft.

end

Immediately ends a campaign experiment, changing the experiment's scheduled end date and without waiting for end of day.

get

Returns the requested campaign experiment in full detail.

graduate

Graduates a campaign experiment to a full campaign.

listAsyncErrors

Returns all errors that occurred during CampaignExperiment create or promote (whichever occurred last).

mutate

Updates campaign experiments.

promote

Promotes the changes in a experiment campaign back to the base campaign.