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>]
  & [type=<integer>]
  & [kind_id=<integer>]
  & [level=<integer>]
  & [cpm=<integer>]
  & [priority=<integer>]
  & [status=<integer>]
  & [sectorID=<integer>]
  & [rotationMethodID=<integer>]
  & [trafficPercents=<integer>]
  & [commonProfileID=<integer>]
  & [targetingProfileID=<integer>]
  & [bundleID=<integer>]
  & [sequence=<integer>]
  & [tracingTypeID=<integer>]
  & [isSession=<integer>]
  & [outerMarkID=<integer>]
  & [isSimplifiedBanners=<integer>]
  & [bannerSequence=<integer>]
  & [impressionsSmoothTypeID=<integer>]
  & [clicksSmoothTypeID=<integer>]
  & [maxImpressions=<integer>]
  & [maxImpressionsPerDay=<integer>]
  & [maxImpressionsPerHour=<integer>]
  & [maxClicks=<integer>]
  & [maxClicksPerDay=<integer>]
  & [dateStart=<YYYY-MM-DD HH:mm>]
  & [dateEnd=<YYYY-MM-DD HH:mm>]
  & [logicType=<integer>]
  & [sendToErir=<integer>]
  & [contractID=<integer>]
  & [costType=<integer>]
  & [okveds[]=<string>]
  & [markingAdvertiserInfo=<string>]

name*

Name of the new campaign (flight). An entry can contain Russian and Latin letters, numbers, and any special characters.

advertiserID*

Advertiser ID.

If a campaign is added to a super campaign, the advertiser is not specified and is inherited from the super campaign.

See also:

assistantID

ID of the assistant who will be allowed access to the object according to their permissions.

If a campaign is added to a super campaign, the assistant is not specified and is inherited from the super campaign.

See also:

superCampaignID

ID of the super campaign (if the campaign is added to a super campaign).

See also:

impressionsMethodID

Impression count method.

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 event sequence number from 1 to 30 (101 corresponds to event 1, 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 website page.
  • 1101: Viewable impression, Yandex (IMS). An impression is only counted if at least 50% of the banner area is 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). Impressions in the viewable area of the window in the active browser tab, counted according to the criteria established by international media industry standards (minimum percentage of pixels in the viewable area and display time in the viewable browser area).

type

Campaign type. Deprecated parameter. We recommend using the standard type.

Acceptable values:

  • 0: A simplified campaign. You can use a limited set of targeting options (by time, frequency, and geography) and reports.
  • 1: A standard campaign. You can use all the targeting options and get all the reports available in your account.

Default value: 1.

kind_id

Defines a campaign type.

Acceptable values:

  • 1: The Guarantee type is used for campaigns with guaranteed sales where there are ad running obligations. Includes the dependence of two parameters:

    • The level parameter can only take values from 1 to 10. If the parameter isn't passed, the default value (1) is used.
    • The cpm parameter isn't required. If it's passed, its value is ignored.
  • 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 campaigns. Campaigns are prioritized by CPM. Includes the dependence of two parameters:

    • The level parameter must be equal to 11. If the parameter isn't passed, the default value 11 is used.
    • The cpm parameter is required and must be > 0.

    If the campaign was created with an external monetizer, you can't change the “Campaign type”. Its value must be 2.

  • 3: The Promo type is used for your custom promotion campaigns and placeholders. Includes the dependence of two parameters:

    • The level parameter can only take values from 12 to 20. If the parameter isn't passed, the default value 12 is used.
    • The cpm parameter isn't required. If it's passed, its value is ignored.

Default value: 1.

level

Campaign levellevel.

Depending on whether you connect the “Campaign typesCampaign types” module in the account, a different number of levels is available for campaigns.

Acceptable values if the “Campaign types” module is disabled:

  • From 1 to 10 inclusive

Default value: 1.

Acceptable values if the “Campaign types” module is enabled:

  • From 1 to 10 inclusive: for campaigns of the Guarantee type (kind_id=1).
  • 11: for campaigns of the Dynamic monetization type (kind_id=2).
  • From 12 to 20: for campaigns of the Promo type (kind_id=3).

Pay attention to the dependence of the kind_id and cpm parameter values.

cpm

CPM floor value for a campaign of the Dynamic monetization type.

For kind_id=2, the parameter is required.

For kind_id=1|3, the parameter is optional. But if it's passed, its value is ignored.

Acceptable values: integers from 1 to 99,999.

If CPM is passed, don't pass CPC.

priority

Priority.

Acceptable values: 1≤N≤1000, where N is a number from 1 to 1000 inclusive.

Default value: 100.

status

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.

sectorID

Industry.

See also:

rotationMethodID

Campaign rotation method.

Acceptable values:

  • 0: by priority. Use the level and priority parameter values to estimate the probability of serving the campaign.
  • 1: by % of traffic. Use the trafficPercents value to estimate the probability of serving the campaign. The trafficPercents parameter is required.

Default value: 0.

trafficPercents

Traffic percentage.

Required if the traffic percentage rotation method is used (rotationMethodID=1).

Acceptable values: from 1 to 100.

commonProfileID

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.

targetingProfileID

targeting profile ID.

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.

See also:

bundleID

placement profile ID.

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.

