Skip to content

Retrieves achieved goals.

Retrieves achieved goals

Method get.goals_report
Description Retrieves achieved goals.
Who has access Partners and clients

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 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 Start date and time of the reporting period.
date_till iso8601 yes YYYY-MM-DD hh:mm:ss End date and time of the reporting period.

Response parameters

Name Type Valid values Filtering Sorting Default response Description
id number yes Unique target identifier
date_time iso8601 YYYY-MM-DD hh:mm:ss Date and time of goal achievement
name string yes yes Target name
type enum track_event time_on_page comagic segment ppc_goal click link scroll time_on_site yes yes Target type track_event - Custom time_on_page - Time on page comagic - In CallGear segment - Entry into a segment ppc_goal - click - Click on an object link - Follow the link scroll - Scrolling actions time_on_site - Time on site
ext_id string yes yes Identifier of the integrated target in the external system
source enum yandex.metrikagoogle.analytics comagic yes yes Name of the system in which the target was created
communication_number number yes yes Call number. Calculated in within the person.
communication_page_url string no no no The URL of the page the visitor was on at the time of the call or the page of the visitor's last interaction before the call.
communication_id number yes yes Unique communication ID.
communication_type enum goal yes yes Communication type.
ua_client_id string Unique identifier in Universal Analytics
ym_client_id string Unique Yandex.Metrica user identifier
sale_date iso8601 YYYY-MM-DD hh:mm:ss yes yes Trade date
sale_cost number yes yes Transaction amount
search_query string yes Search query
search_engine string yes Search engine name
referrer_domain string yes Referrer domain
referrer string yes Transition source
entrance_page string yes Login page
gclid string yes Google Click Identifier
yclid string yes Yandex Click Identifier
ymclid string yes Yandex Market Click Identifier
ef_id string yes Used to mark up links in context management system AdLense advertising
channel enum displaypaid affiliate messenger social email organic internal recommendation cashed referral direct yes Channel.
Added tags
tags array yes Tags, see method "get.tags"
tag_id number Unique tag identifier
tag_name string Tag name
tag_type enum auto, manual Tag type
tag_change_time iso8601 Tag insertion time
tag_user_id number Unique identifier the user who added the tag
tag_user_login string Login of the user who added tag
tag_employee_id number Unique identifier the employee who added the tag
tag_employee_full_name string Full name of the employee who added the tag.
Website
site_id number yes yes yes Unique site identifier
site_domain_name string yes yes Site address on the Internet. Without indication protocol - "http://" or "https://"
Advertising campaign
campaign_id number yes yes yes Unique advertising identifier campaigns
campaign_name string yes yes Advertising campaign name
visit_other_campaign boolean The flag shows whether you have visited visitor (within a person) by other advertising campaigns
Visitor information
visitor_id number yes yes Unique identifier visitor
person_id number yes Unique person identifier
visitor_type enum new, returning, unknown yes yes Visitor type
visitor_session_id number yes Unique session identifier visitor, see "get.visitor_sessions_report"
visits_count number yes Total number of visits visitor
visitor_first_campaign_id number yes Unique ID of the visitor's first advertising campaign.
visitor_first_campaign_name string yes Name of the first advertising campaign
visitor_city string yes Visitor city
visitor_region string yes Visitor region
visitor_country string yes Visitor country
visitor_device enum desktop mobile tablet other yes yes User device
Visitor properties
visitor_custom_properties array yes Visitor properties configured in the CallGear account or set through the JavaScript API method Comagic.setProperty(name, value).
property_name string The name of the property that should be assigned to visitor
property_value string Property value
Segments
segments array yes Segments
segment_id number Unique segment identifier
segment_name string Segment name
UTM tag
utm_source string yes Campaign source
utm_medium string yes Campaign Channel
utm_term string yes Campaign keyword
utm_content string yes Campaign content
utm_campaign string yes Campaign name
OS-label
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
Hit attributes
attributes array first - First quality through - End-to-end first quality primary - Primary secondary - Secondary lost - Lost target - Target off-target - Not targeted quality - Quality rest - target repeat requests (requests made during the period of repeated requests configured for the site in the CallGear account). yes Case attributes
Extended UTM tags
eq_utm_source string yes Extended utm_source
eq_utm_medium string yes Extended utm_medium
eq_utm_term string yes Extended utm_term
eq_utm_content string yes Extended utm_content
eq_utm_campaign string yes Extended utm_campaign
eq_utm_referrer string yes Extended utm_referrer
eq_utm_expid string yes Extended utm_expid

Example request

{
"jsonrpc":"2.0",
"id":"number",
"method":"get.goals_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"
]

}
}

Example response

{
"jsonrpc":"2.0",
"id":"number",
"result":{
"metadata":{

},
"data":[
{
"id":"number",
"date_time":"iso8601",
"name":"string",
"type": "enum",
"ext_id": "number",
"source": "enum",
"communication_number":"number",
"communication_page_url": "string",
"communication_id":"number",
"communication_type":"enum",
"ua_client_id":"string",
"ym_client_id": "string",
"sale_date":"iso8601",
"sale_cost":"number",
"search_query":"string",
"search_engine":"string",
"referrer_domain":"string",
"referrer":"string",
"entrance_page":"string",
"gclid":"string",
"yclid":"string",
"ymclid":"string",
"ef_id":"string",
"channel":"enum",
"tags":[
{
"tag_id":"number",
"tag_name":"string",
"tag_type":"enum",
"tag_change_time":"iso8601",
"tag_user_id":"number",
"tag_user_login":"string",
"tag_employee_id":"number",
"tag_employee_full_name":"string"
}
],
"site_id":"number",
"site_domain_name":"string",
"campaign_id":"number",
"campaign_name":"string",
"visit_other_campaign":"boolean",
"visitor_id":"number",
"person_id":"number",
"visitor_type":"enum",
"visitor_session_id":"number",
"visits_count":"number",
"visitor_first_campaign_id":"number",
"visitor_first_campaign_name":"string",
"visitor_city":"string",
"visitor_region":"string",
"visitor_country":"string",
"visitor_device":"enum",
"visitor_custom_properties":[
{
"property_name":"string",
"property_value":"string"
}
],
"segments":[
{
"segment_id":"number",
"segment_name":"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",
"eq_utm_source": "string",
"eq_utm_medium": "string",
"eq_utm_term": "string",
"eq_utm_content": "string",
"eq_utm_campaign": "string",
"eq_utm_referrer": "string",
"eq_utm_expid": "string",
"attributes":[

]
}
]
}
}

Possible errors

See the "Errors for get methods" section.