blob: 0c014624216847c141a91a1c8e5ebf4139376a15 [file] [log] [blame]
Joe Gregorio37802c32013-08-06 12:24:05 -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">
78 <code><a href="#delete">delete(accountId, webPropertyId, profileId, experimentId)</a></code></p>
79<p class="firstline">Delete an experiment.</p>
80<p class="toc_element">
81 <code><a href="#get">get(accountId, webPropertyId, profileId, experimentId)</a></code></p>
82<p class="firstline">Returns an experiment to which the user has access.</p>
83<p class="toc_element">
84 <code><a href="#insert">insert(accountId, webPropertyId, profileId, body)</a></code></p>
85<p class="firstline">Create a new experiment.</p>
86<p class="toc_element">
87 <code><a href="#list">list(accountId, webPropertyId, profileId, max_results=None, start_index=None)</a></code></p>
88<p class="firstline">Lists experiments to which the user has access.</p>
89<p class="toc_element">
90 <code><a href="#patch">patch(accountId, webPropertyId, profileId, experimentId, body)</a></code></p>
91<p class="firstline">Update an existing experiment. This method supports patch semantics.</p>
92<p class="toc_element">
93 <code><a href="#update">update(accountId, webPropertyId, profileId, experimentId, body)</a></code></p>
94<p class="firstline">Update an existing experiment.</p>
95<h3>Method Details</h3>
96<div class="method">
97 <code class="details" id="delete">delete(accountId, webPropertyId, profileId, experimentId)</code>
98 <pre>Delete an experiment.
99
100Args:
101 accountId: string, Account ID to which the experiment belongs (required)
102 webPropertyId: string, Web property ID to which the experiment belongs (required)
103 profileId: string, View (Profile) ID to which the experiment belongs (required)
104 experimentId: string, ID of the experiment to delete (required)
105</pre>
106</div>
107
108<div class="method">
109 <code class="details" id="get">get(accountId, webPropertyId, profileId, experimentId)</code>
110 <pre>Returns an experiment to which the user has access.
111
112Args:
113 accountId: string, Account ID to retrieve the experiment for. (required)
114 webPropertyId: string, Web property ID to retrieve the experiment for. (required)
115 profileId: string, View (Profile) ID to retrieve the experiment for. (required)
116 experimentId: string, Experiment ID to retrieve the experiment for. (required)
117
118Returns:
119 An object of the form:
120
121 { # JSON template for Analytics experiment resource.
122 "trafficCoverage": 3.14, # A floating-point number between 0 and 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.
123 "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
124 "optimizationType": "A String", # 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".
125 "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:bounces", "ga:pageviews", "ga:timeOnSite", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
126 "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create.
127 "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only.
128 "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only.
129 "editableInGaUi": "", # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
130 "rewriteVariationUrlsAsOriginal": 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.
131 "servingFramework": "", # The framework used to serve the experiment variations and evaluate the results. One of:
132 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
133 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
134 # - 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.
135 "status": "A String", # 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.
136 "updated": "A String", # Time the experiment was last modified. This field is read-only.
137 "description": "A String", # Notes about this experiment.
138 "reasonExperimentEnded": "A String", # 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.
139 "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only.
140 "winnerConfidenceLevel": 3.14, # A floating-point number between 0 and 1. Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED.
141 "startTime": "A String", # 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.
142 "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
143 "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only.
144 "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
145 "created": "A String", # Time the experiment was created. This field is read-only.
146 "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.
147 {
148 "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
149 "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
150 "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
151 "name": "A String", # 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.
152 "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
153 },
154 ],
155 "minimumExperimentLengthInDays": 42, # 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.
156 "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only.
157 "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
158 "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only.
159 "type": "analytics#profile", # Value is "analytics#profile". This field is read-only.
160 },
161 "endTime": "A String", # 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.
162 "selfLink": "A String", # Link for this experiment. This field is read-only.
163 }</pre>
164</div>
165
166<div class="method">
167 <code class="details" id="insert">insert(accountId, webPropertyId, profileId, body)</code>
168 <pre>Create a new experiment.
169
170Args:
171 accountId: string, Account ID to create the experiment for. (required)
172 webPropertyId: string, Web property ID to create the experiment for. (required)
173 profileId: string, View (Profile) ID to create the experiment for. (required)
174 body: object, The request body. (required)
175 The object takes the form of:
176
177{ # JSON template for Analytics experiment resource.
178 "trafficCoverage": 3.14, # A floating-point number between 0 and 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.
179 "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
180 "optimizationType": "A String", # 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".
181 "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:bounces", "ga:pageviews", "ga:timeOnSite", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
182 "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create.
183 "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only.
184 "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only.
185 "editableInGaUi": "", # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
186 "rewriteVariationUrlsAsOriginal": 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.
187 "servingFramework": "", # The framework used to serve the experiment variations and evaluate the results. One of:
188 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
189 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
190 # - 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.
191 "status": "A String", # 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.
192 "updated": "A String", # Time the experiment was last modified. This field is read-only.
193 "description": "A String", # Notes about this experiment.
194 "reasonExperimentEnded": "A String", # 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.
195 "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only.
196 "winnerConfidenceLevel": 3.14, # A floating-point number between 0 and 1. Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED.
197 "startTime": "A String", # 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.
198 "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
199 "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only.
200 "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
201 "created": "A String", # Time the experiment was created. This field is read-only.
202 "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.
203 {
204 "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
205 "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
206 "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
207 "name": "A String", # 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.
208 "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
209 },
210 ],
211 "minimumExperimentLengthInDays": 42, # 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.
212 "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only.
213 "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
214 "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only.
215 "type": "analytics#profile", # Value is "analytics#profile". This field is read-only.
216 },
217 "endTime": "A String", # 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 "selfLink": "A String", # Link for this experiment. This field is read-only.
219 }
220
221
222Returns:
223 An object of the form:
224
225 { # JSON template for Analytics experiment resource.
226 "trafficCoverage": 3.14, # A floating-point number between 0 and 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.
227 "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
228 "optimizationType": "A String", # 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".
229 "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:bounces", "ga:pageviews", "ga:timeOnSite", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
230 "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create.
231 "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only.
232 "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only.
233 "editableInGaUi": "", # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
234 "rewriteVariationUrlsAsOriginal": 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.
235 "servingFramework": "", # The framework used to serve the experiment variations and evaluate the results. One of:
236 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
237 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
238 # - 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.
239 "status": "A String", # 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.
240 "updated": "A String", # Time the experiment was last modified. This field is read-only.
241 "description": "A String", # Notes about this experiment.
242 "reasonExperimentEnded": "A String", # 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.
243 "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only.
244 "winnerConfidenceLevel": 3.14, # A floating-point number between 0 and 1. Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED.
245 "startTime": "A String", # 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.
246 "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
247 "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only.
248 "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
249 "created": "A String", # Time the experiment was created. This field is read-only.
250 "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.
251 {
252 "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
253 "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
254 "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
255 "name": "A String", # 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.
256 "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
257 },
258 ],
259 "minimumExperimentLengthInDays": 42, # 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.
260 "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only.
261 "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
262 "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only.
263 "type": "analytics#profile", # Value is "analytics#profile". This field is read-only.
264 },
265 "endTime": "A String", # 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.
266 "selfLink": "A String", # Link for this experiment. This field is read-only.
267 }</pre>
268</div>
269
270<div class="method">
271 <code class="details" id="list">list(accountId, webPropertyId, profileId, max_results=None, start_index=None)</code>
272 <pre>Lists experiments to which the user has access.
273
274Args:
275 accountId: string, Account ID to retrieve experiments for. (required)
276 webPropertyId: string, Web property ID to retrieve experiments for. (required)
277 profileId: string, View (Profile) ID to retrieve experiments for. (required)
278 max_results: integer, The maximum number of experiments to include in this response.
279 start_index: integer, An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
280
281Returns:
282 An object of the form:
283
284 { # 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.
285 "username": "A String", # Email ID of the authenticated user
286 "kind": "analytics#experiments", # Collection type.
287 "items": [ # A list of experiments.
288 { # JSON template for Analytics experiment resource.
289 "trafficCoverage": 3.14, # A floating-point number between 0 and 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.
290 "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
291 "optimizationType": "A String", # 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".
292 "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:bounces", "ga:pageviews", "ga:timeOnSite", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
293 "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create.
294 "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only.
295 "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only.
296 "editableInGaUi": "", # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
297 "rewriteVariationUrlsAsOriginal": 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.
298 "servingFramework": "", # The framework used to serve the experiment variations and evaluate the results. One of:
299 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
300 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
301 # - 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.
302 "status": "A String", # 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.
303 "updated": "A String", # Time the experiment was last modified. This field is read-only.
304 "description": "A String", # Notes about this experiment.
305 "reasonExperimentEnded": "A String", # 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.
306 "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only.
307 "winnerConfidenceLevel": 3.14, # A floating-point number between 0 and 1. Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED.
308 "startTime": "A String", # 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.
309 "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
310 "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only.
311 "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
312 "created": "A String", # Time the experiment was created. This field is read-only.
313 "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.
314 {
315 "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
316 "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
317 "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
318 "name": "A String", # 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.
319 "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
320 },
321 ],
322 "minimumExperimentLengthInDays": 42, # 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.
323 "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only.
324 "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
325 "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only.
326 "type": "analytics#profile", # Value is "analytics#profile". This field is read-only.
327 },
328 "endTime": "A String", # 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 "selfLink": "A String", # Link for this experiment. This field is read-only.
330 },
331 ],
332 "itemsPerPage": 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.
333 "previousLink": "A String", # Link to previous page for this experiment collection.
334 "startIndex": 42, # The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
335 "nextLink": "A String", # Link to next page for this experiment collection.
336 "totalResults": 42, # The total number of results for the query, regardless of the number of resources in the result.
337 }</pre>
338</div>
339
340<div class="method">
341 <code class="details" id="patch">patch(accountId, webPropertyId, profileId, experimentId, body)</code>
342 <pre>Update an existing experiment. This method supports patch semantics.
343
344Args:
345 accountId: string, Account ID of the experiment to update. (required)
346 webPropertyId: string, Web property ID of the experiment to update. (required)
347 profileId: string, View (Profile) ID of the experiment to update. (required)
348 experimentId: string, Experiment ID of the experiment to update. (required)
349 body: object, The request body. (required)
350 The object takes the form of:
351
352{ # JSON template for Analytics experiment resource.
353 "trafficCoverage": 3.14, # A floating-point number between 0 and 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.
354 "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
355 "optimizationType": "A String", # 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".
356 "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:bounces", "ga:pageviews", "ga:timeOnSite", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
357 "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create.
358 "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only.
359 "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only.
360 "editableInGaUi": "", # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
361 "rewriteVariationUrlsAsOriginal": 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.
362 "servingFramework": "", # The framework used to serve the experiment variations and evaluate the results. One of:
363 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
364 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
365 # - 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.
366 "status": "A String", # 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.
367 "updated": "A String", # Time the experiment was last modified. This field is read-only.
368 "description": "A String", # Notes about this experiment.
369 "reasonExperimentEnded": "A String", # 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.
370 "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only.
371 "winnerConfidenceLevel": 3.14, # A floating-point number between 0 and 1. Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED.
372 "startTime": "A String", # 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.
373 "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
374 "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only.
375 "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
376 "created": "A String", # Time the experiment was created. This field is read-only.
377 "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.
378 {
379 "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
380 "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
381 "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
382 "name": "A String", # 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.
383 "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
384 },
385 ],
386 "minimumExperimentLengthInDays": 42, # 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.
387 "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only.
388 "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
389 "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only.
390 "type": "analytics#profile", # Value is "analytics#profile". This field is read-only.
391 },
392 "endTime": "A String", # 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.
393 "selfLink": "A String", # Link for this experiment. This field is read-only.
394 }
395
396
397Returns:
398 An object of the form:
399
400 { # JSON template for Analytics experiment resource.
401 "trafficCoverage": 3.14, # A floating-point number between 0 and 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.
402 "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
403 "optimizationType": "A String", # 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".
404 "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:bounces", "ga:pageviews", "ga:timeOnSite", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
405 "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create.
406 "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only.
407 "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only.
408 "editableInGaUi": "", # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
409 "rewriteVariationUrlsAsOriginal": 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.
410 "servingFramework": "", # The framework used to serve the experiment variations and evaluate the results. One of:
411 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
412 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
413 # - 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.
414 "status": "A String", # 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.
415 "updated": "A String", # Time the experiment was last modified. This field is read-only.
416 "description": "A String", # Notes about this experiment.
417 "reasonExperimentEnded": "A String", # 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.
418 "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only.
419 "winnerConfidenceLevel": 3.14, # A floating-point number between 0 and 1. Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED.
420 "startTime": "A String", # 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.
421 "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
422 "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only.
423 "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
424 "created": "A String", # Time the experiment was created. This field is read-only.
425 "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.
426 {
427 "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
428 "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
429 "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
430 "name": "A String", # 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.
431 "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
432 },
433 ],
434 "minimumExperimentLengthInDays": 42, # 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.
435 "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only.
436 "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
437 "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only.
438 "type": "analytics#profile", # Value is "analytics#profile". This field is read-only.
439 },
440 "endTime": "A String", # 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.
441 "selfLink": "A String", # Link for this experiment. This field is read-only.
442 }</pre>
443</div>
444
445<div class="method">
446 <code class="details" id="update">update(accountId, webPropertyId, profileId, experimentId, body)</code>
447 <pre>Update an existing experiment.
448
449Args:
450 accountId: string, Account ID of the experiment to update. (required)
451 webPropertyId: string, Web property ID of the experiment to update. (required)
452 profileId: string, View (Profile) ID of the experiment to update. (required)
453 experimentId: string, Experiment ID of the experiment to update. (required)
454 body: object, The request body. (required)
455 The object takes the form of:
456
457{ # JSON template for Analytics experiment resource.
458 "trafficCoverage": 3.14, # A floating-point number between 0 and 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.
459 "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
460 "optimizationType": "A String", # 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".
461 "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:bounces", "ga:pageviews", "ga:timeOnSite", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
462 "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create.
463 "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only.
464 "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only.
465 "editableInGaUi": "", # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
466 "rewriteVariationUrlsAsOriginal": 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.
467 "servingFramework": "", # The framework used to serve the experiment variations and evaluate the results. One of:
468 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
469 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
470 # - 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.
471 "status": "A String", # 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.
472 "updated": "A String", # Time the experiment was last modified. This field is read-only.
473 "description": "A String", # Notes about this experiment.
474 "reasonExperimentEnded": "A String", # 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.
475 "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only.
476 "winnerConfidenceLevel": 3.14, # A floating-point number between 0 and 1. Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED.
477 "startTime": "A String", # 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.
478 "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
479 "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only.
480 "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
481 "created": "A String", # Time the experiment was created. This field is read-only.
482 "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.
483 {
484 "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
485 "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
486 "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
487 "name": "A String", # 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.
488 "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
489 },
490 ],
491 "minimumExperimentLengthInDays": 42, # 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.
492 "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only.
493 "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
494 "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only.
495 "type": "analytics#profile", # Value is "analytics#profile". This field is read-only.
496 },
497 "endTime": "A String", # 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.
498 "selfLink": "A String", # Link for this experiment. This field is read-only.
499 }
500
501
502Returns:
503 An object of the form:
504
505 { # JSON template for Analytics experiment resource.
506 "trafficCoverage": 3.14, # A floating-point number between 0 and 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 "webPropertyId": "A String", # Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
508 "optimizationType": "A String", # 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".
509 "objectiveMetric": "A String", # The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:bounces", "ga:pageviews", "ga:timeOnSite", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
510 "id": "A String", # Experiment ID. Required for patch and update. Disallowed for create.
511 "accountId": "A String", # Account ID to which this experiment belongs. This field is read-only.
512 "snippet": "A String", # The snippet of code to include on the control page(s). This field is read-only.
513 "editableInGaUi": "", # If true, the end user will be able to edit the experiment via the Google Analytics user interface.
514 "rewriteVariationUrlsAsOriginal": 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.
515 "servingFramework": "", # The framework used to serve the experiment variations and evaluate the results. One of:
516 # - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
517 # - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
518 # - 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.
519 "status": "A String", # 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.
520 "updated": "A String", # Time the experiment was last modified. This field is read-only.
521 "description": "A String", # Notes about this experiment.
522 "reasonExperimentEnded": "A String", # 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.
523 "internalWebPropertyId": "A String", # Internal ID for the web property to which this experiment belongs. This field is read-only.
524 "winnerConfidenceLevel": 3.14, # A floating-point number between 0 and 1. Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED.
525 "startTime": "A String", # 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.
526 "winnerFound": True or False, # Boolean specifying whether a winner has been found for this experiment. This field is read-only.
527 "kind": "analytics#experiment", # Resource type for an Analytics experiment. This field is read-only.
528 "name": "A String", # Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
529 "created": "A String", # Time the experiment was created. This field is read-only.
530 "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.
531 {
532 "status": "A String", # Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED.
533 "url": "A String", # The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED.
534 "won": True or False, # True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only.
535 "name": "A String", # 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.
536 "weight": 3.14, # Weight that this variation should receive. Only present if the experiment is running. This field is read-only.
537 },
538 ],
539 "minimumExperimentLengthInDays": 42, # 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.
540 "profileId": "A String", # View (Profile) ID to which this experiment belongs. This field is read-only.
541 "parentLink": { # Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
542 "href": "A String", # Link to the view (profile) to which this experiment belongs. This field is read-only.
543 "type": "analytics#profile", # Value is "analytics#profile". This field is read-only.
544 },
545 "endTime": "A String", # 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.
546 "selfLink": "A String", # Link for this experiment. This field is read-only.
547 }</pre>
548</div>
549
550</body></html>