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