| Method | get.visits |
|---|---|
| Description | Getting a list of all visits for 31 days |
| Available to | Agent, Client |
| Necessary components for working with the method | Data API for configuration |
| Method weight | 1 point |
Request parameters
| Name | 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 agentTo obtain a list of client users, you must use the method "get.customer_users" |
|
limit |
number | no | Number of records to return. See "Paging" | |
offset |
number | no | Shift, determines from which record number to return `"limit"` records. Default is "0". See "Paging" | |
report_id |
number | yes | User report unique identifier. To get a list of user reports, you must use the "get.reports_list" | method|
date_from |
iso8601 | yes | YYYY-MM-DD hh:mm:ss | Start date of main sample (31 day limit) |
date_till |
iso8601 | yes | YYYY-MM-DD hh:mm:ss | End date of the main sample |
is_realtime |
boolean | yes | Whether the requested report is a report for the last 30 minutes. Realtime report flag. | |
fields |
array | no | List of custom column identifiers, separated by comma. Required to obtain data. If the parameter is empty or not passed, the response will be empty. For a list of available columns, see "Getting Column Nesting" . The order affects the answer. | |
| Filters used in the report | filter |
object | no | It is permissible to use no more than 2 уровней nesting. See examples below |
Filters applied in the report. The construction logic is similar to "Filtering criteria" |
filters |
array | yes | An expression can contain both simple filters and a filter tree. For an available list of filters for a report with their possible values, see section "Getting a list of possible filtering conditions for a report" . | |
field |
string | Field of the entity to which filtering will be applied (the list is predefined for the method) | ||
operator |
enum | Filtering operator. A list of all operators can be obtained in the section "Filtering operators" | ||
value |
string | Value for the filtering operator. Optional field; if it is missing, it is considered empty. | ||
| Sorting used in the report | sort |
array | no | The sorting used in the report. The logic of construction is similar to "Sorting data" |
Response parameters
| Name | Type | Valid values | Filtering | Sorting | Default response | Description |
|---|---|---|---|---|---|---|
site_domain_name |
string | yes | yes | yes |
Internet site address. Without specifying the protocol - "http://" or "https://"
|
|
site_domain_naked |
string | yes | yes | yes | The main domain of a website address on the Internet. | |
| Advertising systems | ||||||
pc |
string | yes | yes | yes | Name of external advertising campaign | |
pc_ext_id |
string | yes | yes | yes | External identifier of external advertising campaign | |
gr |
string | yes | yes | yes | Ad group name | |
gr_ext_id |
string | yes | yes | yes | External ad group ID | |
ad |
string | yes | yes | yes | Ad title | |
ad_ext_ids |
string | yes | yes | yes | External ad ID. May contain several external ad ids. | |
kw |
string | yes | yes | yes | Keyword | |
kw_ext_id |
string | yes | yes | yes | External keyword identifier. | |
| Traffic sources | ||||||
campaign_name |
string | yes | yes | yes | Advertising campaign name | |
channel_new |
string | yes | yes | yes | Channel(new). Source channel name | |
channel_code |
string | yes | yes | yes | Channel mnemonic | |
source_new |
string | yes | yes | yes | Source(new). Source group | |
source_name |
string | yes | yes | yes | Source (detailed). Source name | |
channel |
string | yes | yes | Channel. | ||
source |
string | yes | yes | Source. | ||
referrer |
string | yes | yes | Transition source | ||
referrer_domain |
string | yes | yes | Referrer domain | ||
search_query |
string | yes | yes | Search query | ||
| UTM tags | ||||||
utm_source |
string | yes | yes | UTM Source tag | ||
utm_medium |
string | yes | yes | UTM tag Medium | ||
utm_term |
string | yes | yes | UTM tag Term | ||
utm_content | string | yes | yes | UTM tag Content | ||
utm_campaign |
string | yes | yes | Campaign UTM tag | ||
utm_referrer |
string | yes | yes | Referrer UTM tag | ||
utm_expid |
string | yes | yes | Expid UTM tag | ||
| Openstat Tags | ||||||
openstat_ad |
string | yes | yes | Ad ID | ||
openstat_campaign |
string | yes | yes | Advertising campaign ID | ||
openstat_service |
string | yes | yes | Identifier of the service providing the service | ||
openstat_source |
string | yes | yes | ID of the site, section, page, the corresponding advertisement was shown | ||
| Other URL tags | ||||||
ef_id |
string | yes | yes | Used to mark up links in the AdLense contextual advertising management system | ||
yclid |
string | yes | yes | Yandex Click Identifier | ||
gclid |
string | yes | yes | Gclid label | ||
cm_id |
string | yes | 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. | ||
ymclid |
string | yes | yes | Label value ymclid |
||
tag_from |
string | yes | yes | From label | ||
| Geography | ||||||
visitor_country |
string | yes | yes | Visitor country | ||
visitor_region |
string | yes | yes | Visitor region | ||
visitor_city |
string | yes | yes | Visitor city | ||
visitor_provider |
string | yes | yes | Visitor's Internet provider | ||
visitor_ip_address |
string | yes | yes | Visitor IP address | ||
| Computer | ||||||
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 | Name of the visitor's operating system | ||
visitor_os_version |
string | yes | yes | Visitor operating system version | ||
visitor_language |
string | yes | yes | Localization of the visitor's device | ||
visitor_screen |
string | yes | yes | Visitor monitor resolution | ||
visitor_device |
object | yes | yes | Visitor device | ||
value
|
string | Name of values | ||||
value_id
|
string | Unique value identifier | ||||
| Visitor history | ||||||
visitor_session_id |
string | yes | yes | Unique visitor session identifier | ||
visit_depth |
number | yes | yes | View depth. Number of pages that were viewed per visit | ||
entrance_page |
string | yes | yes | Login page | ||
visitor_type |
object | yes | yes | Visitor type | ||
value
|
string | Name of values | ||||
value_id
|
string | Unique value identifier | ||||
visitor_id |
number | yes | yes | yes | Unique visitor identifier | |
person_id |
number | yes | yes | yes | Unique person identifier | |
ua_client_id |
string | yes | yes | Unique identifier in Universal Analytics | ||
ym_client_id |
string | yes | yes | Unique Yandex.Metrica user identifier | ||
| List of segments | ||||||
segments |
array | yes | Segments | |||
segment_name |
string | yes | Segment name | |||
| Visiting time | ||||||
visit_date_time |
iso8601 | YYYY-MM-DD hh:mm:ss | yes | yes | yes | Date and time of visit |
visit_date |
iso8601 | YYYY-MM-DD | yes | yes | Date of visit | |
visit_hour |
object | yes | yes | Visiting hour | ||
value
|
string | Name of values | ||||
value_id
|
string | Unique value identifier | ||||
visit_weekday |
object | yes | yes | Day of week of visit | ||
value
|
string | Name of values | ||||
value_id
|
string | Unique value identifier | ||||
visit_month |
object | yes | yes | Month of visit | ||
value
|
string | Name of values | ||||
value_id
|
string | Unique value identifier | ||||
visit_year |
string | yes | yes | Year of visit | ||
communications |
array | no | no | no | Related requests | |
id
|
number | Unique identifier of the case | ||||
type
|
object | Treatment type | ||||
value
|
string | Name of values | ||||
value_id
|
string | Unique value identifier | ||||
date_time
|
number | Request date | ||||
number_pool_name |
string | no | no | no | Name of the call tracking rule that included the visit | |
JSON request structure```json
{ "jsonrpc":"2.0", "id":"number", "method":"get.visits", "params":{ "access_token":"string", "user_id":"number", "offset":"number", "limit":"number", "report_id": "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":[
{
"site_domain_name":"string",
"site_domain_naked":"string",
"pc":"string",
"pc_ext_id":"string",
"campaign_name":"string",
"channel_new":"string",
"channel_code":"string",
"source_new":"string",
"source_name":"string",
"channel":"string",
"source":"string",
"referrer":"string",
"referrer_domain":"string",
"search_query":"string",
"utm_source":"string",
"utm_medium":"string",
"utm_term":"string",
"utm_content":"string",
"utm_campaign":"string",
"utm_referrer":"string",
"utm_expid":"string",
"openstat_ad":"string",
"openstat_campaign":"string",
"openstat_service":"string",
"openstat_source":"string",
"ef_id":"string",
"yclid":"string",
"gclid":"string",
"cm_id":"string",
"ymclid":"string",
"tag_from":"string",
"visit_depth":"number",
"visitor_country":"string",
"visitor_region":"string",
"visitor_city":"string",
"visitor_provider":"string",
"visitor_ip_address":"string",
"visitor_browser_name":"string",
"visitor_browser_version":"string",
"visitor_os_name":"string",
"visitor_os_version":"string",
"visitor_language":"string",
"visitor_screen":"string",
"visitor_device":{
"value_id": "string",
"value": "string"
},
"number_pool_name": "string",
"communications": [
{
"id": "number",
"type": {
"value": "string",
"value_id": "string"
},
"date_time": "iso8601"
}
],
"visitor_session_id":"string",
"entrance_page":"string",
"visitor_type":{
"value_id": "string",
"value": "string"
},
"visitor_id":"number",
"person_id":"number",
"ua_client_id":"string",
"ym_client_id":"string",
"segments":[
{
"segment_name":"string"
}
],
"visit_date_time":"iso8601",
"visit_date":"iso8601",
"visit_hour":{
"value_id": "string",
"value": "string"
},
"visit_weekday":{
"value_id": "string",
"value": "string"
},
"visit_month":{
"value_id": "string",
"value": "string"
},
"visit_year":"string",
"gr":"string",
"gr_ext_id":"string",
"ad":"string",
"ad_ext_ids":"string",
"kw":"string",
"kw_ext_id":"string"
}
]
}
}
List of returned errors
See the section "List of errors for methods with the verb get"