campaign
Add a campaign (flight).
Request format
https://adfox.yandex.com/api/v1
? object=account
& action=add
& actionObject=campaign
& name=<string>
& advertiserID=<integer>
& [assistantID=<integer>]
& [superCampaignID=<integer>]
& [impressionsMethodID=<integer>]
& [kind_id=<integer>]
& [level=<integer>]
& [cpm=<integer>]
& [cpc=<integer>]
& [priority=<integer>]
& [status=<integer>]
& [sectorID=<integer>]
& [rotationMethodID=<integer>]
& [trafficPercents=<integer>]
& [commonProfileID=<integer>]
& [targetingProfileID=<integer>]
& [bundleID=<integer>]
& [isSession=<integer>]
& [[impressionsSmoothTypeID](*impressionsSmoothTypeID)=<integer>]
& [maxImpressions=<integer>]
& [maxImpressionsPerDay=<integer>]
& [maxImpressionsPerHour=<integer>]
& [maxClicks=<integer>]
& [maxClicksPerDay=<integer>]
& [maxClicksPerHour=<integer>]
& [dateStart=<YYYY-MM-DD HH:mm>]
& [dateEnd=<YYYY-MM-DD HH:mm>]
& [logicType=<integer>]
& [sendToErir=<integer>]
& [contractID=<integer>]
& [publisherContractID=<integer>]
& [costType=<integer>]
& [markingAdvertiserInfo=<string>]
|
|
Name of the new campaign (flight). An entry can contain Russian and Latin letters, numbers, and any special characters |
|
|
Advertiser ID. If a campaign is added to a supercampaign, the advertiser is not specified and is inherited from the supercampaign. Read also: |
|
|
ID of the assistant who will be granted access to the object based on their permissions. If a campaign is added to a supercampaign, the assistant is not specified and is inherited from the supercampaign. Read also: |
|
|
ID of the supercampaign (if the campaign is added to a supercampaign). Read also: |
|
|
Acceptable values:
|
|
|
Defines the campaign type. Acceptable values:
Default value: |
|
|
Campaign level. How many campaign levels are available depends on whether you have enabled the “Campaign types” module in your account. If the “Campaign types” module is disabled, you can use the following values:
Default value: When the “Campaign types” module is enabled, you can use the following values:
Pay attention to the dependence of the |
|
|
CPM threshold value for an ad campaign of the Dynamic monetization type. For For Acceptable values: If CPM is passed, don't pass CPC. |
|
|
CPC threshold value for an ad campaign of the Dynamic monetization type. For For Acceptable values: an If CPC is passed, don't pass CPM. |
|
|
Default value: |
|
|
Object status. Only objects with the active status can be displayed. Acceptable values:
Default value: |
|
|
For more information on how to get the list of industries, see utility-sector. |
|
|
Acceptable values:
Default value: |
|
|
Traffic percentage. Required if the traffic percentage rotation method is used ( Acceptable values: |
|
|
General profile ID. A general profile combines a targeting profile and a placement profile. When specifying a general profile, you don't need to pass |
|
|
You can use a targeting profile to combine the settings of several targeting types. When creating a campaign or banner, you can specify a targeting profile. This way, you don't waste time setting up every targeting type separately. For more information on how to get the list of profile IDs, see list-targetingProfile. |
|
|
You can use a placement profile to combine commonly used placements for campaigns. You can specify a placement profile right away when creating a new campaign. This way, the campaign will appear on the placements specified in the profile. |
|
|
Acceptable values:
Default value: |
|
|
Deliver impressions. Acceptable values:
Default value: |
|
|
Maximum number of banner impressions. Acceptable values: |
|
|
Maximum number of impressions per day. Acceptable values: |
|
|
Maximum number of impressions per hour. Acceptable values: |
|
|
Maximum total number of click-throughs. Acceptable values: |
|
|
Maximum number of clicks per day. Acceptable values: |
|
|
Maximum number of clicks per hour. Acceptable values: |
|
|
Ad running start date. Default value: today from 00:00. Date and time format: |
|
|
Delivery end date. Date and time transmission format: |
|
|
Campaign type. Not required for a campaign inside a supercampaign. Acceptable values:
Default value: |
|
|
Submit data to the state register (ERIR). Acceptable values:
Default value: |
|
|
ID of a direct or primary contract. Required if |
|
|
ID of the contract with the end advertiser. Required if |
|
|
Campaign type. Acceptable values:
Default value: |
|
|
Advertiser information as shown in the banner menu. Displayed when the Show banner menu option is enabled for the banner. The default value is an empty string. |
* Required parameter
Response format
<response>
<status>
<code>{integer}</code>
<ID>{integer}</ID>
</status>
</response>
Response parameters
|
|
Request processing status. A value of |
|
|
The ID of the created object. |
Sample request and response
Request:
https://adfox.yandex.com/api/v1?object=account&action=add&actionObject=campaign&name=April_16_tea&advertiserID=456&dateStart=2021-12-20 06:30&dateEnd=2021-12-31 22:30Response:
<response> <status> <code>0</code> <ID>393747</ID> </status> </response>
Other actions with the object
Read also about other actions with the campaign object:
- Get a list of campaigns.
- Delete a campaign.
- Edit a campaign.
- Get a list of ad campaign banners.
- Place a campaign on a a site, in a section, or on a placement.
- Add a contractor
- Add a contract.
Name of the new campaign (flight). An entry can contain Russian and Latin letters, numbers, and any special characters
Advertiser ID.
If a campaign is added to a supercampaign, the advertiser is not specified and is inherited from the supercampaign.
Read also:
ID of the assistant who will be granted access to the object based on their permissions.
If a campaign is added to a supercampaign, the assistant is not specified and is inherited from the supercampaign.
Read also:
ID of the supercampaign (if you want to add the campaign to a supercampaign).
Read also:
Acceptable values:
-
0: Banner ad response. An impression is counted when the banner code is uploaded to the site page. -
101≤N≤130, where N is the ordinal number of the event from 1 to 30 (the value 101 corresponds to event 1, the value 105 corresponds to event 5, and so on). An impression is counted when the event with the specified number is called by the banner on the site page. -
1101: Viewable impression, Yandex (IMS). To count as an impression, at least 50% of the banner must be visible in the active browser window for at least two seconds. -
2101: Impression (IMS). An impression event that occurs when ad rendering begins. -
2102: Viewable impression (IMS). Ad impressions are counted as viewable when they meet criteria established by international media industry standards, including a minimum percentage of pixels within the browser's viewable area and a minimum duration of visibility within that area.
Defines the campaign type.
Acceptable values:
-
1: Guarantee type. It's used for campaigns with guaranteed sales where there are ad running obligations. Includes the dependence of two parameters:- The
levelparameter can only take values from 1 to 10. If thelevelparameter isn't passed, the default value1is used. - The
cpmparameter isn't required. If it's passed, its value is ignored.
- The
-
2: The Dynamic monetization type allows the publisher to receive the highest revenue from impressions, enabling the Yandex Advertising Network to compete for impressions of non-guaranteed ad campaigns. Campaigns are prioritized by CPM. Includes the dependence of two parameters:- The
levelparameter must be equal to 11. If thelevelparameter isn't passed, the default value11is used. - The
cpmparameter is required and must be> 0.
If the ad campaign was created with an external monetizer, you can't change “Campaign type”. Its value must be
2. - The
-
3: Promo type. It's used for custom promotion campaigns and placeholders. Includes the dependence of two parameters:- The
levelparameter can only take values from 12 to 20. If thelevelparameter isn't passed, the default value12is used. - The
cpmparameter isn't required. If it's passed, its value is ignored.
- The
Default value: 1.
How many campaign levels are available depends on whether you have enabled the “Campaign types” module in your account.
If the “Campaign types” module is disabled, you can use the following values:
From 1 to 10 (inclusive).
Default value: 1.
When the “Campaign types” module is enabled, you can use the following values:
-
From 1 to 10 (inclusive): For Guarantee campaigns (kind_id=1). -
11: For Dynamic monetization campaigns (kind_id=2). -
From 12 to 20: For Promo campaigns (kind_id=3).
Pay attention to the dependence of the kind_id and cpm parameter values.
CPM threshold value for a Dynamic monetization campaign.
For kind_id=2, this parameter is required.
For kind_id=1|3, this parameter is optional. If it's passed, its value is ignored.
Acceptable values: integers from 1 to 99999.
If CPM is passed, don't pass CPC.
The CPC threshold value for a Dynamic monetization campaign.
For kind_id=2, the parameter is required.
For kind_id=1|3, this parameter is optional. If it's passed, its value is ignored.
Acceptable values: an integer greater than 0.
If CPC is passed, don't pass CPM.
1≤N≤1000, where N is a number from 1 to 1000 (inclusive).
Default value: 100.
Object status. Only objects with the active status can be displayed.
Acceptable values:
-
0: Active. The object is ready for delivery. -
1: Paused. The object is assumed to be temporarily disabled. By default, filters in the Adfox web interface show paused objects in the list. -
2: Completed. The object is assumed to be delivered in full. By default, filters in the Adfox web interface hide completed objects.
Default value: 0.
For more information on how to get the list of industries, see utility-sector.
Acceptable values:
-
0: By priority. Use the values of thelevelandpriorityparameters to determine the probability of your ad campaign being served. -
1: By percentage of traffic. Use the value of thetrafficPercentsparameter to determine the probability of your ad campaign being served. ThetrafficPercentsparameter is required.
Default value: 0.
Traffic percentage.
Required if the traffic percentage rotation method is used (rotationMethodID=1).
Acceptable values: from 1 to 100.
General profile ID.
A general profile combines a targeting profile and a placement profile. When specifying a general profile, you don't need to pass targetingProfileID and bundleID.
You can use a targeting profile to combine the settings of several targeting types. When creating a campaign or banner, you can specify a targeting profile. This way, you don't waste time setting up every targeting type separately.
For more information on how to get the list of profile IDs, see list-targetingProfile.
You can use a placement profile to combine commonly used placements for campaigns. You can specify a placement profile right away when creating a new campaign. This way, the campaign will appear on the placements specified in the profile.
Acceptable values:
-
0: disabled. -
1: enabled.
Default value: 0.
Maximum number of banner impressions.
Acceptable values: Integers from 1 to 2147483647.
Maximum number of impressions per day.
Acceptable values: Integers from 1 to 2147483647.
Maximum number of impressions per hour.
Acceptable values: Integers from 1 to 2147483647.
Maximum number of clicks in total.
Acceptable values: Integers from 1 to 2147483647.
Maximum number of clicks per day.
Acceptable values: Integers from 1 to 2147483647.
Maximum number of clicks per hour.
Acceptable values: Integers from 1 to 2147483647.
Delivery start date.
Default value: today from 00:00.
Date and time format: YYYY-MM-DD HH:mm
End date for delivering ads.
Date and time format: YYYY-MM-DD HH:mm
Campaign logic type. Not required for a campaign inside a supercampaign.
Acceptable values:
-
0: Commercial.
Default value: 0.
Submit data to the state register (ERIR).
Acceptable values:
-
0: Do not submit data to the state register. -
1: Submit data to state register (labeling enabled).
Default value: 0.
ID of a direct or primary contract.
Required if sendToErir=1. Find out how to get the list of contracts.
ID of the contract with the end advertiser.
Required if contractID points to a primary contract.
Campaign pricing model.
Acceptable values:
-
0: Other. -
1: CPM. -
2: CPC. -
3: CPA.
Default value: 0.
Advertiser information as shown in the banner menu. Displayed when the Show banner menu option is enabled for the banner. The default value is an empty string.
Required parameter.