sequence

Group.

tracingTypeID

Action tracing.

Acceptable values:

  • 0: Don't track user actions on the advertiser's website.
  • 1: postClick. Count the number of action point downloads within 24 hours after an ad click.
  • 2: postClick and postView. Count the number of action point downloads after a click and after an impression.
  • 3: postView. Count the number of action point downloads after an impression or 24 hours after a click occurred.

Default value: 0.

isSession

Session impressions.

Acceptable values:

  • 0: Disabled.
  • 1: Enabled.

Default value: 0.

outerMarkID

Enable automatic tag substitution for click links.

Acceptable values:

  • 0: Disabled.
  • 1: Openstat.ru.
  • 2: Google Analytics.

Default value: 0.

isSimplifiedBanners

Simplified banners (additional module).

Acceptable values:

  • 0: Disabled.
  • 1: Enabled.

Default value: 0.

bannerSequence

Banner display sequence.

Acceptable values:

  • 0: by priority. Banners are selected based on their priority.
  • 1: Sequential. A script (scenario) indicates the banner number and how many times it's served to the user.

Default value: 0.

impressionsSmoothTypeID

Impression running speed.

Acceptable values:

  • 0: As fast as possible. Campaign banners are served at the maximum possible speed until the impression limits are reached (if specified). The maximum running speed doesn't require that you specify any limits and start/end dates of the campaign.

  • 1: Spread evenly throughout the day. Impressions are uniformly distributed throughout the day. Make sure to specify the maximum number of impressions per day (maxImpressionsPerDay).

  • 2: Spread evenly throughout the entire period. The campaign impressions are distributed evenly over the entire period based on account statistics. Make sure to specify the maximum number of impressions (maxImpressions) and the campaign end date (dateEnd).

  • 3: Spread evenly throughout the entire period (automatic prolongation). The campaign impressions are distributed evenly over the entire period based on account statistics. If the campaign doesn't reach the impression limit in the allocated time, it's automatically extended for one day and runs at the maximum speed on that day. Make sure to specify the maximum number of impressions (maxImpressions) and the campaign end date (dateEnd).

Default value: 0.

clicksSmoothTypeID

Click delivery speed.

Acceptable values:

  • 0: As fast as possible. Campaign banners are served at the maximum possible speed until the click limits are reached (if specified). The maximum running speed doesn't require that you specify any limits and start/end dates of the campaign.

  • 1: Spread evenly throughout the day. Impressions are uniformly distributed throughout the day. Make sure to specify the maximum number of clicks per day (maxClicksPerDay).

  • 2: Spread evenly throughout the entire period. The campaign impressions are distributed evenly over the entire period based on account statistics. Make sure to specify the maximum number of clicks (maxClicks) and the campaign end date (dateEnd).

  • 3: Spread evenly throughout the entire period (automatic prolongation). The campaign impressions are distributed evenly over the entire period based on account statistics. If the campaign doesn't reach the click limit in the allocated time, it's automatically extended for one day and runs at the maximum speed on that day. Make sure to specify the maximum number of clicks (maxClicks) and the campaign end date (dateEnd).

Default value: 0.

maxImpressions

Maximum number of banner impressions.

Acceptable values: integers from 1 to 2,147,483,647.

maxImpressionsPerDay

Maximum number of impressions per day.

Acceptable values: integers from 1 to 2,147,483,647.

maxImpressionsPerHour

Maximum number of impressions per hour.

Acceptable values: integers from 1 to 2,147,483,647.

maxClicks

Maximum total number of clicks.

Acceptable values: integers from 1 to 2,147,483,647.

maxClicksPerDay

Maximum number of clicks per day.

Acceptable values: integers from 1 to 2,147,483,647.

dateStart

Delivery start date.

Default value: today from 00:00.

Date and time format: YYYY-MM-DD HH:mm

dateEnd

Delivery end date.

Date and time format: YYYY-MM-DD HH:mm

logicType

Campaign type. Not required for a campaign inside a super campaign.

Acceptable values:

Default value: 0.

sendToErir

Submit data to the Russian state register.

Acceptable values:

  • 0: Don't submit data to the Russian state register.
  • 1: Submit data to the Russian state register (ad register is enabled).

Default value: 0.

contractID

Contract identifier. This parameter is required if sendToErir=1. Learn more about getting a list of contracts.

costType

Campaign type.

Acceptable values:

  • 0: Other.
  • 1: CPM.
  • 2: CPC.
  • 3: CPA.

Default value: 0.

okveds[]

List of OKVED codes of advertised products. If there are multiple codes, submit them using a new parameter, for example: &okveds[]=88.33&okveds[]=77.54.

markingAdvertiserInfo

Information about the advertiser in the banner menu. Displayed if the Show ad menu option is enabled for the banner. by default, this string is empty.

* Required

Response format

<response>
<status>
  <code>{integer}</code>
  <ID>{integer}</ID>
</status>
</response>

Response parameters

code

Request processing status. If the value is 0, the request was completed successfully. For the key, see Error handling.

ID

Object ID.

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:30

Response:

<response>
<status>
  <code>0</code>
  <ID>393747</ID>
</status>
</response>

Other actions with the object

See more actions with the campaign object:

Previous