• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<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">
81  <code><a href="#insert">insert(accountId, webPropertyId, body)</a></code></p>
82<p class="firstline">Create a new custom metric.</p>
83<p class="toc_element">
84  <code><a href="#list">list(accountId, webPropertyId, max_results=None, start_index=None)</a></code></p>
85<p class="firstline">Lists custom metrics to which the user has access.</p>
86<p class="toc_element">
87  <code><a href="#patch">patch(accountId, webPropertyId, customMetricId, body, ignoreCustomDataSourceLinks=None)</a></code></p>
88<p class="firstline">Updates an existing custom metric. This method supports patch semantics.</p>
89<p class="toc_element">
90  <code><a href="#update">update(accountId, webPropertyId, customMetricId, body, ignoreCustomDataSourceLinks=None)</a></code></p>
91<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.
106      "index": 42, # Index of the custom metric.
107      "kind": "analytics#customMetric", # Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field.
108      "name": "A String", # Name of the custom metric.
109      "created": "A String", # Time the custom metric was created.
110      "max_value": "A String", # Max value of custom metric.
111      "min_value": "A String", # Min value of custom metric.
112      "updated": "A String", # Time the custom metric was last modified.
113      "webPropertyId": "A String", # Property ID.
114      "active": True or False, # Boolean indicating whether the custom metric is active.
115      "scope": "A String", # Scope of the custom metric: HIT or PRODUCT.
116      "parentLink": { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
117        "href": "A String", # Link to the property to which the custom metric belongs.
118        "type": "analytics#webproperty", # Type of the parent link. Set to "analytics#webproperty".
119      },
120      "type": "A String", # Data type of custom metric.
121      "id": "A String", # Custom metric ID.
122      "selfLink": "A String", # Link for the custom metric
123      "accountId": "A String", # Account ID.
124    }</pre>
125</div>
126
127<div class="method">
128    <code class="details" id="insert">insert(accountId, webPropertyId, body)</code>
129  <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)
134  body: object, The request body. (required)
135    The object takes the form of:
136
137{ # JSON template for Analytics Custom Metric.
138    "index": 42, # Index of the custom metric.
139    "kind": "analytics#customMetric", # Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field.
140    "name": "A String", # Name of the custom metric.
141    "created": "A String", # Time the custom metric was created.
142    "max_value": "A String", # Max value of custom metric.
143    "min_value": "A String", # Min value of custom metric.
144    "updated": "A String", # Time the custom metric was last modified.
145    "webPropertyId": "A String", # Property ID.
146    "active": True or False, # Boolean indicating whether the custom metric is active.
147    "scope": "A String", # Scope of the custom metric: HIT or PRODUCT.
148    "parentLink": { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
149      "href": "A String", # Link to the property to which the custom metric belongs.
150      "type": "analytics#webproperty", # Type of the parent link. Set to "analytics#webproperty".
151    },
152    "type": "A String", # Data type of custom metric.
153    "id": "A String", # Custom metric ID.
154    "selfLink": "A String", # Link for the custom metric
155    "accountId": "A String", # Account ID.
156  }
157
158
159Returns:
160  An object of the form:
161
162    { # JSON template for Analytics Custom Metric.
163      "index": 42, # Index of the custom metric.
164      "kind": "analytics#customMetric", # Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field.
165      "name": "A String", # Name of the custom metric.
166      "created": "A String", # Time the custom metric was created.
167      "max_value": "A String", # Max value of custom metric.
168      "min_value": "A String", # Min value of custom metric.
169      "updated": "A String", # Time the custom metric was last modified.
170      "webPropertyId": "A String", # Property ID.
171      "active": True or False, # Boolean indicating whether the custom metric is active.
172      "scope": "A String", # Scope of the custom metric: HIT or PRODUCT.
173      "parentLink": { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
174        "href": "A String", # Link to the property to which the custom metric belongs.
175        "type": "analytics#webproperty", # Type of the parent link. Set to "analytics#webproperty".
176      },
177      "type": "A String", # Data type of custom metric.
178      "id": "A String", # Custom metric ID.
179      "selfLink": "A String", # Link for the custom metric
180      "accountId": "A String", # Account ID.
181    }</pre>
182</div>
183
184<div class="method">
185    <code class="details" id="list">list(accountId, webPropertyId, max_results=None, start_index=None)</code>
186  <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)
191  max_results: integer, The maximum number of custom metrics to include in this response.
192  start_index: integer, An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
193
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.
198    "username": "A String", # Email ID of the authenticated user
199    "kind": "analytics#customMetrics", # Collection type.
200    "items": [ # Collection of custom metrics.
201      { # JSON template for Analytics Custom Metric.
202          "index": 42, # Index of the custom metric.
203          "kind": "analytics#customMetric", # Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field.
204          "name": "A String", # Name of the custom metric.
205          "created": "A String", # Time the custom metric was created.
206          "max_value": "A String", # Max value of custom metric.
207          "min_value": "A String", # Min value of custom metric.
208          "updated": "A String", # Time the custom metric was last modified.
209          "webPropertyId": "A String", # Property ID.
210          "active": True or False, # Boolean indicating whether the custom metric is active.
211          "scope": "A String", # Scope of the custom metric: HIT or PRODUCT.
212          "parentLink": { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
213            "href": "A String", # Link to the property to which the custom metric belongs.
214            "type": "analytics#webproperty", # Type of the parent link. Set to "analytics#webproperty".
215          },
216          "type": "A String", # Data type of custom metric.
217          "id": "A String", # Custom metric ID.
218          "selfLink": "A String", # Link for the custom metric
219          "accountId": "A String", # Account ID.
220        },
221    ],
222    "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.
223    "previousLink": "A String", # Link to previous page for this custom metric collection.
224    "startIndex": 42, # The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
225    "nextLink": "A String", # Link to next page for this custom metric collection.
226    "totalResults": 42, # The total number of results for the query, regardless of the number of results in the response.
227  }</pre>
228</div>
229
230<div class="method">
231    <code class="details" id="patch">patch(accountId, webPropertyId, customMetricId, body, ignoreCustomDataSourceLinks=None)</code>
232  <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)
238  body: object, The request body. (required)
239    The object takes the form of:
240
241{ # JSON template for Analytics Custom Metric.
242    "index": 42, # Index of the custom metric.
243    "kind": "analytics#customMetric", # Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field.
244    "name": "A String", # Name of the custom metric.
245    "created": "A String", # Time the custom metric was created.
246    "max_value": "A String", # Max value of custom metric.
247    "min_value": "A String", # Min value of custom metric.
248    "updated": "A String", # Time the custom metric was last modified.
249    "webPropertyId": "A String", # Property ID.
250    "active": True or False, # Boolean indicating whether the custom metric is active.
251    "scope": "A String", # Scope of the custom metric: HIT or PRODUCT.
252    "parentLink": { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
253      "href": "A String", # Link to the property to which the custom metric belongs.
254      "type": "analytics#webproperty", # Type of the parent link. Set to "analytics#webproperty".
255    },
256    "type": "A String", # Data type of custom metric.
257    "id": "A String", # Custom metric ID.
258    "selfLink": "A String", # Link for the custom metric
259    "accountId": "A String", # Account ID.
260  }
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.
268      "index": 42, # Index of the custom metric.
269      "kind": "analytics#customMetric", # Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field.
270      "name": "A String", # Name of the custom metric.
271      "created": "A String", # Time the custom metric was created.
272      "max_value": "A String", # Max value of custom metric.
273      "min_value": "A String", # Min value of custom metric.
274      "updated": "A String", # Time the custom metric was last modified.
275      "webPropertyId": "A String", # Property ID.
276      "active": True or False, # Boolean indicating whether the custom metric is active.
277      "scope": "A String", # Scope of the custom metric: HIT or PRODUCT.
278      "parentLink": { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
279        "href": "A String", # Link to the property to which the custom metric belongs.
280        "type": "analytics#webproperty", # Type of the parent link. Set to "analytics#webproperty".
281      },
282      "type": "A String", # Data type of custom metric.
283      "id": "A String", # Custom metric ID.
284      "selfLink": "A String", # Link for the custom metric
285      "accountId": "A String", # Account ID.
286    }</pre>
287</div>
288
289<div class="method">
290    <code class="details" id="update">update(accountId, webPropertyId, customMetricId, body, ignoreCustomDataSourceLinks=None)</code>
291  <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)
297  body: object, The request body. (required)
298    The object takes the form of:
299
300{ # JSON template for Analytics Custom Metric.
301    "index": 42, # Index of the custom metric.
302    "kind": "analytics#customMetric", # Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field.
303    "name": "A String", # Name of the custom metric.
304    "created": "A String", # Time the custom metric was created.
305    "max_value": "A String", # Max value of custom metric.
306    "min_value": "A String", # Min value of custom metric.
307    "updated": "A String", # Time the custom metric was last modified.
308    "webPropertyId": "A String", # Property ID.
309    "active": True or False, # Boolean indicating whether the custom metric is active.
310    "scope": "A String", # Scope of the custom metric: HIT or PRODUCT.
311    "parentLink": { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
312      "href": "A String", # Link to the property to which the custom metric belongs.
313      "type": "analytics#webproperty", # Type of the parent link. Set to "analytics#webproperty".
314    },
315    "type": "A String", # Data type of custom metric.
316    "id": "A String", # Custom metric ID.
317    "selfLink": "A String", # Link for the custom metric
318    "accountId": "A String", # Account ID.
319  }
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.
327      "index": 42, # Index of the custom metric.
328      "kind": "analytics#customMetric", # Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field.
329      "name": "A String", # Name of the custom metric.
330      "created": "A String", # Time the custom metric was created.
331      "max_value": "A String", # Max value of custom metric.
332      "min_value": "A String", # Min value of custom metric.
333      "updated": "A String", # Time the custom metric was last modified.
334      "webPropertyId": "A String", # Property ID.
335      "active": True or False, # Boolean indicating whether the custom metric is active.
336      "scope": "A String", # Scope of the custom metric: HIT or PRODUCT.
337      "parentLink": { # Parent link for the custom metric. Points to the property to which the custom metric belongs.
338        "href": "A String", # Link to the property to which the custom metric belongs.
339        "type": "analytics#webproperty", # Type of the parent link. Set to "analytics#webproperty".
340      },
341      "type": "A String", # Data type of custom metric.
342      "id": "A String", # Custom metric ID.
343      "selfLink": "A String", # Link for the custom metric
344      "accountId": "A String", # Account ID.
345    }</pre>
346</div>
347
348</body></html>