John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 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="analytics_v3.html">Google Analytics API</a> . <a href="analytics_v3.data.html">data</a> . <a href="analytics_v3.data.ga.html">ga</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 78 | <code><a href="#close">close()</a></code></p> |
| 79 | <p class="firstline">Close httplib2 connections.</p> |
| 80 | <p class="toc_element"> |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 81 | <code><a href="#get">get(ids, start_date, end_date, metrics, include_empty_rows=None, start_index=None, max_results=None, dimensions=None, segment=None, filters=None, samplingLevel=None, output=None, sort=None)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 82 | <p class="firstline">Returns Analytics data for a view (profile).</p> |
| 83 | <h3>Method Details</h3> |
| 84 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 85 | <code class="details" id="close">close()</code> |
| 86 | <pre>Close httplib2 connections.</pre> |
| 87 | </div> |
| 88 | |
| 89 | <div class="method"> |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 90 | <code class="details" id="get">get(ids, start_date, end_date, metrics, include_empty_rows=None, start_index=None, max_results=None, dimensions=None, segment=None, filters=None, samplingLevel=None, output=None, sort=None)</code> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 91 | <pre>Returns Analytics data for a view (profile). |
| 92 | |
| 93 | Args: |
| 94 | ids: string, Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. (required) |
| 95 | start_date: string, Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo. (required) |
| 96 | end_date: string, End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday. (required) |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 97 | metrics: string, A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified. (required) |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 98 | include_empty_rows: boolean, The response will include empty rows if this parameter is set to true, the default is true |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 99 | start_index: integer, An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 100 | max_results: integer, The maximum number of entries to include in this feed. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 101 | dimensions: string, A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'. |
| 102 | segment: string, An Analytics segment to be applied to data. |
| 103 | filters: string, A comma-separated list of dimension or metric filters to be applied to Analytics data. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 104 | samplingLevel: string, The desired sampling level. |
| 105 | Allowed values |
| 106 | DEFAULT - Returns response with a sample size that balances speed and accuracy. |
| 107 | FASTER - Returns a fast response with a smaller sample size. |
| 108 | HIGHER_PRECISION - Returns a more accurate response using a large sample size, but this may result in the response being slower. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 109 | output: string, The selected format for the response. Default format is JSON. |
| 110 | Allowed values |
| 111 | dataTable - Returns the response in Google Charts Data Table format. This is useful in creating visualization using Google Charts. |
| 112 | json - Returns the response in standard JSON format. |
| 113 | sort: string, A comma-separated list of dimensions or metrics that determine the sort order for Analytics data. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 114 | |
| 115 | Returns: |
| 116 | An object of the form: |
| 117 | |
| 118 | { # Analytics data for a given view (profile). |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 119 | "dataTable": { |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 120 | "rows": [ |
| 121 | { |
| 122 | "c": [ |
| 123 | { |
| 124 | "v": "A String", |
| 125 | }, |
| 126 | ], |
| 127 | }, |
| 128 | ], |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 129 | "cols": [ |
| 130 | { |
| 131 | "label": "A String", |
| 132 | "id": "A String", |
| 133 | "type": "A String", |
| 134 | }, |
| 135 | ], |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 136 | }, |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 137 | "containsSampledData": True or False, # Determines if Analytics data contains samples. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 138 | "query": { # Analytics data request query parameters. |
| 139 | "filters": "A String", # Comma-separated list of dimension or metric filters. |
| 140 | "start-index": 42, # Start index. |
| 141 | "samplingLevel": "A String", # Desired sampling level |
| 142 | "segment": "A String", # Analytics advanced segment. |
| 143 | "max-results": 42, # Maximum results per page. |
| 144 | "ids": "A String", # Unique table ID. |
| 145 | "metrics": [ # List of analytics metrics. |
| 146 | "A String", |
| 147 | ], |
| 148 | "sort": [ # List of dimensions or metrics based on which Analytics data is sorted. |
| 149 | "A String", |
| 150 | ], |
| 151 | "start-date": "A String", # Start date. |
| 152 | "end-date": "A String", # End date. |
| 153 | "dimensions": "A String", # List of analytics dimensions. |
| 154 | }, |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 155 | "profileInfo": { # Information for the view (profile), for which the Analytics data was requested. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 156 | "webPropertyId": "A String", # Web Property ID to which this view (profile) belongs. |
| 157 | "accountId": "A String", # Account ID to which this view (profile) belongs. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 158 | "internalWebPropertyId": "A String", # Internal ID for the web property to which this view (profile) belongs. |
| 159 | "profileName": "A String", # View (Profile) name. |
Bu Sun Kim | 673ec5c | 2020-11-16 11:05:03 -0700 | [diff] [blame] | 160 | "profileId": "A String", # View (Profile) ID. |
| 161 | "tableId": "A String", # Table ID for view (profile). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 162 | }, |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 163 | "dataLastRefreshed": "A String", # The last refreshed time in seconds for Analytics data. |
| 164 | "sampleSize": "A String", # The number of samples used to calculate the result. |
| 165 | "kind": "analytics#gaData", # Resource type. |
| 166 | "columnHeaders": [ # Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request. |
| 167 | { |
| 168 | "dataType": "A String", # Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, CURRENCY etc. |
| 169 | "columnType": "A String", # Column Type. Either DIMENSION or METRIC. |
| 170 | "name": "A String", # Column name. |
| 171 | }, |
| 172 | ], |
| 173 | "totalResults": 42, # The total number of rows for the query, regardless of the number of rows in the response. |
| 174 | "previousLink": "A String", # Link to previous page for this Analytics data query. |
| 175 | "nextLink": "A String", # Link to next page for this Analytics data query. |
| 176 | "sampleSpace": "A String", # Total size of the sample space from which the samples were selected. |
| 177 | "id": "A String", # Unique ID for this data response. |
| 178 | "itemsPerPage": 42, # The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value of 1000 by default, or otherwise specified by the max-results query parameter. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 179 | "rows": [ # Analytics data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as specified in the request. |
| 180 | [ |
| 181 | "A String", |
| 182 | ], |
| 183 | ], |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 184 | "totalsForAllResults": { # Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as the metric order specified in the request. |
| 185 | "a_key": "A String", # Key-value pair for the total value of a metric. Key is the metric name and the value is the total value for that metric. |
| 186 | }, |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame^] | 187 | "selfLink": "A String", # Link to this page. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 188 | }</pre> |
| 189 | </div> |
| 190 | |
| 191 | </body></html> |