target.apidocs.com.google.api.services.analytics.model.Experiment.html Maven / Gradle / Ivy
Experiment (Google Analytics API v3-rev20190604-1.30.1)
com.google.api.services.analytics.model
Class Experiment
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.services.analytics.model.Experiment
-
public final class Experiment
extends GenericJson
JSON template for Analytics experiment resource.
This is the Java data model class that specifies how to parse/serialize into the JSON that is
transmitted over HTTP when working with the Google Analytics API. For a detailed explanation see:
https://developers.google.com/api-client-library/java/google-http-java-client/json
- Author:
- Google, Inc.
-
-
Nested Class Summary
Nested Classes
Modifier and Type
Class and Description
static class
Experiment.ParentLink
Parent link for an experiment.
static class
Experiment.Variations
Model definition for ExperimentVariations.
-
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
GenericData.Flags
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
-
Constructor Summary
Constructors
Constructor and Description
Experiment()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
Experiment
clone()
String
getAccountId()
Account ID to which this experiment belongs.
DateTime
getCreated()
Time the experiment was created.
String
getDescription()
Notes about this experiment.
Boolean
getEditableInGaUi()
If true, the end user will be able to edit the experiment via the Google Analytics user
interface.
DateTime
getEndTime()
The ending time of the experiment (the time the status changed from RUNNING to ENDED).
Boolean
getEqualWeighting()
Boolean specifying whether to distribute traffic evenly across all variations.
String
getId()
Experiment ID.
String
getInternalWebPropertyId()
Internal ID for the web property to which this experiment belongs.
String
getKind()
Resource type for an Analytics experiment.
Integer
getMinimumExperimentLengthInDays()
An integer number in [3, 90].
String
getName()
Experiment name.
String
getObjectiveMetric()
The metric that the experiment is optimizing.
String
getOptimizationType()
Whether the objectiveMetric should be minimized or maximized.
Experiment.ParentLink
getParentLink()
Parent link for an experiment.
String
getProfileId()
View (Profile) ID to which this experiment belongs.
String
getReasonExperimentEnded()
Why the experiment ended.
Boolean
getRewriteVariationUrlsAsOriginal()
Boolean specifying whether variations URLS are rewritten to match those of the original.
String
getSelfLink()
Link for this experiment.
String
getServingFramework()
The framework used to serve the experiment variations and evaluate the results.
String
getSnippet()
The snippet of code to include on the control page(s).
DateTime
getStartTime()
The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING).
String
getStatus()
Experiment status.
Double
getTrafficCoverage()
A floating-point number in (0, 1].
DateTime
getUpdated()
Time the experiment was last modified.
List<Experiment.Variations>
getVariations()
Array of variations.
String
getWebPropertyId()
Web property ID to which this experiment belongs.
Double
getWinnerConfidenceLevel()
A floating-point number in (0, 1).
Boolean
getWinnerFound()
Boolean specifying whether a winner has been found for this experiment.
Experiment
set(String fieldName,
Object value)
Experiment
setAccountId(String accountId)
Account ID to which this experiment belongs.
Experiment
setCreated(DateTime created)
Time the experiment was created.
Experiment
setDescription(String description)
Notes about this experiment.
Experiment
setEditableInGaUi(Boolean editableInGaUi)
If true, the end user will be able to edit the experiment via the Google Analytics user
interface.
Experiment
setEndTime(DateTime endTime)
The ending time of the experiment (the time the status changed from RUNNING to ENDED).
Experiment
setEqualWeighting(Boolean equalWeighting)
Boolean specifying whether to distribute traffic evenly across all variations.
Experiment
setId(String id)
Experiment ID.
Experiment
setInternalWebPropertyId(String internalWebPropertyId)
Internal ID for the web property to which this experiment belongs.
Experiment
setKind(String kind)
Resource type for an Analytics experiment.
Experiment
setMinimumExperimentLengthInDays(Integer minimumExperimentLengthInDays)
An integer number in [3, 90].
Experiment
setName(String name)
Experiment name.
Experiment
setObjectiveMetric(String objectiveMetric)
The metric that the experiment is optimizing.
Experiment
setOptimizationType(String optimizationType)
Whether the objectiveMetric should be minimized or maximized.
Experiment
setParentLink(Experiment.ParentLink parentLink)
Parent link for an experiment.
Experiment
setProfileId(String profileId)
View (Profile) ID to which this experiment belongs.
Experiment
setReasonExperimentEnded(String reasonExperimentEnded)
Why the experiment ended.
Experiment
setRewriteVariationUrlsAsOriginal(Boolean rewriteVariationUrlsAsOriginal)
Boolean specifying whether variations URLS are rewritten to match those of the original.
Experiment
setSelfLink(String selfLink)
Link for this experiment.
Experiment
setServingFramework(String servingFramework)
The framework used to serve the experiment variations and evaluate the results.
Experiment
setSnippet(String snippet)
The snippet of code to include on the control page(s).
Experiment
setStartTime(DateTime startTime)
The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING).
Experiment
setStatus(String status)
Experiment status.
Experiment
setTrafficCoverage(Double trafficCoverage)
A floating-point number in (0, 1].
Experiment
setUpdated(DateTime updated)
Time the experiment was last modified.
Experiment
setVariations(List<Experiment.Variations> variations)
Array of variations.
Experiment
setWebPropertyId(String webPropertyId)
Web property ID to which this experiment belongs.
Experiment
setWinnerConfidenceLevel(Double winnerConfidenceLevel)
A floating-point number in (0, 1).
Experiment
setWinnerFound(Boolean winnerFound)
Boolean specifying whether a winner has been found for this experiment.
-
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
-
Methods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
-
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
Method Detail
-
getAccountId
public String getAccountId()
Account ID to which this experiment belongs. This field is read-only.
- Returns:
- value or
null
for none
-
setAccountId
public Experiment setAccountId(String accountId)
Account ID to which this experiment belongs. This field is read-only.
- Parameters:
accountId
- accountId or null
for none
-
getCreated
public DateTime getCreated()
Time the experiment was created. This field is read-only.
- Returns:
- value or
null
for none
-
setCreated
public Experiment setCreated(DateTime created)
Time the experiment was created. This field is read-only.
- Parameters:
created
- created or null
for none
-
getDescription
public String getDescription()
Notes about this experiment.
- Returns:
- value or
null
for none
-
setDescription
public Experiment setDescription(String description)
Notes about this experiment.
- Parameters:
description
- description or null
for none
-
getEditableInGaUi
public Boolean getEditableInGaUi()
If true, the end user will be able to edit the experiment via the Google Analytics user
interface.
- Returns:
- value or
null
for none
-
setEditableInGaUi
public Experiment setEditableInGaUi(Boolean editableInGaUi)
If true, the end user will be able to edit the experiment via the Google Analytics user
interface.
- Parameters:
editableInGaUi
- editableInGaUi or null
for none
-
getEndTime
public DateTime getEndTime()
The ending time of the experiment (the time the status changed from RUNNING to ENDED). This
field is present only if the experiment has ended. This field is read-only.
- Returns:
- value or
null
for none
-
setEndTime
public Experiment setEndTime(DateTime endTime)
The ending time of the experiment (the time the status changed from RUNNING to ENDED). This
field is present only if the experiment has ended. This field is read-only.
- Parameters:
endTime
- endTime or null
for none
-
getEqualWeighting
public Boolean getEqualWeighting()
Boolean specifying whether to distribute traffic evenly across all variations. If the value is
False, content experiments follows the default behavior of adjusting traffic dynamically based
on variation performance. Optional -- defaults to False. This field may not be changed for an
experiment whose status is ENDED.
- Returns:
- value or
null
for none
-
setEqualWeighting
public Experiment setEqualWeighting(Boolean equalWeighting)
Boolean specifying whether to distribute traffic evenly across all variations. If the value is
False, content experiments follows the default behavior of adjusting traffic dynamically based
on variation performance. Optional -- defaults to False. This field may not be changed for an
experiment whose status is ENDED.
- Parameters:
equalWeighting
- equalWeighting or null
for none
-
getId
public String getId()
Experiment ID. Required for patch and update. Disallowed for create.
- Returns:
- value or
null
for none
-
setId
public Experiment setId(String id)
Experiment ID. Required for patch and update. Disallowed for create.
- Parameters:
id
- id or null
for none
-
getInternalWebPropertyId
public String getInternalWebPropertyId()
Internal ID for the web property to which this experiment belongs. This field is read-only.
- Returns:
- value or
null
for none
-
setInternalWebPropertyId
public Experiment setInternalWebPropertyId(String internalWebPropertyId)
Internal ID for the web property to which this experiment belongs. This field is read-only.
- Parameters:
internalWebPropertyId
- internalWebPropertyId or null
for none
-
getKind
public String getKind()
Resource type for an Analytics experiment. This field is read-only.
- Returns:
- value or
null
for none
-
setKind
public Experiment setKind(String kind)
Resource type for an Analytics experiment. This field is read-only.
- Parameters:
kind
- kind or null
for none
-
getMinimumExperimentLengthInDays
public Integer getMinimumExperimentLengthInDays()
An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed
for a running experiment. This field may not be changed for an experiments whose status is
ENDED.
- Returns:
- value or
null
for none
-
setMinimumExperimentLengthInDays
public Experiment setMinimumExperimentLengthInDays(Integer minimumExperimentLengthInDays)
An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed
for a running experiment. This field may not be changed for an experiments whose status is
ENDED.
- Parameters:
minimumExperimentLengthInDays
- minimumExperimentLengthInDays or null
for none
-
getName
public String getName()
Experiment name. This field may not be changed for an experiment whose status is ENDED. This
field is required when creating an experiment.
- Returns:
- value or
null
for none
-
setName
public Experiment setName(String name)
Experiment name. This field may not be changed for an experiment whose status is ENDED. This
field is required when creating an experiment.
- Parameters:
name
- name or null
for none
-
getObjectiveMetric
public String getObjectiveMetric()
The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions",
"ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces",
"ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is
required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
- Returns:
- value or
null
for none
-
setObjectiveMetric
public Experiment setObjectiveMetric(String objectiveMetric)
The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions",
"ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces",
"ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is
required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
- Parameters:
objectiveMetric
- objectiveMetric or null
for none
-
getOptimizationType
public String getOptimizationType()
Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM",
"MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot
be modified when status is "RUNNING" or "ENDED".
- Returns:
- value or
null
for none
-
setOptimizationType
public Experiment setOptimizationType(String optimizationType)
Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM",
"MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot
be modified when status is "RUNNING" or "ENDED".
- Parameters:
optimizationType
- optimizationType or null
for none
-
getParentLink
public Experiment.ParentLink getParentLink()
Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
- Returns:
- value or
null
for none
-
setParentLink
public Experiment setParentLink(Experiment.ParentLink parentLink)
Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
- Parameters:
parentLink
- parentLink or null
for none
-
getProfileId
public String getProfileId()
View (Profile) ID to which this experiment belongs. This field is read-only.
- Returns:
- value or
null
for none
-
setProfileId
public Experiment setProfileId(String profileId)
View (Profile) ID to which this experiment belongs. This field is read-only.
- Parameters:
profileId
- profileId or null
for none
-
getReasonExperimentEnded
public String getReasonExperimentEnded()
Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND",
"EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER"
means that the experiment didn't expire but no winner was projected to be found. If the
experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This
field is read-only.
- Returns:
- value or
null
for none
-
setReasonExperimentEnded
public Experiment setReasonExperimentEnded(String reasonExperimentEnded)
Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND",
"EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER"
means that the experiment didn't expire but no winner was projected to be found. If the
experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This
field is read-only.
- Parameters:
reasonExperimentEnded
- reasonExperimentEnded or null
for none
-
getRewriteVariationUrlsAsOriginal
public Boolean getRewriteVariationUrlsAsOriginal()
Boolean specifying whether variations URLS are rewritten to match those of the original. This
field may not be changed for an experiments whose status is ENDED.
- Returns:
- value or
null
for none
-
setRewriteVariationUrlsAsOriginal
public Experiment setRewriteVariationUrlsAsOriginal(Boolean rewriteVariationUrlsAsOriginal)
Boolean specifying whether variations URLS are rewritten to match those of the original. This
field may not be changed for an experiments whose status is ENDED.
- Parameters:
rewriteVariationUrlsAsOriginal
- rewriteVariationUrlsAsOriginal or null
for none
-
getSelfLink
public String getSelfLink()
Link for this experiment. This field is read-only.
- Returns:
- value or
null
for none
-
setSelfLink
public Experiment setSelfLink(String selfLink)
Link for this experiment. This field is read-only.
- Parameters:
selfLink
- selfLink or null
for none
-
getServingFramework
public String getServingFramework()
The framework used to serve the experiment variations and evaluate the results. One of: -
REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen
variation and evaluates the results. - API: Google Analytics chooses and reports the variation
to serve and evaluates the results; the caller is responsible for serving the selected
variation. - EXTERNAL: The variations will be served externally and the chosen variation
reported to Google Analytics. The caller is responsible for serving the selected variation and
evaluating the results.
- Returns:
- value or
null
for none
-
setServingFramework
public Experiment setServingFramework(String servingFramework)
The framework used to serve the experiment variations and evaluate the results. One of: -
REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen
variation and evaluates the results. - API: Google Analytics chooses and reports the variation
to serve and evaluates the results; the caller is responsible for serving the selected
variation. - EXTERNAL: The variations will be served externally and the chosen variation
reported to Google Analytics. The caller is responsible for serving the selected variation and
evaluating the results.
- Parameters:
servingFramework
- servingFramework or null
for none
-
getSnippet
public String getSnippet()
The snippet of code to include on the control page(s). This field is read-only.
- Returns:
- value or
null
for none
-
setSnippet
public Experiment setSnippet(String snippet)
The snippet of code to include on the control page(s). This field is read-only.
- Parameters:
snippet
- snippet or null
for none
-
getStartTime
public DateTime getStartTime()
The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING).
This field is present only if the experiment has started. This field is read-only.
- Returns:
- value or
null
for none
-
setStartTime
public Experiment setStartTime(DateTime startTime)
The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING).
This field is present only if the experiment has started. This field is read-only.
- Parameters:
startTime
- startTime or null
for none
-
getStatus
public String getStatus()
Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments
can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when
creating an experiment.
- Returns:
- value or
null
for none
-
setStatus
public Experiment setStatus(String status)
Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments
can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when
creating an experiment.
- Parameters:
status
- status or null
for none
-
getTrafficCoverage
public Double getTrafficCoverage()
A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in
the experiment. Can be changed for a running experiment. This field may not be changed for an
experiments whose status is ENDED.
- Returns:
- value or
null
for none
-
setTrafficCoverage
public Experiment setTrafficCoverage(Double trafficCoverage)
A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in
the experiment. Can be changed for a running experiment. This field may not be changed for an
experiments whose status is ENDED.
- Parameters:
trafficCoverage
- trafficCoverage or null
for none
-
getUpdated
public DateTime getUpdated()
Time the experiment was last modified. This field is read-only.
- Returns:
- value or
null
for none
-
setUpdated
public Experiment setUpdated(DateTime updated)
Time the experiment was last modified. This field is read-only.
- Parameters:
updated
- updated or null
for none
-
getVariations
public List<Experiment.Variations> getVariations()
Array of variations. The first variation in the array is the original. The number of variations
may not change once an experiment is in the RUNNING state. At least two variations are required
before status can be set to RUNNING.
- Returns:
- value or
null
for none
-
setVariations
public Experiment setVariations(List<Experiment.Variations> variations)
Array of variations. The first variation in the array is the original. The number of variations
may not change once an experiment is in the RUNNING state. At least two variations are required
before status can be set to RUNNING.
- Parameters:
variations
- variations or null
for none
-
getWebPropertyId
public String getWebPropertyId()
Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-
YY. This field is read-only.
- Returns:
- value or
null
for none
-
setWebPropertyId
public Experiment setWebPropertyId(String webPropertyId)
Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-
YY. This field is read-only.
- Parameters:
webPropertyId
- webPropertyId or null
for none
-
getWinnerConfidenceLevel
public Double getWinnerConfidenceLevel()
A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner.
This field may not be changed for an experiments whose status is ENDED.
- Returns:
- value or
null
for none
-
setWinnerConfidenceLevel
public Experiment setWinnerConfidenceLevel(Double winnerConfidenceLevel)
A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner.
This field may not be changed for an experiments whose status is ENDED.
- Parameters:
winnerConfidenceLevel
- winnerConfidenceLevel or null
for none
-
getWinnerFound
public Boolean getWinnerFound()
Boolean specifying whether a winner has been found for this experiment. This field is read-
only.
- Returns:
- value or
null
for none
-
setWinnerFound
public Experiment setWinnerFound(Boolean winnerFound)
Boolean specifying whether a winner has been found for this experiment. This field is read-
only.
- Parameters:
winnerFound
- winnerFound or null
for none
-
set
public Experiment set(String fieldName,
Object value)
- Overrides:
set
in class GenericJson
-
clone
public Experiment clone()
- Overrides:
clone
in class GenericJson
Copyright © 2011–2019 Google. All rights reserved.