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