blob: dac14bd6d76d208c5a4c641f3fe358b280ca28dc [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;index&quot;: 42, # Index of the custom metric.
107 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
108 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
109 &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.
110 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
111 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
112 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
113 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
114 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
Craig Citroe633be12015-03-02 13:40:36 -0800115 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700116 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
117 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
118 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
119 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
120 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
121 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
122 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
123 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
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;index&quot;: 42, # Index of the custom metric.
139 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
140 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
141 &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.
142 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
143 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
144 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
145 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
146 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
Craig Citroe633be12015-03-02 13:40:36 -0800147 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700148 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
149 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
150 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
151 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
152 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
153 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
154 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
155 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
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;index&quot;: 42, # Index of the custom metric.
164 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
165 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
166 &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.
167 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
168 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
169 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
170 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
171 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
Craig Citroe633be12015-03-02 13:40:36 -0800172 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700173 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
174 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
175 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
176 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
177 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
178 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
179 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
180 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
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;nextLink&quot;: &quot;A String&quot;, # Link to next page for this custom metric collection.
199 &quot;previousLink&quot;: &quot;A String&quot;, # Link to previous page for this custom metric collection.
200 &quot;totalResults&quot;: 42, # The total number of results for the query, regardless of the number of results in the response.
201 &quot;items&quot;: [ # Collection of custom metrics.
Craig Citroe633be12015-03-02 13:40:36 -0800202 { # JSON template for Analytics Custom Metric.
Bu Sun Kim65020912020-05-20 12:08:20 -0700203 &quot;index&quot;: 42, # Index of the custom metric.
204 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
205 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
206 &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.
207 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
208 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
209 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
210 &quot;href&quot;: &quot;A String&quot;, # Link 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;.
Craig Citroe633be12015-03-02 13:40:36 -0800212 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700213 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
214 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
215 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
216 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
217 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
218 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
219 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
220 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
Craig Citroe633be12015-03-02 13:40:36 -0800221 },
222 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700223 &quot;username&quot;: &quot;A String&quot;, # Email ID of the authenticated user
224 &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.
225 &quot;startIndex&quot;: 42, # The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
226 &quot;kind&quot;: &quot;analytics#customMetrics&quot;, # Collection type.
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;index&quot;: 42, # Index of the custom metric.
243 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
244 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
245 &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.
246 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
247 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
248 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
249 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
250 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
Craig Citroe633be12015-03-02 13:40:36 -0800251 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700252 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
253 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
254 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
255 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
256 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
257 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
258 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
259 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
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;index&quot;: 42, # Index of the custom metric.
269 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
270 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
271 &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.
272 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
273 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
274 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
275 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
276 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
Craig Citroe633be12015-03-02 13:40:36 -0800277 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700278 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
279 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
280 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
281 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
282 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
283 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
284 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
285 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
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;index&quot;: 42, # Index of the custom metric.
302 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
303 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
304 &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.
305 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
306 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
307 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
308 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
309 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
Craig Citroe633be12015-03-02 13:40:36 -0800310 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700311 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
312 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
313 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
314 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
315 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
316 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
317 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
318 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
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;index&quot;: 42, # Index of the custom metric.
328 &quot;scope&quot;: &quot;A String&quot;, # Scope of the custom metric: HIT or PRODUCT.
329 &quot;created&quot;: &quot;A String&quot;, # Time the custom metric was created.
330 &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.
331 &quot;active&quot;: True or False, # Boolean indicating whether the custom metric is active.
332 &quot;name&quot;: &quot;A String&quot;, # Name of the custom metric.
333 &quot;parentLink&quot;: { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
334 &quot;href&quot;: &quot;A String&quot;, # Link to the property to which the custom metric belongs.
335 &quot;type&quot;: &quot;analytics#webproperty&quot;, # Type of the parent link. Set to &quot;analytics#webproperty&quot;.
Craig Citroe633be12015-03-02 13:40:36 -0800336 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700337 &quot;accountId&quot;: &quot;A String&quot;, # Account ID.
338 &quot;id&quot;: &quot;A String&quot;, # Custom metric ID.
339 &quot;max_value&quot;: &quot;A String&quot;, # Max value of custom metric.
340 &quot;min_value&quot;: &quot;A String&quot;, # Min value of custom metric.
341 &quot;webPropertyId&quot;: &quot;A String&quot;, # Property ID.
342 &quot;type&quot;: &quot;A String&quot;, # Data type of custom metric.
343 &quot;selfLink&quot;: &quot;A String&quot;, # Link for the custom metric
344 &quot;updated&quot;: &quot;A String&quot;, # Time the custom metric was last modified.
Craig Citroe633be12015-03-02 13:40:36 -0800345 }</pre>
346</div>
347
348</body></html>