Google Analytics · Schema

SearchUserActivityResponse

The response from `userActivity:get` call.

AnalyticsDataGoogleMetricsReportingWeb AnalyticsMachine LearningAttribution

Properties

Name Type Description
nextPageToken string This token should be passed to [SearchUserActivityRequest](#SearchUserActivityRequest) to retrieve the next page.
sampleRate number 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/repo
sessions array Each record represents a session (device details, duration, etc).
totalRows integer Total rows returned by this query (across different pages).
View JSON Schema on GitHub

JSON Schema

google-analytics-search-user-activity-response-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-analytics/json-schema/google-analytics-search-user-activity-response-schema.json",
  "title": "SearchUserActivityResponse",
  "description": "The response from `userActivity:get` call.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-analytics-user-activity-api-openapi.yml#/components/schemas/SearchUserActivityResponse",
  "properties": {
    "nextPageToken": {
      "description": "This token should be passed to [SearchUserActivityRequest](#SearchUserActivityRequest) to retrieve the next page.",
      "type": "string"
    },
    "sampleRate": {
      "description": "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.",
      "format": "double",
      "type": "number"
    },
    "sessions": {
      "description": "Each record represents a session (device details, duration, etc).",
      "items": {
        "$ref": "#/$defs/UserActivitySession"
      },
      "type": "array"
    },
    "totalRows": {
      "description": "Total rows returned by this query (across different pages).",
      "format": "int32",
      "type": "integer"
    }
  },
  "type": "object",
  "$defs": {
    "Activity": {
      "description": "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.",
      "properties": {
        "activityTime": {
          "description": "Timestamp of the activity. If activities for a visit cross midnight and occur in two separate dates, then two sessions (one per date) share the session identifier. For example, say session ID 113472 has activity within 2019-08-20, and session ID 243742 has activity within 2019-08-25 and 2019-08-26. Session ID 113472 is one session, and session ID 243742 is two sessions.",
          "format": "google-datetime",
          "type": "string"
        },
        "activityType": {
          "description": "Type of this activity.",
          "enum": [
            "ACTIVITY_TYPE_UNSPECIFIED",
            "PAGEVIEW",
            "SCREENVIEW",
            "GOAL",
            "ECOMMERCE",
            "EVENT"
          ],
          "type": "string"
        },
        "appview": {
          "$ref": "#/$defs/ScreenviewData",
          "description": "This will be set if `activity_type` equals `SCREEN_VIEW`."
        },
        "campaign": {
          "description": "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).",
          "type": "string"
        },
        "channelGrouping": {
          "description": "The Channel Group associated with an end user's session for this View (defined by the View's Channel Groupings).",
          "type": "string"
        },
        "customDimension": {
          "description": "A list of all custom dimensions associated with this activity.",
          "items": {
            "$ref": "#/$defs/CustomDimension"
          },
          "type": "array"
        },
        "ecommerce": {
          "$ref": "#/$defs/EcommerceData",
          "description": "This will be set if `activity_type` equals `ECOMMERCE`."
        },
        "event": {
          "$ref": "#/$defs/EventData",
          "description": "This field contains all the details pertaining to an event and will be set if `activity_type` equals `EVENT`."
        },
        "goals": {
          "$ref": "#/$defs/GoalSetData",
          "description": "This field contains a list of all the goals that were reached in this activity when `activity_type` equals `GOAL`."
        },
        "hostname": {
          "description": "The hostname from which the tracking request was made.",
          "type": "string"
        },
        "keyword": {
          "description": "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).",
          "type": "string"
        },
        "landingPagePath": {
          "description": "The first page in users' sessions, or the landing page.",
          "type": "string"
        },
        "medium": {
          "description": "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).",
          "type": "string"
        },
        "pageview": {
          "$ref": "#/$defs/PageviewData",
          "description": "This will be set if `activity_type` equals `PAGEVIEW`. This field contains all the details about the visitor and the page that was visited."
        },
        "source": {
          "description": "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).",
          "type": "string"
        }
      },
      "type": "object"
    },
    "CustomDimension": {
      "description": "Custom dimension.",
      "properties": {
        "index": {
          "description": "Slot number of custom dimension.",
          "format": "int32",
          "type": "integer"
        },
        "value": {
          "description": "Value of the custom dimension. Default value (i.e. empty string) indicates clearing sesion/visitor scope custom dimension value.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "EcommerceData": {
      "description": "E-commerce details associated with the user activity.",
      "properties": {
        "actionType": {
          "description": "Action associated with this e-commerce action.",
          "enum": [
            "UNKNOWN",
            "CLICK",
            "DETAILS_VIEW",
            "ADD_TO_CART",
            "REMOVE_FROM_CART",
            "CHECKOUT",
            "PAYMENT",
            "REFUND",
            "CHECKOUT_OPTION"
          ],
          "type": "string"
        },
        "ecommerceType": {
          "description": "The type of this e-commerce activity.",
          "enum": [
            "ECOMMERCE_TYPE_UNSPECIFIED",
            "CLASSIC",
            "ENHANCED"
          ],
          "type": "string"
        },
        "products": {
          "description": "Details of the products in this transaction.",
          "items": {
            "$ref": "#/$defs/ProductData"
          },
          "type": "array"
        },
        "transaction": {
          "$ref": "#/$defs/TransactionData",
          "description": "Transaction details of this e-commerce action."
        }
      },
      "type": "object"
    },
    "EventData": {
      "description": "Represents all the details pertaining to an event.",
      "properties": {
        "eventAction": {
          "description": "Type of interaction with the object. Eg: 'play'.",
          "type": "string"
        },
        "eventCategory": {
          "description": "The object on the page that was interacted with. Eg: 'Video'.",
          "type": "string"
        },
        "eventCount": {
          "description": "Number of such events in this activity.",
          "format": "int64",
          "type": "string"
        },
        "eventLabel": {
          "description": "Label attached with the event.",
          "type": "string"
        },
        "eventValue": {
          "description": "Numeric value associated with the event.",
          "format": "int64",
          "type": "string"
        }
      },
      "type": "object"
    },
    "GoalData": {
      "description": "Represents all the details pertaining to a goal.",
      "properties": {
        "goalCompletionLocation": {
          "description": "URL of the page where this goal was completed.",
          "type": "string"
        },
        "goalCompletions": {
          "description": "Total number of goal completions in this activity.",
          "format": "int64",
          "type": "string"
        },
        "goalIndex": {
          "description": "This identifies the goal as configured for the profile.",
          "format": "int32",
          "type": "integer"
        },
        "goalName": {
          "description": "Name of the goal.",
          "type": "string"
        },
        "goalPreviousStep1": {
          "description": "URL of the page one step prior to the goal completion.",
          "type": "string"
        },
        "goalPreviousStep2": {
          "description": "URL of the page two steps prior to the goal completion.",
          "type": "string"
        },
        "goalPreviousStep3": {
          "description": "URL of the page three steps prior to the goal completion.",
          "type": "string"
        },
        "goalValue": {
          "description": "Value in this goal.",
          "format": "double",
          "type": "number"
        }
      },
      "type": "object"
    },
    "GoalSetData": {
      "description": "Represents a set of goals that were reached in an activity.",
      "properties": {
        "goals": {
          "description": "All the goals that were reached in the current activity.",
          "items": {
            "$ref": "#/$defs/GoalData"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "PageviewData": {
      "description": "Represents details collected when the visitor views a page.",
      "properties": {
        "pagePath": {
          "description": "The URL of the page that the visitor viewed.",
          "type": "string"
        },
        "pageTitle": {
          "description": "The title of the page that the visitor viewed.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "ProductData": {
      "description": "Details of the products in an e-commerce transaction.",
      "properties": {
        "itemRevenue": {
          "description": "The total revenue from purchased product items.",
          "format": "double",
          "type": "number"
        },
        "productName": {
          "description": "The product name, supplied by the e-commerce tracking application, for the purchased items.",
          "type": "string"
        },
        "productQuantity": {
          "description": "Total number of this product units in the transaction.",
          "format": "int64",
          "type": "string"
        },
        "productSku": {
          "description": "Unique code that represents the product.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "ScreenviewData": {
      "properties": {
        "appName": {
          "description": "The application name.",
          "type": "string"
        },
        "mobileDeviceBranding": {
          "description": "Mobile manufacturer or branded name. Eg: \"Google\", \"Apple\" etc.",
          "type": "string"
        },
        "mobileDeviceModel": {
          "description": "Mobile device model. Eg: \"Pixel\", \"iPhone\" etc.",
          "type": "string"
        },
        "screenName": {
          "description": "The name of the screen.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "TransactionData": {
      "description": "Represents details collected when the visitor performs a transaction on the page.",
      "properties": {
        "transactionId": {
          "description": "The transaction ID, supplied by the e-commerce tracking method, for the purchase in the shopping cart.",
          "type": "string"
        },
        "transactionRevenue": {
          "description": "The total sale revenue (excluding shipping and tax) of the transaction.",
          "format": "double",
          "type": "number"
        },
        "transactionShipping": {
          "description": "Total cost of shipping.",
          "format": "double",
          "type": "number"
        },
        "transactionTax": {
          "description": "Total tax for the transaction.",
          "format": "double",
          "type": "number"
        }
      },
      "type": "object"
    },
    "UserActivitySession": {
      "description": "This represents a user session performed on a specific device at a certain time over a period of time.",
      "properties": {
        "activities": {
          "description": "Represents a detailed view into each of the activity in this session.",
          "items": {
            "$ref": "#/$defs/Activity"
          },
          "type": "array"
        },
        "dataSource": {
          "description": "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.",
          "type": "string"
        },
        "deviceCategory": {
          "description": "The type of device used: \"mobile\", \"tablet\" etc.",
          "type": "string"
        },
        "platform": {
          "description": "Platform on which the activity happened: \"android\", \"ios\" etc.",
          "type": "string"
        },
        "sessionDate": {
          "description": "Date of this session in ISO-8601 format.",
          "type": "string"
        },
        "sessionId": {
          "description": "Unique ID of the session.",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/google-analytics-search-user-activity-response"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.