Retrieves all advertising campaigns, including basic, integrated, and system campaigns.
Retrieves all advertising campaigns, including basic, integrated, and system campaigns
| Method | get.campaigns |
|---|---|
| Description | Retrieves all advertising campaigns, including basic, integrated, and system campaigns. |
| Who has access | Agents and clients |
Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
access_token |
string | yes | Session key used to authenticate the request |
user_id |
number | no | Unique ID of the client user on whose behalf the request is made. Required when an agent makes the request. To retrieve a list of client users, call "get.customer_users". |
limit |
number | no | Maximum number of records to return. See the "Paging" section. |
offset |
number | no | Number of records to skip before returning results. Default: 0. See the "Paging" section. |
filter |
object | no | Filtering criteria. See the "Filters" section. |
fields |
array | no | Fields to include in the response. See the "Viewing returned data" section. |
sort |
array | no | Sorting criteria. See the "Data sorting" section. |
Response parameters
| Name | Type | Valid values | Filtering | Sorting | Description |
|---|---|---|---|---|---|
id |
number | yes | Unique advertising campaign ID | ||
name |
string | yes | yes | Advertising campaign name | |
description |
string | Up to 255 characters | Advertising campaign description | ||
status |
enum |
|
yes | Advertising campaign status | |
creation_time |
iso8601 | YYYY-MM-DD hh:mm:ss | yes | yes | Date and time when the advertising campaign was created |
campaign_conditions |
object | no | Campaign matching conditions. Not returned for integrated or system campaigns. | ||
engine |
enum |
|
yes | yes | Advertising platform for an integrated campaign |
type |
enum |
|
yes | yes | Campaign type: basic is a standard campaign created in CallGear; integrated is managed through an integration and cannot be deleted; system is the built-in "Visitors without advertising campaign" campaign and cannot be deleted. |
costs |
number | yes | yes | Advertising campaign spend | |
cost_ratio |
number | Minimum: 1 | Coefficient applied to costs. Default: 1 | ||
cost_ratio_operator |
enum |
|
Operation used to apply cost_ratio when calculating costs. Default: wo_changes | ||
| Site | |||||
site_id |
number | yes | yes | Unique site ID | |
site_domain_name |
string | yes | Site domain name, without the protocol (http:// or https://) | ||
| Site block number assignment | |||||
site_blocks |
array | yes | Virtual number assignments for site blocks | ||
site_block_id |
number | Unique site block ID | |||
site_block_name |
string | Site block name | |||
phone_number_type |
enum |
|
Virtual number type used by phone_number_id: user, va (Virtual PBX), or call_tracking | ||
phone_number_id |
number |
Unique virtual number ID. Retrieve available numbers with get.campaign_available_phone_numbers.
|
|||
phone_number |
string | Phone number referenced by phone_number_id | |||
redirection_phone_number_id |
number | Unique forwarding number ID used when phone_number_type is call_tracking. Retrieve available numbers with get.campaign_available_redirection_phone_numbers. |
|||
redirection_phone_number |
string | Phone number referenced by redirection_phone_number_id | |||
static_utm_source |
string | yes | Static UTM source value. Returned only when requested in fields. | ||
static_utm_medium |
string | yes | Static UTM medium value. Returned only when requested in fields. | ||
static_utm_campaign |
string | yes | Static UTM campaign value. Returned only when requested in fields. | ||
static_utm_term |
string | yes | Static UTM term value. Returned only when requested in fields. | ||
static_utm_content |
string | yes | Static UTM content value. Returned only when requested in fields. | ||
static_utm_referrer |
string | yes | Static UTM referrer value. Returned only when requested in fields. | ||
static_utm_expid |
string | yes | Static UTM experiment ID. Returned only when requested in fields. | ||
dynamic_call_tracking_enabled |
boolean | true, false | Indicates whether dynamic call tracking is enabled. Can be true only when phone_number_type is va or call_tracking. | ||
| Dynamic call tracking | |||||
dynamic_call_tracking |
object | yes | Dynamic call tracking settings. Calls to pool numbers follow the call-handling rules of the block's default campaign number. | ||
reservation_time |
enum |
|
How long a number remains assigned to a visitor. Default: 15m. After this period, the number may be assigned to another visitor, or remain assigned if sufficient call tracking numbers are available. | ||
count_virtual_numbers |
number | Minimum: 1 | Number of virtual numbers required for dynamic call tracking in each site block | ||
count_visits |
number | Minimum: 1 | Estimated number of visits to the advertising campaign per day | ||
coverage_visitors |
number | Percentage of site visitors shown a dynamic call tracking number | |||
| Condition groups | |||||
group_conditions |
array | Groups of campaign matching conditions | |||
| Conditions | |||||
conditions |
array | Conditions in the group | |||
type |
enum |
|
Condition behavior: include matches visits that satisfy the condition; exclude excludes them | ||
campaign_parameter |
enum | Campaign parameter evaluated by the condition. See "Campaign parameters and operators". | |||
value |
string | Value to compare against. Some campaign parameters accept predefined values; see "Campaign parameters and operators". | |||
operator |
enum | =, sub, ~ | Comparison operator: = for exact matches, sub for substring matches, and ~ for regular expressions | ||
Example request
{
"jsonrpc": "2.0",
"id": "number",
"method": "get.campaigns",
"params": {
"access_token": "string",
"user_id": "number",
"offset": "number",
"limit": "number",
"filter": {},
"sort": [
{
"field": "string",
"order": "string"
}
],
"fields": [
"string"
]
}
}
Example response
{
"jsonrpc": "2.0",
"id": "number",
"result": {
"metadata": {},
"data": [
{
"id": "number",
"status": "enum",
"creation_time": "iso8601",
"description": "string",
"site_id": "number",
"site_domain_name": "string",
"costs": "number",
"cost_ratio": "number",
"cost_ratio_operator": "enum",
"engine": "enum",
"type": "enum",
"name": "string",
"site_blocks": [
{
"site_block_id": "number",
"site_block_name": "string",
"phone_number_type": "enum",
"phone_number_id": "number",
"phone_number": "string",
"redirection_phone_number_id": "number",
"redirection_phone_number": "string",
"dynamic_call_tracking_enabled": "boolean"
}
],
"static_utm_source": "string",
"static_utm_medium": "string",
"static_utm_campaign": "string",
"static_utm_term": "string",
"static_utm_content": "string",
"static_utm_referrer": "string",
"static_utm_expid": "string",
"dynamic_call_tracking": {
"reservation_time": "enum",
"count_virtual_numbers": "number",
"count_visits": "number",
"coverage_visitors": "number"
},
"campaign_conditions": {
"group_conditions": [
{
"conditions": [
{
"type": "enum",
"campaign_parameter": "enum",
"operator": "enum",
"value": "string"
}
]
}
]
}
}
]
}
}
List of returned errors
See the "List of errors for get methods" section.
Campaign parameters and operators (reference)
This reference table lists the values accepted by the campaign_parameter field in advertising campaign conditions, together with the supported operators.
| campaign_parameter | Description | Operators | Accepted values |
|---|---|---|---|
entrance_page |
Landing page | sub, =, ~ | User-defined |
| Traffic source | |||
referrer_domain |
Referrer domain | sub, =, ~ | User-defined |
search_engine |
Search engine | = | askcom bing.com google.com mail.ru nigma rambler.ru yahoo.com yandex |
search_query |
Search query | sub, =, ~ | User-defined |
engine |
Advertising platform | = | 5 - Aport 2 - Google AdWords 3 - Runner 1 - Yandex.Direct 4 - Yandex.Market 6 - Social Network Ads 7 - VK Ads 8 - myTarget Ads |
referrer |
Referrer | sub, =, ~ | User-defined |
channel |
Channel | = | display paid affiliate messenger social organic internal recommendation cash referral direct |
| Visitor location | |||
country |
Country | sub, =, ~ | User-defined |
city |
City | sub, =, ~ | User-defined |
region |
Region | sub, =, ~ | User-defined |
| UTM parameters | |||
utm_source |
UTM source | sub, =, ~ | User-defined |
utm_medium |
UTM medium | sub, =, ~ | User-defined |
utm_campaign |
UTM campaign | sub, =, ~ | User-defined |
utm_term |
UTM term | sub, =, ~ | User-defined |
utm_content |
UTM content | sub, =, ~ | User-defined |
| Openstat parameters | |||
openstat_service |
Service ID | sub, =, ~ | User-defined |
openstat_campaign |
Advertising campaign ID | sub, =, ~ | User-defined |
openstat_source |
ID of the placement where the ad was displayed | sub, =, ~ | User-defined |
openstat_ad |
Ad ID | sub, =, ~ | User-defined |
| Other URL parameters | |||
ef_id |
Identifier used by the AdLense contextual advertising management system | sub, =, ~ | User-defined |
yclid |
Yandex Click Identifier | sub, =, ~ | User-defined |
gclid |
Google Click Identifier | sub, =, ~ | User-defined |
ymclid |
Yandex Metric Click Identifier | sub, =, ~ | User-defined |
| Extended UTM parameters | |||
static_utm_source |
Static UTM source | sub, =, ~ | User-defined |
static_utm_medium |
Static UTM medium | sub, =, ~ | User-defined |
static_utm_campaign |
Static UTM campaign | sub, =, ~ | User-defined |
static_utm_content |
Static UTM content | sub, =, ~ | User-defined |
static_utm_term |
Static UTM term | sub, =, ~ | User-defined |
static_utm_referrer |
Static UTM referrer | sub, =, ~ | User-defined |
static_utm_expid |
Static UTM experiment ID | sub, =, ~ | User-defined |