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="analyticsreporting_v4.html">Analytics Reporting API</a> . <a href="analyticsreporting_v4.reports.html">reports</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#batchGet">batchGet(body, x__xgafv=None)</a></code></p> 79<p class="firstline">Returns the Analytics data.</p> 80<h3>Method Details</h3> 81<div class="method"> 82 <code class="details" id="batchGet">batchGet(body, x__xgafv=None)</code> 83 <pre>Returns the Analytics data. 84 85Args: 86 body: object, The request body. (required) 87 The object takes the form of: 88 89{ # The batch request containing multiple report request. 90 "reportRequests": [ # Requests, each request will have a separate response. 91 # There can be a maximum of 5 requests. All requests should have the same 92 # `dateRanges`, `viewId`, `segments`, `samplingLevel`, and `cohortGroup`. 93 { # The main request class which specifies the Reporting API request. 94 "dateRanges": [ # Date ranges in the request. The request can have a maximum of 2 date 95 # ranges. The response will contain a set of metric values for each 96 # combination of the dimensions for each date range in the request. So, if 97 # there are two date ranges, there will be two set of metric values, one for 98 # the original date range and one for the second date range. 99 # The `reportRequest.dateRanges` field should not be specified for cohorts 100 # or Lifetime value requests. 101 # If a date range is not provided, the default date range is (startDate: 102 # current date - 7 days, endDate: current date - 1 day). Every 103 # [ReportRequest](#ReportRequest) within a `batchGet` method must 104 # contain the same `dateRanges` definition. 105 { # A contiguous set of days: startDate, startDate + 1 day, ..., endDate. 106 # The start and end dates are specified in 107 # [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`. 108 "startDate": "A String", # The start date for the query in the format `YYYY-MM-DD`. 109 "endDate": "A String", # The end date for the query in the format `YYYY-MM-DD`. 110 }, 111 ], 112 "hideTotals": True or False, # If set to true, hides the total of all metrics for all the matching rows, 113 # for every date range. The default false and will return the totals. 114 "pageSize": 42, # Page size is for paging and specifies the maximum number of returned rows. 115 # Page size should be >= 0. A query returns the default of 1,000 rows. 116 # The Analytics Core Reporting API returns a maximum of 100,000 rows per 117 # request, no matter how many you ask for. It can also return fewer rows 118 # than requested, if there aren't as many dimension segments as you expect. 119 # For instance, there are fewer than 300 possible values for `ga:country`, 120 # so when segmenting only by country, you can't get more than 300 rows, 121 # even if you set `pageSize` to a higher value. 122 "filtersExpression": "A String", # Dimension or metric filters that restrict the data returned for your 123 # request. To use the `filtersExpression`, supply a dimension or metric on 124 # which to filter, followed by the filter expression. For example, the 125 # following expression selects `ga:browser` dimension which starts with 126 # Firefox; `ga:browser=~^Firefox`. For more information on dimensions 127 # and metric filters, see 128 # [Filters reference](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters). 129 "pivots": [ # The pivot definitions. Requests can have a maximum of 2 pivots. 130 { # The Pivot describes the pivot section in the request. 131 # The Pivot helps rearrange the information in the table for certain reports 132 # by pivoting your data on a second dimension. 133 "metrics": [ # The pivot metrics. Pivot metrics are part of the 134 # restriction on total number of metrics allowed in the request. 135 { # [Metrics](https://support.google.com/analytics/answer/1033861) 136 # are the quantitative measurements. For example, the metric `ga:users` 137 # indicates the total number of users for the requested time period. 138 "alias": "A String", # An alias for the metric expression is an alternate name for the 139 # expression. The alias can be used for filtering and sorting. This field 140 # is optional and is useful if the expression is not a single metric but 141 # a complex expression which cannot be used in filtering and sorting. 142 # The alias is also used in the response column header. 143 "expression": "A String", # A metric expression in the request. An expression is constructed from one 144 # or more metrics and numbers. Accepted operators include: Plus (+), Minus 145 # (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis, 146 # Positive cardinal numbers (0-9), can include decimals and is limited to 147 # 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the 148 # metric expression is just a single metric name like `ga:users`. 149 # Adding mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics 150 # will result in unexpected results. 151 "formattingType": "A String", # Specifies how the metric expression should be formatted, for example 152 # `INTEGER`. 153 }, 154 ], 155 "dimensions": [ # A list of dimensions to show as pivot columns. A Pivot can have a maximum 156 # of 4 dimensions. Pivot dimensions are part of the restriction on the 157 # total number of dimensions allowed in the request. 158 { # [Dimensions](https://support.google.com/analytics/answer/1033861) 159 # are attributes of your data. For example, the dimension `ga:city` 160 # indicates the city, for example, "Paris" or "New York", from which 161 # a session originates. 162 "name": "A String", # Name of the dimension to fetch, for example `ga:browser`. 163 "histogramBuckets": [ # If non-empty, we place dimension values into buckets after string to 164 # int64. Dimension values that are not the string representation of an 165 # integral value will be converted to zero. The bucket values have to be in 166 # increasing order. Each bucket is closed on the lower end, and open on the 167 # upper end. The "first" bucket includes all values less than the first 168 # boundary, the "last" bucket includes all values up to infinity. Dimension 169 # values that fall in a bucket get transformed to a new dimension value. For 170 # example, if one gives a list of "0, 1, 3, 4, 7", then we return the 171 # following buckets: 172 # 173 # - bucket #1: values < 0, dimension value "<0" 174 # - bucket #2: values in [0,1), dimension value "0" 175 # - bucket #3: values in [1,3), dimension value "1-2" 176 # - bucket #4: values in [3,4), dimension value "3" 177 # - bucket #5: values in [4,7), dimension value "4-6" 178 # - bucket #6: values >= 7, dimension value "7+" 179 # 180 # NOTE: If you are applying histogram mutation on any dimension, and using 181 # that dimension in sort, you will want to use the sort type 182 # `HISTOGRAM_BUCKET` for that purpose. Without that the dimension values 183 # will be sorted according to dictionary 184 # (lexicographic) order. For example the ascending dictionary order is: 185 # 186 # "<50", "1001+", "121-1000", "50-120" 187 # 188 # And the ascending `HISTOGRAM_BUCKET` order is: 189 # 190 # "<50", "50-120", "121-1000", "1001+" 191 # 192 # The client has to explicitly request `"orderType": "HISTOGRAM_BUCKET"` 193 # for a histogram-mutated dimension. 194 "A String", 195 ], 196 }, 197 ], 198 "maxGroupCount": 42, # Specifies the maximum number of groups to return. 199 # The default value is 10, also the maximum value is 1,000. 200 "dimensionFilterClauses": [ # DimensionFilterClauses are logically combined with an `AND` operator: only 201 # data that is included by all these DimensionFilterClauses contributes to 202 # the values in this pivot region. Dimension filters can be used to restrict 203 # the columns shown in the pivot region. For example if you have 204 # `ga:browser` as the requested dimension in the pivot region, and you 205 # specify key filters to restrict `ga:browser` to only "IE" or "Firefox", 206 # then only those two browsers would show up as columns. 207 { # A group of dimension filters. Set the operator value to specify how 208 # the filters are logically combined. 209 "operator": "A String", # The operator for combining multiple dimension filters. If unspecified, it 210 # is treated as an `OR`. 211 "filters": [ # The repeated set of filters. They are logically combined based on the 212 # operator specified. 213 { # Dimension filter specifies the filtering options on a dimension. 214 "dimensionName": "A String", # The dimension to filter on. A DimensionFilter must contain a dimension. 215 "operator": "A String", # How to match the dimension to the expression. The default is REGEXP. 216 "expressions": [ # Strings or regular expression to match against. Only the first value of 217 # the list is used for comparison unless the operator is `IN_LIST`. 218 # If `IN_LIST` operator, then the entire list is used to filter the 219 # dimensions as explained in the description of the `IN_LIST` operator. 220 "A String", 221 ], 222 "not": True or False, # Logical `NOT` operator. If this boolean is set to true, then the matching 223 # dimension values will be excluded in the report. The default is false. 224 "caseSensitive": True or False, # Should the match be case sensitive? Default is false. 225 }, 226 ], 227 }, 228 ], 229 "startGroup": 42, # If k metrics were requested, then the response will contain some 230 # data-dependent multiple of k columns in the report. E.g., if you pivoted 231 # on the dimension `ga:browser` then you'd get k columns for "Firefox", k 232 # columns for "IE", k columns for "Chrome", etc. The ordering of the groups 233 # of columns is determined by descending order of "total" for the first of 234 # the k values. Ties are broken by lexicographic ordering of the first 235 # pivot dimension, then lexicographic ordering of the second pivot 236 # dimension, and so on. E.g., if the totals for the first value for 237 # Firefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns 238 # would be Chrome, Firefox, IE. 239 # 240 # The following let you choose which of the groups of k columns are 241 # included in the response. 242 }, 243 ], 244 "dimensionFilterClauses": [ # The dimension filter clauses for filtering Dimension Values. They are 245 # logically combined with the `AND` operator. Note that filtering occurs 246 # before any dimensions are aggregated, so that the returned metrics 247 # represent the total for only the relevant dimensions. 248 { # A group of dimension filters. Set the operator value to specify how 249 # the filters are logically combined. 250 "operator": "A String", # The operator for combining multiple dimension filters. If unspecified, it 251 # is treated as an `OR`. 252 "filters": [ # The repeated set of filters. They are logically combined based on the 253 # operator specified. 254 { # Dimension filter specifies the filtering options on a dimension. 255 "dimensionName": "A String", # The dimension to filter on. A DimensionFilter must contain a dimension. 256 "operator": "A String", # How to match the dimension to the expression. The default is REGEXP. 257 "expressions": [ # Strings or regular expression to match against. Only the first value of 258 # the list is used for comparison unless the operator is `IN_LIST`. 259 # If `IN_LIST` operator, then the entire list is used to filter the 260 # dimensions as explained in the description of the `IN_LIST` operator. 261 "A String", 262 ], 263 "not": True or False, # Logical `NOT` operator. If this boolean is set to true, then the matching 264 # dimension values will be excluded in the report. The default is false. 265 "caseSensitive": True or False, # Should the match be case sensitive? Default is false. 266 }, 267 ], 268 }, 269 ], 270 "viewId": "A String", # The Analytics 271 # [view ID](https://support.google.com/analytics/answer/1009618) 272 # from which to retrieve data. Every [ReportRequest](#ReportRequest) 273 # within a `batchGet` method must contain the same `viewId`. 274 "includeEmptyRows": True or False, # If set to false, the response does not include rows if all the retrieved 275 # metrics are equal to zero. The default is false which will exclude these 276 # rows. 277 "samplingLevel": "A String", # The desired report 278 # [sample](https://support.google.com/analytics/answer/2637192) size. 279 # If the the `samplingLevel` field is unspecified the `DEFAULT` sampling 280 # level is used. Every [ReportRequest](#ReportRequest) within a 281 # `batchGet` method must contain the same `samplingLevel` definition. See 282 # [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) 283 # for details. 284 "orderBys": [ # Sort order on output rows. To compare two rows, the elements of the 285 # following are applied in order until a difference is found. All date 286 # ranges in the output get the same row order. 287 { # Specifies the sorting options. 288 "orderType": "A String", # The order type. The default orderType is `VALUE`. 289 "fieldName": "A String", # The field which to sort by. The default sort order is ascending. Example: 290 # `ga:browser`. 291 # Note, that you can only specify one field for sort here. For example, 292 # `ga:browser, ga:city` is not valid. 293 "sortOrder": "A String", # The sorting order for the field. 294 }, 295 ], 296 "cohortGroup": { # Defines a cohort group. # Cohort group associated with this request. If there is a cohort group 297 # in the request the `ga:cohort` dimension must be present. 298 # Every [ReportRequest](#ReportRequest) within a `batchGet` method must 299 # contain the same `cohortGroup` definition. 300 # For example: 301 # 302 # "cohortGroup": { 303 # "cohorts": [{ 304 # "name": "cohort 1", 305 # "type": "FIRST_VISIT_DATE", 306 # "dateRange": { "startDate": "2015-08-01", "endDate": "2015-08-01" } 307 # },{ 308 # "name": "cohort 2" 309 # "type": "FIRST_VISIT_DATE" 310 # "dateRange": { "startDate": "2015-07-01", "endDate": "2015-07-01" } 311 # }] 312 # } 313 "cohorts": [ # The definition for the cohort. 314 { # Defines a cohort. A cohort is a group of users who share a common 315 # characteristic. For example, all users with the same acquisition date 316 # belong to the same cohort. 317 "dateRange": { # A contiguous set of days: startDate, startDate + 1 day, ..., endDate. # This is used for `FIRST_VISIT_DATE` cohort, the cohort selects users 318 # whose first visit date is between start date and end date defined in the 319 # DateRange. The date ranges should be aligned for cohort requests. If the 320 # request contains `ga:cohortNthDay` it should be exactly one day long, 321 # if `ga:cohortNthWeek` it should be aligned to the week boundary (starting 322 # at Sunday and ending Saturday), and for `ga:cohortNthMonth` the date range 323 # should be aligned to the month (starting at the first and ending on the 324 # last day of the month). 325 # For LTV requests there are no such restrictions. 326 # You do not need to supply a date range for the 327 # `reportsRequest.dateRanges` field. 328 # The start and end dates are specified in 329 # [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`. 330 "startDate": "A String", # The start date for the query in the format `YYYY-MM-DD`. 331 "endDate": "A String", # The end date for the query in the format `YYYY-MM-DD`. 332 }, 333 "type": "A String", # Type of the cohort. The only supported type as of now is 334 # `FIRST_VISIT_DATE`. If this field is unspecified the cohort is treated 335 # as `FIRST_VISIT_DATE` type cohort. 336 "name": "A String", # A unique name for the cohort. If not defined name will be auto-generated 337 # with values cohort_[1234...]. 338 }, 339 ], 340 "lifetimeValue": True or False, # Enable Life Time Value (LTV). LTV measures lifetime value for users 341 # acquired through different channels. 342 # Please see: 343 # [Cohort Analysis](https://support.google.com/analytics/answer/6074676) and 344 # [Lifetime Value](https://support.google.com/analytics/answer/6182550) 345 # If the value of lifetimeValue is false: 346 # 347 # - The metric values are similar to the values in the web interface cohort 348 # report. 349 # - The cohort definition date ranges must be aligned to the calendar week 350 # and month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in 351 # the cohort definition should be a Sunday and the `endDate` should be the 352 # following Saturday, and for `ga:cohortNthMonth`, the `startDate` 353 # should be the 1st of the month and `endDate` should be the last day 354 # of the month. 355 # 356 # When the lifetimeValue is true: 357 # 358 # - The metric values will correspond to the values in the web interface 359 # LifeTime value report. 360 # - The Lifetime Value report shows you how user value (Revenue) and 361 # engagement (Appviews, Goal Completions, Sessions, and Session Duration) 362 # grow during the 90 days after a user is acquired. 363 # - The metrics are calculated as a cumulative average per user per the time 364 # increment. 365 # - The cohort definition date ranges need not be aligned to the calendar 366 # week and month boundaries. 367 # - The `viewId` must be an 368 # [app view ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews) 369 }, 370 "metrics": [ # The metrics requested. 371 # Requests must specify at least one metric. Requests can have a 372 # total of 10 metrics. 373 { # [Metrics](https://support.google.com/analytics/answer/1033861) 374 # are the quantitative measurements. For example, the metric `ga:users` 375 # indicates the total number of users for the requested time period. 376 "alias": "A String", # An alias for the metric expression is an alternate name for the 377 # expression. The alias can be used for filtering and sorting. This field 378 # is optional and is useful if the expression is not a single metric but 379 # a complex expression which cannot be used in filtering and sorting. 380 # The alias is also used in the response column header. 381 "expression": "A String", # A metric expression in the request. An expression is constructed from one 382 # or more metrics and numbers. Accepted operators include: Plus (+), Minus 383 # (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis, 384 # Positive cardinal numbers (0-9), can include decimals and is limited to 385 # 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the 386 # metric expression is just a single metric name like `ga:users`. 387 # Adding mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics 388 # will result in unexpected results. 389 "formattingType": "A String", # Specifies how the metric expression should be formatted, for example 390 # `INTEGER`. 391 }, 392 ], 393 "pageToken": "A String", # A continuation token to get the next page of the results. Adding this to 394 # the request will return the rows after the pageToken. The pageToken should 395 # be the value returned in the nextPageToken parameter in the response to 396 # the GetReports request. 397 "hideValueRanges": True or False, # If set to true, hides the minimum and maximum across all matching rows. 398 # The default is false and the value ranges are returned. 399 "metricFilterClauses": [ # The metric filter clauses. They are logically combined with the `AND` 400 # operator. Metric filters look at only the first date range and not the 401 # comparing date range. Note that filtering on metrics occurs after the 402 # metrics are aggregated. 403 { # Represents a group of metric filters. 404 # Set the operator value to specify how the filters are logically combined. 405 "operator": "A String", # The operator for combining multiple metric filters. If unspecified, it is 406 # treated as an `OR`. 407 "filters": [ # The repeated set of filters. They are logically combined based on the 408 # operator specified. 409 { # MetricFilter specifies the filter on a metric. 410 "operator": "A String", # Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the 411 # comparisonValue, the default is `EQUAL`. If the operator is 412 # `IS_MISSING`, checks if the metric is missing and would ignore the 413 # comparisonValue. 414 "not": True or False, # Logical `NOT` operator. If this boolean is set to true, then the matching 415 # metric values will be excluded in the report. The default is false. 416 "comparisonValue": "A String", # The value to compare against. 417 "metricName": "A String", # The metric that will be filtered on. A metricFilter must contain a metric 418 # name. A metric name can be an alias earlier defined as a metric or it can 419 # also be a metric expression. 420 }, 421 ], 422 }, 423 ], 424 "segments": [ # Segment the data returned for the request. A segment definition helps look 425 # at a subset of the segment request. A request can contain up to four 426 # segments. Every [ReportRequest](#ReportRequest) within a 427 # `batchGet` method must contain the same `segments` definition. Requests 428 # with segments must have the `ga:segment` dimension. 429 { # The segment definition, if the report needs to be segmented. 430 # A Segment is a subset of the Analytics data. For example, of the entire 431 # set of users, one Segment might be users from a particular country or city. 432 "dynamicSegment": { # Dynamic segment definition for defining the segment within the request. # A dynamic segment definition in the request. 433 # A segment can select users, sessions or both. 434 "sessionSegment": { # SegmentDefinition defines the segment to be a set of SegmentFilters which # Session Segment to select sessions to include in the segment. 435 # are combined together with a logical `AND` operation. 436 "segmentFilters": [ # A segment is defined by a set of segment filters which are combined 437 # together with a logical `AND` operation. 438 { # SegmentFilter defines the segment to be either a simple or a sequence 439 # segment. A simple segment condition contains dimension and metric conditions 440 # to select the sessions or users. A sequence segment condition can be used to 441 # select users or sessions based on sequential conditions. 442 "not": True or False, # If true, match the complement of simple or sequence segment. 443 # For example, to match all visits not from "New York", we can define the 444 # segment as follows: 445 # 446 # "sessionSegment": { 447 # "segmentFilters": [{ 448 # "simpleSegment" :{ 449 # "orFiltersForSegment": [{ 450 # "segmentFilterClauses":[{ 451 # "dimensionFilter": { 452 # "dimensionName": "ga:city", 453 # "expressions": ["New York"] 454 # } 455 # }] 456 # }] 457 # }, 458 # "not": "True" 459 # }] 460 # }, 461 "simpleSegment": { # A Simple segment conditions consist of one or more dimension/metric # A Simple segment conditions consist of one or more dimension/metric 462 # conditions that can be combined 463 # conditions that can be combined. 464 "orFiltersForSegment": [ # A list of segment filters groups which are combined with logical `AND` 465 # operator. 466 { # A list of segment filters in the `OR` group are combined with the logical OR 467 # operator. 468 "segmentFilterClauses": [ # List of segment filters to be combined with a `OR` operator. 469 { # Filter Clause to be used in a segment definition, can be wither a metric or 470 # a dimension filter. 471 "not": True or False, # Matches the complement (`!`) of the filter. 472 "dimensionFilter": { # Dimension filter specifies the filtering options on a dimension. # Dimension Filter for the segment definition. 473 "minComparisonValue": "A String", # Minimum comparison values for `BETWEEN` match type. 474 "maxComparisonValue": "A String", # Maximum comparison values for `BETWEEN` match type. 475 "dimensionName": "A String", # Name of the dimension for which the filter is being applied. 476 "caseSensitive": True or False, # Should the match be case sensitive, ignored for `IN_LIST` operator. 477 "operator": "A String", # The operator to use to match the dimension with the expressions. 478 "expressions": [ # The list of expressions, only the first element is used for all operators 479 "A String", 480 ], 481 }, 482 "metricFilter": { # Metric filter to be used in a segment filter clause. # Metric Filter for the segment definition. 483 "operator": "A String", # Specifies is the operation to perform to compare the metric. The default 484 # is `EQUAL`. 485 "scope": "A String", # Scope for a metric defines the level at which that metric is defined. The 486 # specified metric scope must be equal to or greater than its primary scope 487 # as defined in the data model. The primary scope is defined by if the 488 # segment is selecting users or sessions. 489 "comparisonValue": "A String", # The value to compare against. If the operator is `BETWEEN`, this value is 490 # treated as minimum comparison value. 491 "maxComparisonValue": "A String", # Max comparison value is only used for `BETWEEN` operator. 492 "metricName": "A String", # The metric that will be filtered on. A `metricFilter` must contain a 493 # metric name. 494 }, 495 }, 496 ], 497 }, 498 ], 499 }, 500 "sequenceSegment": { # Sequence conditions consist of one or more steps, where each step is defined # Sequence conditions consist of one or more steps, where each step is 501 # defined by one or more dimension/metric conditions. Multiple steps can 502 # be combined with special sequence operators. 503 # by one or more dimension/metric conditions. Multiple steps can be combined 504 # with special sequence operators. 505 "segmentSequenceSteps": [ # The list of steps in the sequence. 506 { # A segment sequence definition. 507 "matchType": "A String", # Specifies if the step immediately precedes or can be any time before the 508 # next step. 509 "orFiltersForSegment": [ # A sequence is specified with a list of Or grouped filters which are 510 # combined with `AND` operator. 511 { # A list of segment filters in the `OR` group are combined with the logical OR 512 # operator. 513 "segmentFilterClauses": [ # List of segment filters to be combined with a `OR` operator. 514 { # Filter Clause to be used in a segment definition, can be wither a metric or 515 # a dimension filter. 516 "not": True or False, # Matches the complement (`!`) of the filter. 517 "dimensionFilter": { # Dimension filter specifies the filtering options on a dimension. # Dimension Filter for the segment definition. 518 "minComparisonValue": "A String", # Minimum comparison values for `BETWEEN` match type. 519 "maxComparisonValue": "A String", # Maximum comparison values for `BETWEEN` match type. 520 "dimensionName": "A String", # Name of the dimension for which the filter is being applied. 521 "caseSensitive": True or False, # Should the match be case sensitive, ignored for `IN_LIST` operator. 522 "operator": "A String", # The operator to use to match the dimension with the expressions. 523 "expressions": [ # The list of expressions, only the first element is used for all operators 524 "A String", 525 ], 526 }, 527 "metricFilter": { # Metric filter to be used in a segment filter clause. # Metric Filter for the segment definition. 528 "operator": "A String", # Specifies is the operation to perform to compare the metric. The default 529 # is `EQUAL`. 530 "scope": "A String", # Scope for a metric defines the level at which that metric is defined. The 531 # specified metric scope must be equal to or greater than its primary scope 532 # as defined in the data model. The primary scope is defined by if the 533 # segment is selecting users or sessions. 534 "comparisonValue": "A String", # The value to compare against. If the operator is `BETWEEN`, this value is 535 # treated as minimum comparison value. 536 "maxComparisonValue": "A String", # Max comparison value is only used for `BETWEEN` operator. 537 "metricName": "A String", # The metric that will be filtered on. A `metricFilter` must contain a 538 # metric name. 539 }, 540 }, 541 ], 542 }, 543 ], 544 }, 545 ], 546 "firstStepShouldMatchFirstHit": True or False, # If set, first step condition must match the first hit of the visitor (in 547 # the date range). 548 }, 549 }, 550 ], 551 }, 552 "name": "A String", # The name of the dynamic segment. 553 "userSegment": { # SegmentDefinition defines the segment to be a set of SegmentFilters which # User Segment to select users to include in the segment. 554 # are combined together with a logical `AND` operation. 555 "segmentFilters": [ # A segment is defined by a set of segment filters which are combined 556 # together with a logical `AND` operation. 557 { # SegmentFilter defines the segment to be either a simple or a sequence 558 # segment. A simple segment condition contains dimension and metric conditions 559 # to select the sessions or users. A sequence segment condition can be used to 560 # select users or sessions based on sequential conditions. 561 "not": True or False, # If true, match the complement of simple or sequence segment. 562 # For example, to match all visits not from "New York", we can define the 563 # segment as follows: 564 # 565 # "sessionSegment": { 566 # "segmentFilters": [{ 567 # "simpleSegment" :{ 568 # "orFiltersForSegment": [{ 569 # "segmentFilterClauses":[{ 570 # "dimensionFilter": { 571 # "dimensionName": "ga:city", 572 # "expressions": ["New York"] 573 # } 574 # }] 575 # }] 576 # }, 577 # "not": "True" 578 # }] 579 # }, 580 "simpleSegment": { # A Simple segment conditions consist of one or more dimension/metric # A Simple segment conditions consist of one or more dimension/metric 581 # conditions that can be combined 582 # conditions that can be combined. 583 "orFiltersForSegment": [ # A list of segment filters groups which are combined with logical `AND` 584 # operator. 585 { # A list of segment filters in the `OR` group are combined with the logical OR 586 # operator. 587 "segmentFilterClauses": [ # List of segment filters to be combined with a `OR` operator. 588 { # Filter Clause to be used in a segment definition, can be wither a metric or 589 # a dimension filter. 590 "not": True or False, # Matches the complement (`!`) of the filter. 591 "dimensionFilter": { # Dimension filter specifies the filtering options on a dimension. # Dimension Filter for the segment definition. 592 "minComparisonValue": "A String", # Minimum comparison values for `BETWEEN` match type. 593 "maxComparisonValue": "A String", # Maximum comparison values for `BETWEEN` match type. 594 "dimensionName": "A String", # Name of the dimension for which the filter is being applied. 595 "caseSensitive": True or False, # Should the match be case sensitive, ignored for `IN_LIST` operator. 596 "operator": "A String", # The operator to use to match the dimension with the expressions. 597 "expressions": [ # The list of expressions, only the first element is used for all operators 598 "A String", 599 ], 600 }, 601 "metricFilter": { # Metric filter to be used in a segment filter clause. # Metric Filter for the segment definition. 602 "operator": "A String", # Specifies is the operation to perform to compare the metric. The default 603 # is `EQUAL`. 604 "scope": "A String", # Scope for a metric defines the level at which that metric is defined. The 605 # specified metric scope must be equal to or greater than its primary scope 606 # as defined in the data model. The primary scope is defined by if the 607 # segment is selecting users or sessions. 608 "comparisonValue": "A String", # The value to compare against. If the operator is `BETWEEN`, this value is 609 # treated as minimum comparison value. 610 "maxComparisonValue": "A String", # Max comparison value is only used for `BETWEEN` operator. 611 "metricName": "A String", # The metric that will be filtered on. A `metricFilter` must contain a 612 # metric name. 613 }, 614 }, 615 ], 616 }, 617 ], 618 }, 619 "sequenceSegment": { # Sequence conditions consist of one or more steps, where each step is defined # Sequence conditions consist of one or more steps, where each step is 620 # defined by one or more dimension/metric conditions. Multiple steps can 621 # be combined with special sequence operators. 622 # by one or more dimension/metric conditions. Multiple steps can be combined 623 # with special sequence operators. 624 "segmentSequenceSteps": [ # The list of steps in the sequence. 625 { # A segment sequence definition. 626 "matchType": "A String", # Specifies if the step immediately precedes or can be any time before the 627 # next step. 628 "orFiltersForSegment": [ # A sequence is specified with a list of Or grouped filters which are 629 # combined with `AND` operator. 630 { # A list of segment filters in the `OR` group are combined with the logical OR 631 # operator. 632 "segmentFilterClauses": [ # List of segment filters to be combined with a `OR` operator. 633 { # Filter Clause to be used in a segment definition, can be wither a metric or 634 # a dimension filter. 635 "not": True or False, # Matches the complement (`!`) of the filter. 636 "dimensionFilter": { # Dimension filter specifies the filtering options on a dimension. # Dimension Filter for the segment definition. 637 "minComparisonValue": "A String", # Minimum comparison values for `BETWEEN` match type. 638 "maxComparisonValue": "A String", # Maximum comparison values for `BETWEEN` match type. 639 "dimensionName": "A String", # Name of the dimension for which the filter is being applied. 640 "caseSensitive": True or False, # Should the match be case sensitive, ignored for `IN_LIST` operator. 641 "operator": "A String", # The operator to use to match the dimension with the expressions. 642 "expressions": [ # The list of expressions, only the first element is used for all operators 643 "A String", 644 ], 645 }, 646 "metricFilter": { # Metric filter to be used in a segment filter clause. # Metric Filter for the segment definition. 647 "operator": "A String", # Specifies is the operation to perform to compare the metric. The default 648 # is `EQUAL`. 649 "scope": "A String", # Scope for a metric defines the level at which that metric is defined. The 650 # specified metric scope must be equal to or greater than its primary scope 651 # as defined in the data model. The primary scope is defined by if the 652 # segment is selecting users or sessions. 653 "comparisonValue": "A String", # The value to compare against. If the operator is `BETWEEN`, this value is 654 # treated as minimum comparison value. 655 "maxComparisonValue": "A String", # Max comparison value is only used for `BETWEEN` operator. 656 "metricName": "A String", # The metric that will be filtered on. A `metricFilter` must contain a 657 # metric name. 658 }, 659 }, 660 ], 661 }, 662 ], 663 }, 664 ], 665 "firstStepShouldMatchFirstHit": True or False, # If set, first step condition must match the first hit of the visitor (in 666 # the date range). 667 }, 668 }, 669 ], 670 }, 671 }, 672 "segmentId": "A String", # The segment ID of a built-in or custom segment, for example `gaid::-3`. 673 }, 674 ], 675 "dimensions": [ # The dimensions requested. 676 # Requests can have a total of 7 dimensions. 677 { # [Dimensions](https://support.google.com/analytics/answer/1033861) 678 # are attributes of your data. For example, the dimension `ga:city` 679 # indicates the city, for example, "Paris" or "New York", from which 680 # a session originates. 681 "name": "A String", # Name of the dimension to fetch, for example `ga:browser`. 682 "histogramBuckets": [ # If non-empty, we place dimension values into buckets after string to 683 # int64. Dimension values that are not the string representation of an 684 # integral value will be converted to zero. The bucket values have to be in 685 # increasing order. Each bucket is closed on the lower end, and open on the 686 # upper end. The "first" bucket includes all values less than the first 687 # boundary, the "last" bucket includes all values up to infinity. Dimension 688 # values that fall in a bucket get transformed to a new dimension value. For 689 # example, if one gives a list of "0, 1, 3, 4, 7", then we return the 690 # following buckets: 691 # 692 # - bucket #1: values < 0, dimension value "<0" 693 # - bucket #2: values in [0,1), dimension value "0" 694 # - bucket #3: values in [1,3), dimension value "1-2" 695 # - bucket #4: values in [3,4), dimension value "3" 696 # - bucket #5: values in [4,7), dimension value "4-6" 697 # - bucket #6: values >= 7, dimension value "7+" 698 # 699 # NOTE: If you are applying histogram mutation on any dimension, and using 700 # that dimension in sort, you will want to use the sort type 701 # `HISTOGRAM_BUCKET` for that purpose. Without that the dimension values 702 # will be sorted according to dictionary 703 # (lexicographic) order. For example the ascending dictionary order is: 704 # 705 # "<50", "1001+", "121-1000", "50-120" 706 # 707 # And the ascending `HISTOGRAM_BUCKET` order is: 708 # 709 # "<50", "50-120", "121-1000", "1001+" 710 # 711 # The client has to explicitly request `"orderType": "HISTOGRAM_BUCKET"` 712 # for a histogram-mutated dimension. 713 "A String", 714 ], 715 }, 716 ], 717 }, 718 ], 719 "useResourceQuotas": True or False, # Enables 720 # [resource based quotas](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4), 721 # (defaults to `False`). If this field is set to `True` the 722 # per view (profile) quotas are governed by the computational 723 # cost of the request. Note that using cost based quotas will 724 # higher enable sampling rates. (10 Million for `SMALL`, 725 # 100M for `LARGE`. See the 726 # [limits and quotas documentation](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4) for details. 727 } 728 729 x__xgafv: string, V1 error format. 730 Allowed values 731 1 - v1 error format 732 2 - v2 error format 733 734Returns: 735 An object of the form: 736 737 { # The main response class which holds the reports from the Reporting API 738 # `batchGet` call. 739 "queryCost": 42, # The amount of resource quota tokens deducted to execute the query. Includes 740 # all responses. 741 "resourceQuotasRemaining": { # The resource quota tokens remaining for the property after the request is # The amount of resource quota remaining for the property. 742 # completed. 743 "dailyQuotaTokensRemaining": 42, # Daily resource quota remaining remaining. 744 "hourlyQuotaTokensRemaining": 42, # Hourly resource quota tokens remaining. 745 }, 746 "reports": [ # Responses corresponding to each of the request. 747 { # The data response corresponding to the request. 748 "nextPageToken": "A String", # Page token to retrieve the next page of results in the list. 749 "data": { # The data part of the report. # Response data. 750 "rows": [ # There's one ReportRow for every unique combination of dimensions. 751 { # A row in the report. 752 "metrics": [ # List of metrics for each requested DateRange. 753 { # Used to return a list of metrics for a single DateRange / dimension 754 # combination 755 "values": [ # Each value corresponds to each Metric in the request. 756 "A String", 757 ], 758 "pivotValueRegions": [ # The values of each pivot region. 759 { # The metric values in the pivot region. 760 "values": [ # The values of the metrics in each of the pivot regions. 761 "A String", 762 ], 763 }, 764 ], 765 }, 766 ], 767 "dimensions": [ # List of requested dimensions. 768 "A String", 769 ], 770 }, 771 ], 772 "maximums": [ # Minimum and maximum values seen over all matching rows. These are both 773 # empty when `hideValueRanges` in the request is false, or when 774 # rowCount is zero. 775 { # Used to return a list of metrics for a single DateRange / dimension 776 # combination 777 "values": [ # Each value corresponds to each Metric in the request. 778 "A String", 779 ], 780 "pivotValueRegions": [ # The values of each pivot region. 781 { # The metric values in the pivot region. 782 "values": [ # The values of the metrics in each of the pivot regions. 783 "A String", 784 ], 785 }, 786 ], 787 }, 788 ], 789 "minimums": [ # Minimum and maximum values seen over all matching rows. These are both 790 # empty when `hideValueRanges` in the request is false, or when 791 # rowCount is zero. 792 { # Used to return a list of metrics for a single DateRange / dimension 793 # combination 794 "values": [ # Each value corresponds to each Metric in the request. 795 "A String", 796 ], 797 "pivotValueRegions": [ # The values of each pivot region. 798 { # The metric values in the pivot region. 799 "values": [ # The values of the metrics in each of the pivot regions. 800 "A String", 801 ], 802 }, 803 ], 804 }, 805 ], 806 "isDataGolden": True or False, # Indicates if response to this request is golden or not. Data is 807 # golden when the exact same request will not produce any new results if 808 # asked at a later point in time. 809 "samplingSpaceSizes": [ # If the results are 810 # [sampled](https://support.google.com/analytics/answer/2637192), 811 # this returns the total number of 812 # samples present, one entry per date range. If the results are not sampled 813 # this field will not be defined. See 814 # [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) 815 # for details. 816 "A String", 817 ], 818 "totals": [ # For each requested date range, for the set of all rows that match 819 # the query, every requested value format gets a total. The total 820 # for a value format is computed by first totaling the metrics 821 # mentioned in the value format and then evaluating the value 822 # format as a scalar expression. E.g., The "totals" for 823 # `3 / (ga:sessions + 2)` we compute 824 # `3 / ((sum of all relevant ga:sessions) + 2)`. 825 # Totals are computed before pagination. 826 { # Used to return a list of metrics for a single DateRange / dimension 827 # combination 828 "values": [ # Each value corresponds to each Metric in the request. 829 "A String", 830 ], 831 "pivotValueRegions": [ # The values of each pivot region. 832 { # The metric values in the pivot region. 833 "values": [ # The values of the metrics in each of the pivot regions. 834 "A String", 835 ], 836 }, 837 ], 838 }, 839 ], 840 "rowCount": 42, # Total number of matching rows for this query. 841 "dataLastRefreshed": "A String", # The last time the data in the report was refreshed. All the hits received 842 # before this timestamp are included in the calculation of the report. 843 "samplesReadCounts": [ # If the results are 844 # [sampled](https://support.google.com/analytics/answer/2637192), 845 # this returns the total number of samples read, one entry per date range. 846 # If the results are not sampled this field will not be defined. See 847 # [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) 848 # for details. 849 "A String", 850 ], 851 }, 852 "columnHeader": { # Column headers. # The column headers. 853 "dimensions": [ # The dimension names in the response. 854 "A String", 855 ], 856 "metricHeader": { # The headers for the metrics. # Metric headers for the metrics in the response. 857 "pivotHeaders": [ # Headers for the pivots in the response. 858 { # The headers for each of the pivot sections defined in the request. 859 "totalPivotGroupsCount": 42, # The total number of groups for this pivot. 860 "pivotHeaderEntries": [ # A single pivot section header. 861 { # The headers for the each of the metric column corresponding to the metrics 862 # requested in the pivots section of the response. 863 "dimensionValues": [ # The values for the dimensions in the pivot. 864 "A String", 865 ], 866 "dimensionNames": [ # The name of the dimensions in the pivot response. 867 "A String", 868 ], 869 "metric": { # Header for the metrics. # The metric header for the metric in the pivot. 870 "type": "A String", # The type of the metric, for example `INTEGER`. 871 "name": "A String", # The name of the header. 872 }, 873 }, 874 ], 875 }, 876 ], 877 "metricHeaderEntries": [ # Headers for the metrics in the response. 878 { # Header for the metrics. 879 "type": "A String", # The type of the metric, for example `INTEGER`. 880 "name": "A String", # The name of the header. 881 }, 882 ], 883 }, 884 }, 885 }, 886 ], 887 }</pre> 888</div> 889 890</body></html>