1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
|
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="analyticsreporting_v4.html">Analytics Reporting API</a> . <a href="analyticsreporting_v4.userActivity.html">userActivity</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#search">search(body, x__xgafv=None)</a></code></p>
<p class="firstline">Returns User Activity data.</p>
<p class="toc_element">
<code><a href="#search_next">search_next(previous_request, previous_response)</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="search">search(body, x__xgafv=None)</code>
<pre>Returns User Activity data.
Args:
body: object, The request body. (required)
The object takes the form of:
{ # The request to fetch User Report from Reporting API `userActivity:get` call.
"pageSize": 42, # Page size is for paging and specifies the maximum number of returned rows.
# Page size should be > 0. If the value is 0 or if the field isn't specified,
# the request returns the default of 1000 rows per page.
"dateRange": { # A contiguous set of days: startDate, startDate + 1 day, ..., endDate. # Date range for which to retrieve the user activity. If a date range is not
# provided, the default date range is (startDate: current date - 7 days,
# endDate: current date - 1 day).
# The start and end dates are specified in
# [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`.
"startDate": "A String", # The start date for the query in the format `YYYY-MM-DD`.
"endDate": "A String", # The end date for the query in the format `YYYY-MM-DD`.
},
"activityTypes": [ # Set of all activity types being requested. Only acvities matching these
# types will be returned in the response. If empty, all activies will be
# returned.
"A String",
],
"pageToken": "A String", # A continuation token to get the next page of the results. Adding this to
# the request will return the rows after the pageToken. The pageToken should
# be the value returned in the nextPageToken parameter in the response to
# the [SearchUserActivityRequest](#SearchUserActivityRequest) request.
"user": { # Contains information to identify a particular user uniquely. # Required. Unique user Id to query for. Every
# [SearchUserActivityRequest](#SearchUserActivityRequest) must contain this
# field.
"type": "A String", # Type of the user in the request. The field `userId` is associated with this
# type.
"userId": "A String", # Unique Id of the user for which the data is being requested.
},
"viewId": "A String", # Required. The Analytics
# [view ID](https://support.google.com/analytics/answer/1009618)
# from which to retrieve data. Every
# [SearchUserActivityRequest](#SearchUserActivityRequest) must contain the
# `viewId`.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # The response from `userActivity:get` call.
"nextPageToken": "A String", # This token should be passed to
# [SearchUserActivityRequest](#SearchUserActivityRequest) to retrieve the
# next page.
"sampleRate": 3.14, # This field represents the
# [sampling rate](https://support.google.com/analytics/answer/2637192) for
# the given request and is a number between 0.0 to 1.0. See
# [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)
# for details.
"totalRows": 42, # Total rows returned by this query (across different pages).
"sessions": [ # Each record represents a session (device details, duration, etc).
{ # This represents a user session performed on a specific device at a certain
# time over a period of time.
"activities": [ # Represents a detailed view into each of the activity in this session.
{ # An Activity represents data for an activity of a user. Note that an
# Activity is different from a hit.
# A hit might result in multiple Activity's. For example, if a hit
# includes a transaction and a goal completion, there will be two
# Activity protos for this hit, one for ECOMMERCE and one for GOAL.
# Conversely, multiple hits can also construct one Activity. In classic
# e-commerce, data for one transaction might be sent through multiple hits.
# These hits will be merged into one ECOMMERCE Activity.
"customDimension": [ # A list of all custom dimensions associated with this activity.
{ # Custom dimension.
"index": 42, # Slot number of custom dimension.
"value": "A String", # Value of the custom dimension. Default value (i.e. empty string) indicates
# clearing sesion/visitor scope custom dimension value.
},
],
"landingPagePath": "A String", # The first page in users' sessions, or the landing page.
"hostname": "A String", # The hostname from which the tracking request was made.
"ecommerce": { # E-commerce details associated with the user activity. # This will be set if `activity_type` equals `ECOMMERCE`.
"ecommerceType": "A String", # The type of this e-commerce activity.
"transaction": { # Represents details collected when the visitor performs a transaction on the # Transaction details of this e-commerce action.
# page.
"transactionTax": 3.14, # Total tax for the transaction.
"transactionId": "A String", # The transaction ID, supplied by the e-commerce tracking method, for the
# purchase in the shopping cart.
"transactionShipping": 3.14, # Total cost of shipping.
"transactionRevenue": 3.14, # The total sale revenue (excluding shipping and tax) of the transaction.
},
"actionType": "A String", # Action associated with this e-commerce action.
"products": [ # Details of the products in this transaction.
{ # Details of the products in an e-commerce transaction.
"productSku": "A String", # Unique code that represents the product.
"itemRevenue": 3.14, # The total revenue from purchased product items.
"productQuantity": "A String", # Total number of this product units in the transaction.
"productName": "A String", # The product name, supplied by the e-commerce tracking application, for
# the purchased items.
},
],
},
"keyword": "A String", # For manual campaign tracking, it is the value of the utm_term campaign
# tracking parameter. For AdWords traffic, it contains the best matching
# targeting criteria. For the display network, where multiple targeting
# criteria could have caused the ad to show up, it returns the best matching
# targeting criteria as selected by Ads. This could be display_keyword, site
# placement, boomuserlist, user_interest, age, or gender. Otherwise its value
# is (not set).
"campaign": "A String", # For manual campaign tracking, it is the value of the utm_campaign campaign
# tracking parameter. For AdWords autotagging, it is the name(s) of the
# online ad campaign(s) you use for the property. If you use neither, its
# value is (not set).
"activityType": "A String", # Type of this activity.
"pageview": { # Represents details collected when the visitor views a page. # This will be set if `activity_type` equals `PAGEVIEW`. This field
# contains all the details about the visitor and the page that was visited.
"pageTitle": "A String", # The title of the page that the visitor viewed.
"pagePath": "A String", # The URL of the page that the visitor viewed.
},
"appview": { # This will be set if `activity_type` equals `SCREEN_VIEW`.
"mobileDeviceBranding": "A String", # Mobile manufacturer or branded name. Eg: "Google", "Apple" etc.
"mobileDeviceModel": "A String", # Mobile device model. Eg: "Pixel", "iPhone" etc.
"appName": "A String", # The application name.
"screenName": "A String", # The name of the screen.
},
"source": "A String", # The source of referrals. For manual campaign tracking, it is the value of
# the utm_source campaign tracking parameter. For AdWords autotagging, it is
# google. If you use neither, it is the domain of the source
# (e.g., document.referrer) referring the users. It may also contain a port
# address. If users arrived without a referrer, its value is (direct).
"medium": "A String", # The type of referrals. For manual campaign tracking, it is the value of the
# utm_medium campaign tracking parameter. For AdWords autotagging, it is cpc.
# If users came from a search engine detected by Google Analytics, it is
# organic. If the referrer is not a search engine, it is referral. If users
# came directly to the property and document.referrer is empty, its value is
# (none).
"channelGrouping": "A String", # The Channel Group associated with an end user's session for this View
# (defined by the View's Channel Groupings).
"activityTime": "A String", # Timestamp of the activity.
"event": { # Represents all the details pertaining to an event. # This field contains all the details pertaining to an event and will be
# set if `activity_type` equals `EVENT`.
"eventLabel": "A String", # Label attached with the event.
"eventValue": "A String", # Numeric value associated with the event.
"eventAction": "A String", # Type of interaction with the object. Eg: 'play'.
"eventCategory": "A String", # The object on the page that was interacted with. Eg: 'Video'.
"eventCount": "A String", # Number of such events in this activity.
},
"goals": { # Represents a set of goals that were reached in an activity. # This field contains a list of all the goals that were reached in this
# activity when `activity_type` equals `GOAL`.
"goals": [ # All the goals that were reached in the current activity.
{ # Represents all the details pertaining to a goal.
"goalCompletions": "A String", # Total number of goal completions in this activity.
"goalValue": 3.14, # Value in this goal.
"goalName": "A String", # Name of the goal.
"goalPreviousStep1": "A String", # URL of the page one step prior to the goal completion.
"goalPreviousStep3": "A String", # URL of the page three steps prior to the goal completion.
"goalPreviousStep2": "A String", # URL of the page two steps prior to the goal completion.
"goalIndex": 42, # This identifies the goal as configured for the profile.
"goalCompletionLocation": "A String", # URL of the page where this goal was completed.
},
],
},
},
],
"sessionDate": "A String", # Date of this session in ISO-8601 format.
"deviceCategory": "A String", # The type of device used: "mobile", "tablet" etc.
"platform": "A String", # Platform on which the activity happened: "android", "ios" etc.
"sessionId": "A String", # Unique ID of the session.
"dataSource": "A String", # The data source of a hit. By default, hits sent from analytics.js are
# reported as "web" and hits sent from the mobile SDKs are reported as "app".
# These values can be overridden in the Measurement Protocol.
},
],
}</pre>
</div>
<div class="method">
<code class="details" id="search_next">search_next(previous_request, previous_response)</code>
<pre>Retrieves the next page of results.
Args:
previous_request: The request for the previous page. (required)
previous_response: The response from the request for the previous page. (required)
Returns:
A request object that you can call 'execute()' on to request the next
page. Returns None if there are no more items in the collection.
</pre>
</div>
</body></html>
|