Search

Returns User Activity data

10 variables
24 variables

Returns User Activity data

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • View and manage your Google Analytics data
  • View your Google Analytics data

Input

This building block consumes 10 input parameters

  = Parameter name
  = Format

user OBJECT

Contains information to identify a particular user uniquely

user.type ENUMERATION

Type of the user in the request. The field userId is associated with this type

user.userId STRING

Unique Id of the user for which the data is being requested

activityTypes[] ENUMERATION

pageToken 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 request

dateRange OBJECT

A contiguous set of days: startDate, startDate + 1 day, ..., endDate. The start and end dates are specified in ISO8601 date format YYYY-MM-DD

dateRange.endDate STRING

The end date for the query in the format YYYY-MM-DD

dateRange.startDate STRING

The start date for the query in the format YYYY-MM-DD

pageSize INTEGER

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

viewId STRING

Required. The Analytics view ID from which to retrieve data. Every SearchUserActivityRequest must contain the viewId

Output

This building block provides 24 output parameters

  = Parameter name
  = Format

sampleRate NUMBER

This field represents the sampling rate for the given request and is a number between 0.0 to 1.0. See developer guide for details

nextPageToken STRING

This token should be passed to SearchUserActivityRequest to retrieve the next page

sessions[] OBJECT

This represents a user session performed on a specific device at a certain time over a period of time

sessions[].deviceCategory STRING

The type of device used: "mobile", "tablet" etc

sessions[].sessionDate STRING

Date of this session in ISO-8601 format

sessions[].platform STRING

Platform on which the activity happened: "android", "ios" etc

sessions[].dataSource 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

sessions[].sessionId STRING

Unique ID of the session

sessions[].activities[] OBJECT

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

sessions[].activities[].channelGrouping STRING

The Channel Group associated with an end user's session for this View (defined by the View's Channel Groupings)

sessions[].activities[].pageview OBJECT

Represents details collected when the visitor views a page

sessions[].activities[].goals OBJECT

Represents a set of goals that were reached in an activity

sessions[].activities[].medium 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)

sessions[].activities[].keyword 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)

sessions[].activities[].campaign 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)

sessions[].activities[].source 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)

sessions[].activities[].ecommerce OBJECT

E-commerce details associated with the user activity

sessions[].activities[].landingPagePath STRING

The first page in users' sessions, or the landing page

sessions[].activities[].hostname STRING

The hostname from which the tracking request was made

sessions[].activities[].activityType ENUMERATION

Type of this activity

sessions[].activities[].event OBJECT

Represents all the details pertaining to an event

sessions[].activities[].appview OBJECT

sessions[].activities[].activityTime ANY

Timestamp of the activity

totalRows INTEGER

Total rows returned by this query (across different pages)