Getting information about the visitor's session

Method get.visitor_sessions_report
Description Getting information about a visitor's session
Available to Partner, Client

Request parameters

Title Type Required Valid values ​​ Description
access_token string yes Authentication session key
user_id number no Unique user identifier of the agent client on behalf of which the request is made
Is required for the agent
To obtain a list of client users, you must use the method "get.customer_users"
limit number no Number of records returned. See section "Paging"
offset number no Shift determines from which record number to return "limit" records. Default is "0". See section "Paging"
filter object no See section "Filtering Criteria"
sort array no See section "Sorting data"
date_from iso8601 yes YYYY-MM-DD hh:mm:ss Sample start date
date_till iso8601 yes YYYY-MM-DD hh:mm:ss Sampling end date

Response parameters

Name Type Valid values Filtering Sorting Default response Description
date_time iso8601 YYYY-MM-DD hh:mm:ss Session date and time
id number Unique session identifier
ua_client_id string Unique identifier in Universal Analytics
ym_client_id string Unique Yandex.Metrica user identifier
gclid string Label value gclid
yclid string Label value yclid
ef_id string Label value ef_id
ymclid string Label value ymclid
cm_id string yes cm_id is a set of ValueTrack. ValueTrack are URL parameters that can be added to landing page URLs to collect click source information.
integrated_campaign_data object yes Integrated advertising campaign data
  • adv_system - Advertising system
  • ext_campaign_id - RK ID in the advertising system
  • ext_campaign_name - RK name in the advertising system
  • keyword_id - ID of the phrase in the advertising system
  • keyword - Name of the phrase in the advertising system
  • current_banner_id - Current ad ID in the advertising system
  • old_banner_ids - Previous ad identifiers in the advertising system
  • banner_name - Name of the banner in the advertising system
  • group_id - group ID in the advertising system
  • group_name - Name of the group in the advertising system
  • auditory_id - audience ID in the advertising system
  • auditory_name - Name of the audience in the advertising system
  • placement_name - Name of the site in the advertising system
  • yandex_placement_type - Type of site in the advertising system
  • campaign_type - Type of advertising campaign in the advertising system
  • device_type - Device type in the advertising system
  • position_type - Click position in the advertising system
  • yandex_region_id - region ID in the advertising system
  • yandex_region_name - Region name
  • yandex_region_type - Region type
referrer_domain string Referrer domain
referrer string Transition source
search_engine string Search engine
search_query string Search query
entrance_page string Login page
exit_page Exit page
duration number Session duration. Value in seconds
channel enum
  • display
  • paid
  • affiliate
  • messenger
  • social
  • email
  • organic
  • internal
  • recommendation
  • cashed
  • referral
  • direct
Channel.
engine enum
  • yandex.direct
  • google.adwords
  • vk.ads
  • mytarget.ads
Platform for advertising campaign pcc.engine_mnemonic
Advertising campaign
campaign_id number yes yes yes Unique identifier advertising campaign
campaign_name string yes yes Advertising campaign name
Website
site_id number yes yes yes Unique site identifier
site_domain_name string yes yes Site address on the Internet. Without specifying the protocol - "http://" or "https://"
Visitor information
person_id number yes yes Unique person ID
visitor_id number yes yes yes Unique identifier visitor
visitor_device enum
    desktop mobile tablet other
