blob: 5f7936b07864ee10788f7a6471bd6becbedda74f [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="analytics_v3.html">Google Analytics API</a> . <a href="analytics_v3.management.html">management</a> . <a href="analytics_v3.management.experiments.html">experiments</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
John Asmuth614db982014-04-24 15:46:26 -040081 <code><a href="#delete">delete(accountId, webPropertyId, profileId, experimentId)</a></code></p>
82<p class="firstline">Delete an experiment.</p>
83<p class="toc_element">
84 <code><a href="#get">get(accountId, webPropertyId, profileId, experimentId)</a></code></p>
85<p class="firstline">Returns an experiment to which the user has access.</p>
86<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#insert">insert(accountId, webPropertyId, profileId, body=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040088<p class="firstline">Create a new experiment.</p>
89<p class="toc_element">
Yoshi Automation Botb6971b02020-11-26 17:16:03 -080090 <code><a href="#list">list(accountId, webPropertyId, profileId, max_results=None, start_index=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040091<p class="firstline">Lists experiments to which the user has access.</p>
92<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#patch">patch(accountId, webPropertyId, profileId, experimentId, body=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040094<p class="firstline">Update an existing experiment. This method supports patch semantics.</p>
95<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#update">update(accountId, webPropertyId, profileId, experimentId, body=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040097<p class="firstline">Update an existing experiment.</p>
98<h3>Method Details</h3>
99<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700100 <code class="details" id="close">close()</code>
101 <pre>Close httplib2 connections.</pre>
102</div>
103
104<div class="method">
John Asmuth614db982014-04-24 15:46:26 -0400105 <code class="details" id="delete">delete(accountId, webPropertyId, profileId, experimentId)</code>
106 <pre>Delete an experiment.
107
108Args:
109 accountId: string, Account ID to which the experiment belongs (required)
110 webPropertyId: string, Web property ID to which the experiment belongs (required)
111 profileId: string, View (Profile) ID to which the experiment belongs (required)
112 experimentId: string, ID of the experiment to delete (required)
113</pre>
114</div>
115
116<div class="method">
117 <code class="details" id="get">get(accountId, webPropertyId, profileId, experimentId)</code>
118 <pre>Returns an experiment to which the user has access.
119
120Args:
121 accountId: string, Account ID to retrieve the experiment for. (required)
122 webPropertyId: string, Web property ID to retrieve the experiment for. (required)
123 profileId: string, View (Profile) ID to retrieve the experiment for. (required)
124 experimentId: string, Experiment ID to retrieve the experiment for. (required)
125
126Returns:
127 An object of the form:
128
129 { # JSON template for Analytics experiment resource.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800130 &quot;parentLink&quot;: { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
131 &quot;type&quot;: &quot;analytics#profile&quot;, # Value is &quot;analytics#profile&quot;. This field is read-only.
132 &quot;href&quot;: &quot;A String&quot;, # Link to the view (profile) to which this experiment belongs. This field is read-only.
133 },
134 &quot;created&quot;: &quot;A String&quot;, # Time the experiment was created. This field is read-only.
135 &quot;variations&quot;: [ # 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.
136 {
137 &quot;name&quot;: &quot;A String&quot;, # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED.
138 &quot;url&quot;: &quot;A String&quot;, # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
139 &quot;weight&quot;: 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
140 &quot;status&quot;: &quot;A String&quot;, # Status of the variation. Possible values: &quot;ACTIVE&quot;, &quot;INACTIVE&quot;. INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
141 &quot;won&quot;: True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700142 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800143 ],
144 &quot;equalWeighting&quot;: True or False, # 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.
145 &quot;status&quot;: &quot;A String&quot;, # Experiment status. Possible values: &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot;, &quot;RUNNING&quot;, &quot;ENDED&quot;. Experiments can be created in the &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot; or &quot;RUNNING&quot; state. This field is required when creating an experiment.
146 &quot;servingFramework&quot;: &quot;A String&quot;, # The framework used to serve the experiment variations and evaluate the results. One of:
147 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
148 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
149 # - 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.
150 &quot;updated&quot;: &quot;A String&quot;, # Time the experiment was last modified. This field is read-only.
151 &quot;editableInGaUi&quot;: True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
152 &quot;winnerFound&quot;: True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
153 &quot;profileId&quot;: &quot;A String&quot;, # View (Profile) ID to which this experiment belongs. This field is read-only.
154 &quot;optimizationType&quot;: &quot;A String&quot;, # Whether the objectiveMetric should be minimized or maximized. Possible values: &quot;MAXIMUM&quot;, &quot;MINIMUM&quot;. Optional--defaults to &quot;MAXIMUM&quot;. Cannot be specified without objectiveMetric. Cannot be modified when status is &quot;RUNNING&quot; or &quot;ENDED&quot;.
155 &quot;name&quot;: &quot;A String&quot;, # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
156 &quot;kind&quot;: &quot;analytics#experiment&quot;, # Resource type for an Analytics experiment. This field is read-only.
157 &quot;selfLink&quot;: &quot;A String&quot;, # Link for this experiment. This field is read-only.
158 &quot;winnerConfidenceLevel&quot;: 3.14, # 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.
159 &quot;internalWebPropertyId&quot;: &quot;A String&quot;, # Internal ID for the web property to which this experiment belongs. This field is read-only.
160 &quot;endTime&quot;: &quot;A String&quot;, # 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.
161 &quot;minimumExperimentLengthInDays&quot;: 42, # 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.
162 &quot;rewriteVariationUrlsAsOriginal&quot;: True or False, # 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.
163 &quot;objectiveMetric&quot;: &quot;A String&quot;, # The metric that the experiment is optimizing. Valid values: &quot;ga:goal(n)Completions&quot;, &quot;ga:adsenseAdsClicks&quot;, &quot;ga:adsenseAdsViewed&quot;, &quot;ga:adsenseRevenue&quot;, &quot;ga:bounces&quot;, &quot;ga:pageviews&quot;, &quot;ga:sessionDuration&quot;, &quot;ga:transactions&quot;, &quot;ga:transactionRevenue&quot;. This field is required if status is &quot;RUNNING&quot; and servingFramework is one of &quot;REDIRECT&quot; or &quot;API&quot;.
164 &quot;trafficCoverage&quot;: 3.14, # 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.
165 &quot;startTime&quot;: &quot;A String&quot;, # 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.
166 &quot;snippet&quot;: &quot;A String&quot;, # The snippet of code to include on the control page(s). This field is read-only.
167 &quot;id&quot;: &quot;A String&quot;, # Experiment ID. Required for patch and update. Disallowed for create.
168 &quot;webPropertyId&quot;: &quot;A String&quot;, # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
169 &quot;reasonExperimentEnded&quot;: &quot;A String&quot;, # Why the experiment ended. Possible values: &quot;STOPPED_BY_USER&quot;, &quot;WINNER_FOUND&quot;, &quot;EXPERIMENT_EXPIRED&quot;, &quot;ENDED_WITH_NO_WINNER&quot;, &quot;GOAL_OBJECTIVE_CHANGED&quot;. &quot;ENDED_WITH_NO_WINNER&quot; means that the experiment didn&#x27;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.
170 &quot;description&quot;: &quot;A String&quot;, # Notes about this experiment.
171 &quot;accountId&quot;: &quot;A String&quot;, # Account ID to which this experiment belongs. This field is read-only.
172 }</pre>
John Asmuth614db982014-04-24 15:46:26 -0400173</div>
174
175<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700176 <code class="details" id="insert">insert(accountId, webPropertyId, profileId, body=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400177 <pre>Create a new experiment.
178
179Args:
180 accountId: string, Account ID to create the experiment for. (required)
181 webPropertyId: string, Web property ID to create the experiment for. (required)
182 profileId: string, View (Profile) ID to create the experiment for. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700183 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400184 The object takes the form of:
185
186{ # JSON template for Analytics experiment resource.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800187 &quot;parentLink&quot;: { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
188 &quot;type&quot;: &quot;analytics#profile&quot;, # Value is &quot;analytics#profile&quot;. This field is read-only.
189 &quot;href&quot;: &quot;A String&quot;, # Link to the view (profile) to which this experiment belongs. This field is read-only.
190 },
191 &quot;created&quot;: &quot;A String&quot;, # Time the experiment was created. This field is read-only.
192 &quot;variations&quot;: [ # 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.
193 {
194 &quot;name&quot;: &quot;A String&quot;, # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED.
195 &quot;url&quot;: &quot;A String&quot;, # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
196 &quot;weight&quot;: 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
197 &quot;status&quot;: &quot;A String&quot;, # Status of the variation. Possible values: &quot;ACTIVE&quot;, &quot;INACTIVE&quot;. INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
198 &quot;won&quot;: True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700199 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800200 ],
201 &quot;equalWeighting&quot;: True or False, # 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.
202 &quot;status&quot;: &quot;A String&quot;, # Experiment status. Possible values: &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot;, &quot;RUNNING&quot;, &quot;ENDED&quot;. Experiments can be created in the &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot; or &quot;RUNNING&quot; state. This field is required when creating an experiment.
203 &quot;servingFramework&quot;: &quot;A String&quot;, # The framework used to serve the experiment variations and evaluate the results. One of:
204 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
205 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
206 # - 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.
207 &quot;updated&quot;: &quot;A String&quot;, # Time the experiment was last modified. This field is read-only.
208 &quot;editableInGaUi&quot;: True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
209 &quot;winnerFound&quot;: True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
210 &quot;profileId&quot;: &quot;A String&quot;, # View (Profile) ID to which this experiment belongs. This field is read-only.
211 &quot;optimizationType&quot;: &quot;A String&quot;, # Whether the objectiveMetric should be minimized or maximized. Possible values: &quot;MAXIMUM&quot;, &quot;MINIMUM&quot;. Optional--defaults to &quot;MAXIMUM&quot;. Cannot be specified without objectiveMetric. Cannot be modified when status is &quot;RUNNING&quot; or &quot;ENDED&quot;.
212 &quot;name&quot;: &quot;A String&quot;, # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
213 &quot;kind&quot;: &quot;analytics#experiment&quot;, # Resource type for an Analytics experiment. This field is read-only.
214 &quot;selfLink&quot;: &quot;A String&quot;, # Link for this experiment. This field is read-only.
215 &quot;winnerConfidenceLevel&quot;: 3.14, # 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.
216 &quot;internalWebPropertyId&quot;: &quot;A String&quot;, # Internal ID for the web property to which this experiment belongs. This field is read-only.
217 &quot;endTime&quot;: &quot;A String&quot;, # 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.
218 &quot;minimumExperimentLengthInDays&quot;: 42, # 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.
219 &quot;rewriteVariationUrlsAsOriginal&quot;: True or False, # 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.
220 &quot;objectiveMetric&quot;: &quot;A String&quot;, # The metric that the experiment is optimizing. Valid values: &quot;ga:goal(n)Completions&quot;, &quot;ga:adsenseAdsClicks&quot;, &quot;ga:adsenseAdsViewed&quot;, &quot;ga:adsenseRevenue&quot;, &quot;ga:bounces&quot;, &quot;ga:pageviews&quot;, &quot;ga:sessionDuration&quot;, &quot;ga:transactions&quot;, &quot;ga:transactionRevenue&quot;. This field is required if status is &quot;RUNNING&quot; and servingFramework is one of &quot;REDIRECT&quot; or &quot;API&quot;.
221 &quot;trafficCoverage&quot;: 3.14, # 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.
222 &quot;startTime&quot;: &quot;A String&quot;, # 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.
223 &quot;snippet&quot;: &quot;A String&quot;, # The snippet of code to include on the control page(s). This field is read-only.
224 &quot;id&quot;: &quot;A String&quot;, # Experiment ID. Required for patch and update. Disallowed for create.
225 &quot;webPropertyId&quot;: &quot;A String&quot;, # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
226 &quot;reasonExperimentEnded&quot;: &quot;A String&quot;, # Why the experiment ended. Possible values: &quot;STOPPED_BY_USER&quot;, &quot;WINNER_FOUND&quot;, &quot;EXPERIMENT_EXPIRED&quot;, &quot;ENDED_WITH_NO_WINNER&quot;, &quot;GOAL_OBJECTIVE_CHANGED&quot;. &quot;ENDED_WITH_NO_WINNER&quot; means that the experiment didn&#x27;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.
227 &quot;description&quot;: &quot;A String&quot;, # Notes about this experiment.
228 &quot;accountId&quot;: &quot;A String&quot;, # Account ID to which this experiment belongs. This field is read-only.
229}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700230
231
232Returns:
233 An object of the form:
234
235 { # JSON template for Analytics experiment resource.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800236 &quot;parentLink&quot;: { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
237 &quot;type&quot;: &quot;analytics#profile&quot;, # Value is &quot;analytics#profile&quot;. This field is read-only.
238 &quot;href&quot;: &quot;A String&quot;, # Link to the view (profile) to which this experiment belongs. This field is read-only.
239 },
240 &quot;created&quot;: &quot;A String&quot;, # Time the experiment was created. This field is read-only.
241 &quot;variations&quot;: [ # 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.
242 {
243 &quot;name&quot;: &quot;A String&quot;, # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED.
244 &quot;url&quot;: &quot;A String&quot;, # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
245 &quot;weight&quot;: 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
246 &quot;status&quot;: &quot;A String&quot;, # Status of the variation. Possible values: &quot;ACTIVE&quot;, &quot;INACTIVE&quot;. INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
247 &quot;won&quot;: True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700248 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800249 ],
250 &quot;equalWeighting&quot;: True or False, # 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.
251 &quot;status&quot;: &quot;A String&quot;, # Experiment status. Possible values: &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot;, &quot;RUNNING&quot;, &quot;ENDED&quot;. Experiments can be created in the &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot; or &quot;RUNNING&quot; state. This field is required when creating an experiment.
252 &quot;servingFramework&quot;: &quot;A String&quot;, # The framework used to serve the experiment variations and evaluate the results. One of:
253 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
254 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
255 # - 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.
256 &quot;updated&quot;: &quot;A String&quot;, # Time the experiment was last modified. This field is read-only.
257 &quot;editableInGaUi&quot;: True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
258 &quot;winnerFound&quot;: True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
259 &quot;profileId&quot;: &quot;A String&quot;, # View (Profile) ID to which this experiment belongs. This field is read-only.
260 &quot;optimizationType&quot;: &quot;A String&quot;, # Whether the objectiveMetric should be minimized or maximized. Possible values: &quot;MAXIMUM&quot;, &quot;MINIMUM&quot;. Optional--defaults to &quot;MAXIMUM&quot;. Cannot be specified without objectiveMetric. Cannot be modified when status is &quot;RUNNING&quot; or &quot;ENDED&quot;.
261 &quot;name&quot;: &quot;A String&quot;, # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
262 &quot;kind&quot;: &quot;analytics#experiment&quot;, # Resource type for an Analytics experiment. This field is read-only.
263 &quot;selfLink&quot;: &quot;A String&quot;, # Link for this experiment. This field is read-only.
264 &quot;winnerConfidenceLevel&quot;: 3.14, # 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.
265 &quot;internalWebPropertyId&quot;: &quot;A String&quot;, # Internal ID for the web property to which this experiment belongs. This field is read-only.
266 &quot;endTime&quot;: &quot;A String&quot;, # 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.
267 &quot;minimumExperimentLengthInDays&quot;: 42, # 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.
268 &quot;rewriteVariationUrlsAsOriginal&quot;: True or False, # 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.
269 &quot;objectiveMetric&quot;: &quot;A String&quot;, # The metric that the experiment is optimizing. Valid values: &quot;ga:goal(n)Completions&quot;, &quot;ga:adsenseAdsClicks&quot;, &quot;ga:adsenseAdsViewed&quot;, &quot;ga:adsenseRevenue&quot;, &quot;ga:bounces&quot;, &quot;ga:pageviews&quot;, &quot;ga:sessionDuration&quot;, &quot;ga:transactions&quot;, &quot;ga:transactionRevenue&quot;. This field is required if status is &quot;RUNNING&quot; and servingFramework is one of &quot;REDIRECT&quot; or &quot;API&quot;.
270 &quot;trafficCoverage&quot;: 3.14, # 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.
271 &quot;startTime&quot;: &quot;A String&quot;, # 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.
272 &quot;snippet&quot;: &quot;A String&quot;, # The snippet of code to include on the control page(s). This field is read-only.
273 &quot;id&quot;: &quot;A String&quot;, # Experiment ID. Required for patch and update. Disallowed for create.
274 &quot;webPropertyId&quot;: &quot;A String&quot;, # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
275 &quot;reasonExperimentEnded&quot;: &quot;A String&quot;, # Why the experiment ended. Possible values: &quot;STOPPED_BY_USER&quot;, &quot;WINNER_FOUND&quot;, &quot;EXPERIMENT_EXPIRED&quot;, &quot;ENDED_WITH_NO_WINNER&quot;, &quot;GOAL_OBJECTIVE_CHANGED&quot;. &quot;ENDED_WITH_NO_WINNER&quot; means that the experiment didn&#x27;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.
276 &quot;description&quot;: &quot;A String&quot;, # Notes about this experiment.
277 &quot;accountId&quot;: &quot;A String&quot;, # Account ID to which this experiment belongs. This field is read-only.
278 }</pre>
John Asmuth614db982014-04-24 15:46:26 -0400279</div>
280
281<div class="method">
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800282 <code class="details" id="list">list(accountId, webPropertyId, profileId, max_results=None, start_index=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400283 <pre>Lists experiments to which the user has access.
284
285Args:
286 accountId: string, Account ID to retrieve experiments for. (required)
287 webPropertyId: string, Web property ID to retrieve experiments for. (required)
288 profileId: string, View (Profile) ID to retrieve experiments for. (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700289 max_results: integer, The maximum number of experiments to include in this response.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800290 start_index: integer, An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
John Asmuth614db982014-04-24 15:46:26 -0400291
292Returns:
293 An object of the form:
294
295 { # An experiment collection lists Analytics experiments to which the user has access. Each view (profile) can have a set of experiments. Each resource in the Experiment collection corresponds to a single Analytics experiment.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700296 &quot;items&quot;: [ # A list of experiments.
297 { # JSON template for Analytics experiment resource.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800298 &quot;parentLink&quot;: { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
299 &quot;type&quot;: &quot;analytics#profile&quot;, # Value is &quot;analytics#profile&quot;. This field is read-only.
300 &quot;href&quot;: &quot;A String&quot;, # Link to the view (profile) to which this experiment belongs. This field is read-only.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700301 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800302 &quot;created&quot;: &quot;A String&quot;, # Time the experiment was created. This field is read-only.
303 &quot;variations&quot;: [ # 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.
304 {
305 &quot;name&quot;: &quot;A String&quot;, # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED.
306 &quot;url&quot;: &quot;A String&quot;, # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
307 &quot;weight&quot;: 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
308 &quot;status&quot;: &quot;A String&quot;, # Status of the variation. Possible values: &quot;ACTIVE&quot;, &quot;INACTIVE&quot;. INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
309 &quot;won&quot;: True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
310 },
311 ],
312 &quot;equalWeighting&quot;: True or False, # 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.
313 &quot;status&quot;: &quot;A String&quot;, # Experiment status. Possible values: &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot;, &quot;RUNNING&quot;, &quot;ENDED&quot;. Experiments can be created in the &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot; or &quot;RUNNING&quot; state. This field is required when creating an experiment.
314 &quot;servingFramework&quot;: &quot;A String&quot;, # The framework used to serve the experiment variations and evaluate the results. One of:
315 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
316 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
317 # - 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.
318 &quot;updated&quot;: &quot;A String&quot;, # Time the experiment was last modified. This field is read-only.
319 &quot;editableInGaUi&quot;: True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
320 &quot;winnerFound&quot;: True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
321 &quot;profileId&quot;: &quot;A String&quot;, # View (Profile) ID to which this experiment belongs. This field is read-only.
322 &quot;optimizationType&quot;: &quot;A String&quot;, # Whether the objectiveMetric should be minimized or maximized. Possible values: &quot;MAXIMUM&quot;, &quot;MINIMUM&quot;. Optional--defaults to &quot;MAXIMUM&quot;. Cannot be specified without objectiveMetric. Cannot be modified when status is &quot;RUNNING&quot; or &quot;ENDED&quot;.
323 &quot;name&quot;: &quot;A String&quot;, # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
324 &quot;kind&quot;: &quot;analytics#experiment&quot;, # Resource type for an Analytics experiment. This field is read-only.
325 &quot;selfLink&quot;: &quot;A String&quot;, # Link for this experiment. This field is read-only.
326 &quot;winnerConfidenceLevel&quot;: 3.14, # 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.
327 &quot;internalWebPropertyId&quot;: &quot;A String&quot;, # Internal ID for the web property to which this experiment belongs. This field is read-only.
328 &quot;endTime&quot;: &quot;A String&quot;, # 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.
329 &quot;minimumExperimentLengthInDays&quot;: 42, # 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.
330 &quot;rewriteVariationUrlsAsOriginal&quot;: True or False, # 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.
331 &quot;objectiveMetric&quot;: &quot;A String&quot;, # The metric that the experiment is optimizing. Valid values: &quot;ga:goal(n)Completions&quot;, &quot;ga:adsenseAdsClicks&quot;, &quot;ga:adsenseAdsViewed&quot;, &quot;ga:adsenseRevenue&quot;, &quot;ga:bounces&quot;, &quot;ga:pageviews&quot;, &quot;ga:sessionDuration&quot;, &quot;ga:transactions&quot;, &quot;ga:transactionRevenue&quot;. This field is required if status is &quot;RUNNING&quot; and servingFramework is one of &quot;REDIRECT&quot; or &quot;API&quot;.
332 &quot;trafficCoverage&quot;: 3.14, # 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.
333 &quot;startTime&quot;: &quot;A String&quot;, # 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.
334 &quot;snippet&quot;: &quot;A String&quot;, # The snippet of code to include on the control page(s). This field is read-only.
335 &quot;id&quot;: &quot;A String&quot;, # Experiment ID. Required for patch and update. Disallowed for create.
336 &quot;webPropertyId&quot;: &quot;A String&quot;, # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
337 &quot;reasonExperimentEnded&quot;: &quot;A String&quot;, # Why the experiment ended. Possible values: &quot;STOPPED_BY_USER&quot;, &quot;WINNER_FOUND&quot;, &quot;EXPERIMENT_EXPIRED&quot;, &quot;ENDED_WITH_NO_WINNER&quot;, &quot;GOAL_OBJECTIVE_CHANGED&quot;. &quot;ENDED_WITH_NO_WINNER&quot; means that the experiment didn&#x27;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.
338 &quot;description&quot;: &quot;A String&quot;, # Notes about this experiment.
339 &quot;accountId&quot;: &quot;A String&quot;, # Account ID to which this experiment belongs. This field is read-only.
340 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700341 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800342 &quot;kind&quot;: &quot;analytics#experiments&quot;, # Collection type.
343 &quot;nextLink&quot;: &quot;A String&quot;, # Link to next page for this experiment collection.
344 &quot;startIndex&quot;: 42, # The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
345 &quot;previousLink&quot;: &quot;A String&quot;, # Link to previous page for this experiment collection.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800346 &quot;itemsPerPage&quot;: 42, # The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800347 &quot;username&quot;: &quot;A String&quot;, # Email ID of the authenticated user
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800348 &quot;totalResults&quot;: 42, # The total number of results for the query, regardless of the number of resources in the result.
John Asmuth614db982014-04-24 15:46:26 -0400349 }</pre>
350</div>
351
352<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700353 <code class="details" id="patch">patch(accountId, webPropertyId, profileId, experimentId, body=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400354 <pre>Update an existing experiment. This method supports patch semantics.
355
356Args:
357 accountId: string, Account ID of the experiment to update. (required)
358 webPropertyId: string, Web property ID of the experiment to update. (required)
359 profileId: string, View (Profile) ID of the experiment to update. (required)
360 experimentId: string, Experiment ID of the experiment to update. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700361 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400362 The object takes the form of:
363
364{ # JSON template for Analytics experiment resource.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800365 &quot;parentLink&quot;: { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
366 &quot;type&quot;: &quot;analytics#profile&quot;, # Value is &quot;analytics#profile&quot;. This field is read-only.
367 &quot;href&quot;: &quot;A String&quot;, # Link to the view (profile) to which this experiment belongs. This field is read-only.
368 },
369 &quot;created&quot;: &quot;A String&quot;, # Time the experiment was created. This field is read-only.
370 &quot;variations&quot;: [ # 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.
371 {
372 &quot;name&quot;: &quot;A String&quot;, # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED.
373 &quot;url&quot;: &quot;A String&quot;, # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
374 &quot;weight&quot;: 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
375 &quot;status&quot;: &quot;A String&quot;, # Status of the variation. Possible values: &quot;ACTIVE&quot;, &quot;INACTIVE&quot;. INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
376 &quot;won&quot;: True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700377 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800378 ],
379 &quot;equalWeighting&quot;: True or False, # 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.
380 &quot;status&quot;: &quot;A String&quot;, # Experiment status. Possible values: &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot;, &quot;RUNNING&quot;, &quot;ENDED&quot;. Experiments can be created in the &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot; or &quot;RUNNING&quot; state. This field is required when creating an experiment.
381 &quot;servingFramework&quot;: &quot;A String&quot;, # The framework used to serve the experiment variations and evaluate the results. One of:
382 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
383 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
384 # - 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.
385 &quot;updated&quot;: &quot;A String&quot;, # Time the experiment was last modified. This field is read-only.
386 &quot;editableInGaUi&quot;: True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
387 &quot;winnerFound&quot;: True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
388 &quot;profileId&quot;: &quot;A String&quot;, # View (Profile) ID to which this experiment belongs. This field is read-only.
389 &quot;optimizationType&quot;: &quot;A String&quot;, # Whether the objectiveMetric should be minimized or maximized. Possible values: &quot;MAXIMUM&quot;, &quot;MINIMUM&quot;. Optional--defaults to &quot;MAXIMUM&quot;. Cannot be specified without objectiveMetric. Cannot be modified when status is &quot;RUNNING&quot; or &quot;ENDED&quot;.
390 &quot;name&quot;: &quot;A String&quot;, # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
391 &quot;kind&quot;: &quot;analytics#experiment&quot;, # Resource type for an Analytics experiment. This field is read-only.
392 &quot;selfLink&quot;: &quot;A String&quot;, # Link for this experiment. This field is read-only.
393 &quot;winnerConfidenceLevel&quot;: 3.14, # 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.
394 &quot;internalWebPropertyId&quot;: &quot;A String&quot;, # Internal ID for the web property to which this experiment belongs. This field is read-only.
395 &quot;endTime&quot;: &quot;A String&quot;, # 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.
396 &quot;minimumExperimentLengthInDays&quot;: 42, # 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.
397 &quot;rewriteVariationUrlsAsOriginal&quot;: True or False, # 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.
398 &quot;objectiveMetric&quot;: &quot;A String&quot;, # The metric that the experiment is optimizing. Valid values: &quot;ga:goal(n)Completions&quot;, &quot;ga:adsenseAdsClicks&quot;, &quot;ga:adsenseAdsViewed&quot;, &quot;ga:adsenseRevenue&quot;, &quot;ga:bounces&quot;, &quot;ga:pageviews&quot;, &quot;ga:sessionDuration&quot;, &quot;ga:transactions&quot;, &quot;ga:transactionRevenue&quot;. This field is required if status is &quot;RUNNING&quot; and servingFramework is one of &quot;REDIRECT&quot; or &quot;API&quot;.
399 &quot;trafficCoverage&quot;: 3.14, # 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.
400 &quot;startTime&quot;: &quot;A String&quot;, # 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.
401 &quot;snippet&quot;: &quot;A String&quot;, # The snippet of code to include on the control page(s). This field is read-only.
402 &quot;id&quot;: &quot;A String&quot;, # Experiment ID. Required for patch and update. Disallowed for create.
403 &quot;webPropertyId&quot;: &quot;A String&quot;, # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
404 &quot;reasonExperimentEnded&quot;: &quot;A String&quot;, # Why the experiment ended. Possible values: &quot;STOPPED_BY_USER&quot;, &quot;WINNER_FOUND&quot;, &quot;EXPERIMENT_EXPIRED&quot;, &quot;ENDED_WITH_NO_WINNER&quot;, &quot;GOAL_OBJECTIVE_CHANGED&quot;. &quot;ENDED_WITH_NO_WINNER&quot; means that the experiment didn&#x27;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.
405 &quot;description&quot;: &quot;A String&quot;, # Notes about this experiment.
406 &quot;accountId&quot;: &quot;A String&quot;, # Account ID to which this experiment belongs. This field is read-only.
407}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700408
409
410Returns:
411 An object of the form:
412
413 { # JSON template for Analytics experiment resource.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800414 &quot;parentLink&quot;: { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
415 &quot;type&quot;: &quot;analytics#profile&quot;, # Value is &quot;analytics#profile&quot;. This field is read-only.
416 &quot;href&quot;: &quot;A String&quot;, # Link to the view (profile) to which this experiment belongs. This field is read-only.
417 },
418 &quot;created&quot;: &quot;A String&quot;, # Time the experiment was created. This field is read-only.
419 &quot;variations&quot;: [ # 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.
420 {
421 &quot;name&quot;: &quot;A String&quot;, # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED.
422 &quot;url&quot;: &quot;A String&quot;, # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
423 &quot;weight&quot;: 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
424 &quot;status&quot;: &quot;A String&quot;, # Status of the variation. Possible values: &quot;ACTIVE&quot;, &quot;INACTIVE&quot;. INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
425 &quot;won&quot;: True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700426 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800427 ],
428 &quot;equalWeighting&quot;: True or False, # 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.
429 &quot;status&quot;: &quot;A String&quot;, # Experiment status. Possible values: &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot;, &quot;RUNNING&quot;, &quot;ENDED&quot;. Experiments can be created in the &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot; or &quot;RUNNING&quot; state. This field is required when creating an experiment.
430 &quot;servingFramework&quot;: &quot;A String&quot;, # The framework used to serve the experiment variations and evaluate the results. One of:
431 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
432 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
433 # - 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.
434 &quot;updated&quot;: &quot;A String&quot;, # Time the experiment was last modified. This field is read-only.
435 &quot;editableInGaUi&quot;: True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
436 &quot;winnerFound&quot;: True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
437 &quot;profileId&quot;: &quot;A String&quot;, # View (Profile) ID to which this experiment belongs. This field is read-only.
438 &quot;optimizationType&quot;: &quot;A String&quot;, # Whether the objectiveMetric should be minimized or maximized. Possible values: &quot;MAXIMUM&quot;, &quot;MINIMUM&quot;. Optional--defaults to &quot;MAXIMUM&quot;. Cannot be specified without objectiveMetric. Cannot be modified when status is &quot;RUNNING&quot; or &quot;ENDED&quot;.
439 &quot;name&quot;: &quot;A String&quot;, # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
440 &quot;kind&quot;: &quot;analytics#experiment&quot;, # Resource type for an Analytics experiment. This field is read-only.
441 &quot;selfLink&quot;: &quot;A String&quot;, # Link for this experiment. This field is read-only.
442 &quot;winnerConfidenceLevel&quot;: 3.14, # 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.
443 &quot;internalWebPropertyId&quot;: &quot;A String&quot;, # Internal ID for the web property to which this experiment belongs. This field is read-only.
444 &quot;endTime&quot;: &quot;A String&quot;, # 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.
445 &quot;minimumExperimentLengthInDays&quot;: 42, # 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.
446 &quot;rewriteVariationUrlsAsOriginal&quot;: True or False, # 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.
447 &quot;objectiveMetric&quot;: &quot;A String&quot;, # The metric that the experiment is optimizing. Valid values: &quot;ga:goal(n)Completions&quot;, &quot;ga:adsenseAdsClicks&quot;, &quot;ga:adsenseAdsViewed&quot;, &quot;ga:adsenseRevenue&quot;, &quot;ga:bounces&quot;, &quot;ga:pageviews&quot;, &quot;ga:sessionDuration&quot;, &quot;ga:transactions&quot;, &quot;ga:transactionRevenue&quot;. This field is required if status is &quot;RUNNING&quot; and servingFramework is one of &quot;REDIRECT&quot; or &quot;API&quot;.
448 &quot;trafficCoverage&quot;: 3.14, # 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.
449 &quot;startTime&quot;: &quot;A String&quot;, # 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.
450 &quot;snippet&quot;: &quot;A String&quot;, # The snippet of code to include on the control page(s). This field is read-only.
451 &quot;id&quot;: &quot;A String&quot;, # Experiment ID. Required for patch and update. Disallowed for create.
452 &quot;webPropertyId&quot;: &quot;A String&quot;, # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
453 &quot;reasonExperimentEnded&quot;: &quot;A String&quot;, # Why the experiment ended. Possible values: &quot;STOPPED_BY_USER&quot;, &quot;WINNER_FOUND&quot;, &quot;EXPERIMENT_EXPIRED&quot;, &quot;ENDED_WITH_NO_WINNER&quot;, &quot;GOAL_OBJECTIVE_CHANGED&quot;. &quot;ENDED_WITH_NO_WINNER&quot; means that the experiment didn&#x27;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.
454 &quot;description&quot;: &quot;A String&quot;, # Notes about this experiment.
455 &quot;accountId&quot;: &quot;A String&quot;, # Account ID to which this experiment belongs. This field is read-only.
456 }</pre>
John Asmuth614db982014-04-24 15:46:26 -0400457</div>
458
459<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700460 <code class="details" id="update">update(accountId, webPropertyId, profileId, experimentId, body=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400461 <pre>Update an existing experiment.
462
463Args:
464 accountId: string, Account ID of the experiment to update. (required)
465 webPropertyId: string, Web property ID of the experiment to update. (required)
466 profileId: string, View (Profile) ID of the experiment to update. (required)
467 experimentId: string, Experiment ID of the experiment to update. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700468 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400469 The object takes the form of:
470
471{ # JSON template for Analytics experiment resource.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800472 &quot;parentLink&quot;: { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
473 &quot;type&quot;: &quot;analytics#profile&quot;, # Value is &quot;analytics#profile&quot;. This field is read-only.
474 &quot;href&quot;: &quot;A String&quot;, # Link to the view (profile) to which this experiment belongs. This field is read-only.
475 },
476 &quot;created&quot;: &quot;A String&quot;, # Time the experiment was created. This field is read-only.
477 &quot;variations&quot;: [ # 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.
478 {
479 &quot;name&quot;: &quot;A String&quot;, # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED.
480 &quot;url&quot;: &quot;A String&quot;, # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
481 &quot;weight&quot;: 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
482 &quot;status&quot;: &quot;A String&quot;, # Status of the variation. Possible values: &quot;ACTIVE&quot;, &quot;INACTIVE&quot;. INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
483 &quot;won&quot;: True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700484 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800485 ],
486 &quot;equalWeighting&quot;: True or False, # 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.
487 &quot;status&quot;: &quot;A String&quot;, # Experiment status. Possible values: &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot;, &quot;RUNNING&quot;, &quot;ENDED&quot;. Experiments can be created in the &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot; or &quot;RUNNING&quot; state. This field is required when creating an experiment.
488 &quot;servingFramework&quot;: &quot;A String&quot;, # The framework used to serve the experiment variations and evaluate the results. One of:
489 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
490 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
491 # - 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.
492 &quot;updated&quot;: &quot;A String&quot;, # Time the experiment was last modified. This field is read-only.
493 &quot;editableInGaUi&quot;: True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
494 &quot;winnerFound&quot;: True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
495 &quot;profileId&quot;: &quot;A String&quot;, # View (Profile) ID to which this experiment belongs. This field is read-only.
496 &quot;optimizationType&quot;: &quot;A String&quot;, # Whether the objectiveMetric should be minimized or maximized. Possible values: &quot;MAXIMUM&quot;, &quot;MINIMUM&quot;. Optional--defaults to &quot;MAXIMUM&quot;. Cannot be specified without objectiveMetric. Cannot be modified when status is &quot;RUNNING&quot; or &quot;ENDED&quot;.
497 &quot;name&quot;: &quot;A String&quot;, # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
498 &quot;kind&quot;: &quot;analytics#experiment&quot;, # Resource type for an Analytics experiment. This field is read-only.
499 &quot;selfLink&quot;: &quot;A String&quot;, # Link for this experiment. This field is read-only.
500 &quot;winnerConfidenceLevel&quot;: 3.14, # 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.
501 &quot;internalWebPropertyId&quot;: &quot;A String&quot;, # Internal ID for the web property to which this experiment belongs. This field is read-only.
502 &quot;endTime&quot;: &quot;A String&quot;, # 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.
503 &quot;minimumExperimentLengthInDays&quot;: 42, # 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.
504 &quot;rewriteVariationUrlsAsOriginal&quot;: True or False, # 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.
505 &quot;objectiveMetric&quot;: &quot;A String&quot;, # The metric that the experiment is optimizing. Valid values: &quot;ga:goal(n)Completions&quot;, &quot;ga:adsenseAdsClicks&quot;, &quot;ga:adsenseAdsViewed&quot;, &quot;ga:adsenseRevenue&quot;, &quot;ga:bounces&quot;, &quot;ga:pageviews&quot;, &quot;ga:sessionDuration&quot;, &quot;ga:transactions&quot;, &quot;ga:transactionRevenue&quot;. This field is required if status is &quot;RUNNING&quot; and servingFramework is one of &quot;REDIRECT&quot; or &quot;API&quot;.
506 &quot;trafficCoverage&quot;: 3.14, # 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.
507 &quot;startTime&quot;: &quot;A String&quot;, # 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.
508 &quot;snippet&quot;: &quot;A String&quot;, # The snippet of code to include on the control page(s). This field is read-only.
509 &quot;id&quot;: &quot;A String&quot;, # Experiment ID. Required for patch and update. Disallowed for create.
510 &quot;webPropertyId&quot;: &quot;A String&quot;, # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
511 &quot;reasonExperimentEnded&quot;: &quot;A String&quot;, # Why the experiment ended. Possible values: &quot;STOPPED_BY_USER&quot;, &quot;WINNER_FOUND&quot;, &quot;EXPERIMENT_EXPIRED&quot;, &quot;ENDED_WITH_NO_WINNER&quot;, &quot;GOAL_OBJECTIVE_CHANGED&quot;. &quot;ENDED_WITH_NO_WINNER&quot; means that the experiment didn&#x27;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.
512 &quot;description&quot;: &quot;A String&quot;, # Notes about this experiment.
513 &quot;accountId&quot;: &quot;A String&quot;, # Account ID to which this experiment belongs. This field is read-only.
514}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700515
516
517Returns:
518 An object of the form:
519
520 { # JSON template for Analytics experiment resource.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800521 &quot;parentLink&quot;: { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
522 &quot;type&quot;: &quot;analytics#profile&quot;, # Value is &quot;analytics#profile&quot;. This field is read-only.
523 &quot;href&quot;: &quot;A String&quot;, # Link to the view (profile) to which this experiment belongs. This field is read-only.
524 },
525 &quot;created&quot;: &quot;A String&quot;, # Time the experiment was created. This field is read-only.
526 &quot;variations&quot;: [ # 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.
527 {
528 &quot;name&quot;: &quot;A String&quot;, # The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED.
529 &quot;url&quot;: &quot;A String&quot;, # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
530 &quot;weight&quot;: 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
531 &quot;status&quot;: &quot;A String&quot;, # Status of the variation. Possible values: &quot;ACTIVE&quot;, &quot;INACTIVE&quot;. INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
532 &quot;won&quot;: True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700533 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800534 ],
535 &quot;equalWeighting&quot;: True or False, # 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.
536 &quot;status&quot;: &quot;A String&quot;, # Experiment status. Possible values: &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot;, &quot;RUNNING&quot;, &quot;ENDED&quot;. Experiments can be created in the &quot;DRAFT&quot;, &quot;READY_TO_RUN&quot; or &quot;RUNNING&quot; state. This field is required when creating an experiment.
537 &quot;servingFramework&quot;: &quot;A String&quot;, # The framework used to serve the experiment variations and evaluate the results. One of:
538 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
539 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
540 # - 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.
541 &quot;updated&quot;: &quot;A String&quot;, # Time the experiment was last modified. This field is read-only.
542 &quot;editableInGaUi&quot;: True or False, # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
543 &quot;winnerFound&quot;: True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
544 &quot;profileId&quot;: &quot;A String&quot;, # View (Profile) ID to which this experiment belongs. This field is read-only.
545 &quot;optimizationType&quot;: &quot;A String&quot;, # Whether the objectiveMetric should be minimized or maximized. Possible values: &quot;MAXIMUM&quot;, &quot;MINIMUM&quot;. Optional--defaults to &quot;MAXIMUM&quot;. Cannot be specified without objectiveMetric. Cannot be modified when status is &quot;RUNNING&quot; or &quot;ENDED&quot;.
546 &quot;name&quot;: &quot;A String&quot;, # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
547 &quot;kind&quot;: &quot;analytics#experiment&quot;, # Resource type for an Analytics experiment. This field is read-only.
548 &quot;selfLink&quot;: &quot;A String&quot;, # Link for this experiment. This field is read-only.
549 &quot;winnerConfidenceLevel&quot;: 3.14, # 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.
550 &quot;internalWebPropertyId&quot;: &quot;A String&quot;, # Internal ID for the web property to which this experiment belongs. This field is read-only.
551 &quot;endTime&quot;: &quot;A String&quot;, # 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.
552 &quot;minimumExperimentLengthInDays&quot;: 42, # 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.
553 &quot;rewriteVariationUrlsAsOriginal&quot;: True or False, # 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.
554 &quot;objectiveMetric&quot;: &quot;A String&quot;, # The metric that the experiment is optimizing. Valid values: &quot;ga:goal(n)Completions&quot;, &quot;ga:adsenseAdsClicks&quot;, &quot;ga:adsenseAdsViewed&quot;, &quot;ga:adsenseRevenue&quot;, &quot;ga:bounces&quot;, &quot;ga:pageviews&quot;, &quot;ga:sessionDuration&quot;, &quot;ga:transactions&quot;, &quot;ga:transactionRevenue&quot;. This field is required if status is &quot;RUNNING&quot; and servingFramework is one of &quot;REDIRECT&quot; or &quot;API&quot;.
555 &quot;trafficCoverage&quot;: 3.14, # 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.
556 &quot;startTime&quot;: &quot;A String&quot;, # 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.
557 &quot;snippet&quot;: &quot;A String&quot;, # The snippet of code to include on the control page(s). This field is read-only.
558 &quot;id&quot;: &quot;A String&quot;, # Experiment ID. Required for patch and update. Disallowed for create.
559 &quot;webPropertyId&quot;: &quot;A String&quot;, # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
560 &quot;reasonExperimentEnded&quot;: &quot;A String&quot;, # Why the experiment ended. Possible values: &quot;STOPPED_BY_USER&quot;, &quot;WINNER_FOUND&quot;, &quot;EXPERIMENT_EXPIRED&quot;, &quot;ENDED_WITH_NO_WINNER&quot;, &quot;GOAL_OBJECTIVE_CHANGED&quot;. &quot;ENDED_WITH_NO_WINNER&quot; means that the experiment didn&#x27;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.
561 &quot;description&quot;: &quot;A String&quot;, # Notes about this experiment.
562 &quot;accountId&quot;: &quot;A String&quot;, # Account ID to which this experiment belongs. This field is read-only.
563 }</pre>
John Asmuth614db982014-04-24 15:46:26 -0400564</div>
565
566</body></html>