blob: 6cfeb11d7d2d3f0a12f98ef3a611919a2e94be00 [file] [log] [blame]
Craig Citroe633be12015-03-02 13:40:36 -08001<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.customMetrics.html">customMetrics</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#get">get(accountId, webPropertyId, customMetricId)</a></code></p>
79<p class="firstline">Get a custom metric to which the user has access.</p>
80<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#insert">insert(accountId, webPropertyId, body=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -080082<p class="firstline">Create a new custom metric.</p>
83<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070084 <code><a href="#list">list(accountId, webPropertyId, start_index=None, max_results=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -080085<p class="firstline">Lists custom metrics to which the user has access.</p>
86<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#patch">patch(accountId, webPropertyId, customMetricId, body=None, ignoreCustomDataSourceLinks=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -080088<p class="firstline">Updates an existing custom metric. This method supports patch semantics.</p>
89<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#update">update(accountId, webPropertyId, customMetricId, body=None, ignoreCustomDataSourceLinks=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -080091<p class="firstline">Updates an existing custom metric.</p>
92<h3>Method Details</h3>
93<div class="method">
94 <code class="details" id="get">get(accountId, webPropertyId, customMetricId)</code>
95 <pre>Get a custom metric to which the user has access.
96
97Args:
98 accountId: string, Account ID for the custom metric to retrieve. (required)
99 webPropertyId: string, Web property ID for the custom metric to retrieve. (required)
100 customMetricId: string, The ID of the custom metric to retrieve. (required)
101
102Returns:
103 An object of the form:
104
105 { # JSON template for Analytics Custom Metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700106 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
107 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
108 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
109 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
110 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700111 &quot;index&quot;: 42, # Index of the custom metric.
112 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
113 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
114 &quot;kind&quot;: &quot;analytics#customMetric&quot;, # Kind value for a custom metric. Set to &quot;analytics#customMetric&quot;. It is a read-only field.
115 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
116 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
117 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
118 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
119 },
120 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
121 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
122 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
123 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
Craig Citroe633be12015-03-02 13:40:36 -0800124 }</pre>
125</div>
126
127<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700128 <code class="details" id="insert">insert(accountId, webPropertyId, body=None)</code>
Craig Citroe633be12015-03-02 13:40:36 -0800129 <pre>Create a new custom metric.
130
131Args:
132 accountId: string, Account ID for the custom metric to create. (required)
133 webPropertyId: string, Web property ID for the custom dimension to create. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700134 body: object, The request body.
Craig Citroe633be12015-03-02 13:40:36 -0800135 The object takes the form of:
136
137{ # JSON template for Analytics Custom Metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700138 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
139 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
140 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
141 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
142 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700143 &quot;index&quot;: 42, # Index of the custom metric.
144 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
145 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
146 &quot;kind&quot;: &quot;analytics#customMetric&quot;, # Kind value for a custom metric. Set to &quot;analytics#customMetric&quot;. It is a read-only field.
147 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
148 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
149 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
150 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
151 },
152 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
153 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
154 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
155 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
Craig Citroe633be12015-03-02 13:40:36 -0800156 }
157
158
159Returns:
160 An object of the form:
161
162 { # JSON template for Analytics Custom Metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700163 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
164 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
165 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
166 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
167 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700168 &quot;index&quot;: 42, # Index of the custom metric.
169 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
170 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
171 &quot;kind&quot;: &quot;analytics#customMetric&quot;, # Kind value for a custom metric. Set to &quot;analytics#customMetric&quot;. It is a read-only field.
172 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
173 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
174 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
175 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
176 },
177 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
178 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
179 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
180 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
Craig Citroe633be12015-03-02 13:40:36 -0800181 }</pre>
182</div>
183
184<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700185 <code class="details" id="list">list(accountId, webPropertyId, start_index=None, max_results=None)</code>
Craig Citroe633be12015-03-02 13:40:36 -0800186 <pre>Lists custom metrics to which the user has access.
187
188Args:
189 accountId: string, Account ID for the custom metrics to retrieve. (required)
190 webPropertyId: string, Web property ID for the custom metrics to retrieve. (required)
Craig Citroe633be12015-03-02 13:40:36 -0800191 start_index: integer, An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
Bu Sun Kim65020912020-05-20 12:08:20 -0700192 max_results: integer, The maximum number of custom metrics to include in this response.
Craig Citroe633be12015-03-02 13:40:36 -0800193
194Returns:
195 An object of the form:
196
197 { # A custom metric collection lists Analytics custom metrics to which the user has access. Each resource in the collection corresponds to a single Analytics custom metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700198 &quot;items&quot;: [ # Collection of custom metrics.
Craig Citroe633be12015-03-02 13:40:36 -0800199 { # JSON template for Analytics Custom Metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700200 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
201 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
202 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
203 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
204 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700205 &quot;index&quot;: 42, # Index of the custom metric.
206 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
207 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
208 &quot;kind&quot;: &quot;analytics#customMetric&quot;, # Kind value for a custom metric. Set to &quot;analytics#customMetric&quot;. It is a read-only field.
209 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
210 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
211 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
212 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
213 },
214 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
215 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
216 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
217 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
Craig Citroe633be12015-03-02 13:40:36 -0800218 },
219 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700220 &quot;username&quot;: &quot;A String&quot;, # Email ID of the authenticated user
221 &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.
222 &quot;startIndex&quot;: 42, # The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
223 &quot;kind&quot;: &quot;analytics#customMetrics&quot;, # Collection type.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700224 &quot;nextLink&quot;: &quot;A String&quot;, # Link to next page for this custom metric collection.
225 &quot;previousLink&quot;: &quot;A String&quot;, # Link to previous page for this custom metric collection.
226 &quot;totalResults&quot;: 42, # The total number of results for the query, regardless of the number of results in the response.
Craig Citroe633be12015-03-02 13:40:36 -0800227 }</pre>
228</div>
229
230<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700231 <code class="details" id="patch">patch(accountId, webPropertyId, customMetricId, body=None, ignoreCustomDataSourceLinks=None)</code>
Craig Citroe633be12015-03-02 13:40:36 -0800232 <pre>Updates an existing custom metric. This method supports patch semantics.
233
234Args:
235 accountId: string, Account ID for the custom metric to update. (required)
236 webPropertyId: string, Web property ID for the custom metric to update. (required)
237 customMetricId: string, Custom metric ID for the custom metric to update. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700238 body: object, The request body.
Craig Citroe633be12015-03-02 13:40:36 -0800239 The object takes the form of:
240
241{ # JSON template for Analytics Custom Metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700242 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
243 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
244 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
245 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
246 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700247 &quot;index&quot;: 42, # Index of the custom metric.
248 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
249 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
250 &quot;kind&quot;: &quot;analytics#customMetric&quot;, # Kind value for a custom metric. Set to &quot;analytics#customMetric&quot;. It is a read-only field.
251 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
252 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
253 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
254 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
255 },
256 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
257 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
258 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
259 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
Craig Citroe633be12015-03-02 13:40:36 -0800260 }
261
262 ignoreCustomDataSourceLinks: boolean, Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.
263
264Returns:
265 An object of the form:
266
267 { # JSON template for Analytics Custom Metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700268 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
269 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
270 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
271 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
272 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700273 &quot;index&quot;: 42, # Index of the custom metric.
274 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
275 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
276 &quot;kind&quot;: &quot;analytics#customMetric&quot;, # Kind value for a custom metric. Set to &quot;analytics#customMetric&quot;. It is a read-only field.
277 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
278 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
279 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
280 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
281 },
282 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
283 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
284 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
285 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
Craig Citroe633be12015-03-02 13:40:36 -0800286 }</pre>
287</div>
288
289<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700290 <code class="details" id="update">update(accountId, webPropertyId, customMetricId, body=None, ignoreCustomDataSourceLinks=None)</code>
Craig Citroe633be12015-03-02 13:40:36 -0800291 <pre>Updates an existing custom metric.
292
293Args:
294 accountId: string, Account ID for the custom metric to update. (required)
295 webPropertyId: string, Web property ID for the custom metric to update. (required)
296 customMetricId: string, Custom metric ID for the custom metric to update. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700297 body: object, The request body.
Craig Citroe633be12015-03-02 13:40:36 -0800298 The object takes the form of:
299
300{ # JSON template for Analytics Custom Metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700301 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
302 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
303 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
304 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
305 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700306 &quot;index&quot;: 42, # Index of the custom metric.
307 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
308 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
309 &quot;kind&quot;: &quot;analytics#customMetric&quot;, # Kind value for a custom metric. Set to &quot;analytics#customMetric&quot;. It is a read-only field.
310 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
311 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
312 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
313 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
314 },
315 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
316 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
317 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
318 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
Craig Citroe633be12015-03-02 13:40:36 -0800319 }
320
321 ignoreCustomDataSourceLinks: boolean, Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.
322
323Returns:
324 An object of the form:
325
326 { # JSON template for Analytics Custom Metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700327 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
328 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
329 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
330 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
331 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700332 &quot;index&quot;: 42, # Index of the custom metric.
333 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
334 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
335 &quot;kind&quot;: &quot;analytics#customMetric&quot;, # Kind value for a custom metric. Set to &quot;analytics#customMetric&quot;. It is a read-only field.
336 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
337 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
338 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
339 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
340 },
341 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
342 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
343 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
344 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
Craig Citroe633be12015-03-02 13:40:36 -0800345 }</pre>
346</div>
347
348</body></html>