yes yes yes Visitor device
visitor_country string yes yes Visitor country
visitor_city string yes yes Visitor city
visitor_region string yes yes Visitor region
visitor_ip_address string Visitor IP address
visitor_type enum New, Returned yes yes Visitor type
visitor_browser_name string yes yes Visitor's browser
visitor_browser_version string yes yes Visitor's browser version
visitor_os_name string yes yes Operating system name visitor
visitor_os_version string Operating system version visitor
visitor_provider string Visitor's Internet provider
visitor_screen string yes yes Visitor monitor resolution
visitor_language string yes yes Localization of the visitor's device
Visitor properties
visitor_custom_properties array yes Visitor properties that can be asked through your personal account or using the JavaScript API [metho d Comagic.setProperty(name, value);]
property_name string The name of the property that should be assigned to visitor
property_value string Property value
UTM tags
utm_source string yes UTM-source
utm_medium string yes UTM-medium
utm_term string yes UTM-term
utm_content string yes UTM-content
utm_campaign string yes UTM-campaign
Openstat tags
openstat_ad string yes Advertising ID announcements
openstat_campaign string yes Advertising campaign ID
openstat_service string yes Service ID, service provider
openstat_source string yes Identifier of the site, section, pages, places on the page, on which was shown relevant advertising announcement
List of visited pages
hits_count number Number of pages visited
hits array List of visited pages
hit_time string Page transition time
hit_duration string Duration of page visit. Format "HH:MM:SS"
hit_url string Page address
List of segments
segments array yes Segments
segment_name string Segment name
segment_id number Unique segment identifier
List of requests
communications array yes Type of request, see method "get.communications_report"
communication_type enum chat, call, goal, offline_message Type of appeal. To receive detailed information on each type of request can be use the following methods: "get.communications_report", "get.chats_report", "get.goals_report", "get.offline_messages_report", "get.calls_report"
communication_id number Unique identifier appeals. According to this identifier can be obtained detailed information using the following methods: "get.communications_report", "get.chats_report ", "get.goals_report ", "get.offline_messages_report ", "get.calls_report"
communication_date_time iso8601 YYYY-MM-DD hh:mm:ss Date and time of request
ext_id string yes yes Identifier of the integrated target in the external system
Source information
source_id number yes yes Source ID (detailed).
source_name string yes yes Source (detailed). Source name
source_new string yes yes Source(new). Source group
channel_new string yes yes Channel(new). Source channel name
channel_code string yes yes Channel mnemonic

JSON request structure```json

{ "jsonrpc":"2.0", "id":"number", "method":"get.visitor_sessions_report", "params":{ "access_token":"string", "user_id":"number", "offset":"number", "limit":"number", "date_from":"iso8601", "date_till":"iso8601", "filter":{

},
"sort":[
  {
    "field":"string",
    "order":"string"
  }
],
"fields":[
  "string"
]

} }

### JSON response structure```json
{
  "jsonrpc": "2.0",
  "id": "number",
  "result": {
    "metadata": {

    },
    "data": [
      {
        "id": "number",
        "date_time": "iso8601",
        "gclid": "string",
        "ua_client_id": "string",
        "ym_client_id": "string",
        "yclid": "string",
        "ef_id": "string",
        "ymclid": "string",
        "engine": "enum",
        "integrated_campaign_data": {
          "adv_system": "enum",
          "ext_campaign_id": "string",
          "ext_campaign_name": "string",
          "keyword_id": "string",
          "keyword": "string",
          "banner_id": "number",
          "banner_name": "string",
          "group_id": "number",
          "group_name": "string",
          "auditory_id": "number",
          "auditory_name": "string",
          "placement_name": "string",
          "yandex_placement_type": "string",
          "campaign_type": "string",
          "device_type": "string",
          "position_type": "string",
          "yandex_region_id": "number",
          "yandex_region_name": "string",
          "yandex_region_type": "string"
        },
        "cm_id": "string",
        "referrer_domain": "string",
        "referrer": "string",
        "search_engine": "string",
        "search_query": "string",
        "entrance_page": "string",
        "duration": "string",
        "site_id": "number",
        "site_domain_name": "string",
        "campaign_id": "number",
        "campaign_name": "string",
        "channel": "enum",
        "visitor_device": "enum",
        "visitor_id": "number",
        "visitor_country": "string",
        "visitor_city": "string",
        "visitor_region": "string",
        "visitor_ip_address": "string",
        "visitor_type": "enum",
        "visitor_browser_name": "string",
        "visitor_browser_version": "string",
        "visitor_os_name": "string",
        "visitor_os_version": "string",
        "visitor_provider": "string",
        "visitor_screen": "string",
        "visitor_language": "string",
        "visitor_custom_properties": [
          {
            "property_name": "string",
            "property_value": "string"
          }
        ],
        "utm_source": "string",
        "utm_medium": "string",
        "utm_term": "string",
        "utm_content": "string",
        "utm_campaign": "string",
        "openstat_ad": "string",
        "openstat_campaign": "string",
        "openstat_service": "string",
        "openstat_source": "string",
        "hits_count": "number",
        "hits": {
          "hit_time": "string",
          "hit_duration": "string",
          "hit_url": "string"
        },
        "segments": [
          {
            "segment_name": "string",
            "segment_id": "number"
          }
        ],
        "communications": [
          {
            "communication_type": "enum",
            "communication_id": "number",
            "communication_date_time": "iso8601"
          }
        ],
        "source_id": "number",
        "source_name": "string",
        "source_new": "string",
        "channel_new": "string",
        "channel_code": "string"
      }
    ]
  }
}

List of returned errors

See the section "List of errors for methods with the verb get"