targetingURL
Target a banner by URL.
This type of targeting is convenient if you need to show ads on a specific list of website pages or prohibit impressions on individual pages.
Request format
https://adfox.yandex.com/api/v1
? object=banner
& action=target
& actionObject=targetingURL
& objectID=<integer>
& isRedefined=<integer>
& [templateType=<integer>]
& [targetingUrlOn[]=<string>]
& [targetingUrlOff[]=<string>]
|
ID of the object that the action is performed on. |
|
Redefine targeting. Acceptable values:
|
|
Template type for targeting by URL. Acceptable values:
Default value: |
|
URL of the page where ad serving is allowed. If there are multiple URLs, every URL must be passed in a separate parameter. The maximum number of parameters with a URL is 5. Sample entry:
|
|
URL of the page where ad serving is prohibited. If there are multiple URLs, every URL must be passed in a separate parameter. The maximum number of parameters with a URL is 5. Sample entry:
|
* Required
Response format
<response>
<status>
<code>{integer}</code>
</status>
</response>
Response parameters
|
Request processing status. For the key, see Error handling. |
Sample request and response
Request:
https://adfox.yandex.com/api/v1?object=banner&action=target&actionObject=targetingURL&objectID=474205&isRedefined=1&templateType=0&targetingUrlOn[]=*site.com/&targetingUrlOn[]=*site.com/*&targetingUrlOff[]=https://www.demo.site.com/*
Response:
<response> <status> <code>0</code> </status> </response>
Other actions with the object
See more actions with the banner
object:
- Get a list of banners.
- Add a banner.
- Edit a banner.
- Get summary information on targeting at the banner level.
- Get information on banner placement.
- Get statistics on campaigns/banners/placements for the day.
- Target a banner by frequency.
- Target a banner by geography.
- Target a banner by keywords.
- Target a banner by gender, age, or income.
- Target a banner by user characteristics.
- Target a banner by time.
URL of the page where ad serving is prohibited.
If there are multiple URLs, every URL must be passed in a separate parameter. The maximum number of parameters with a URL is 5.
Sample entry:
targetingUrlOff[]=url1&targetingUrlOff[]=url2...
Required
ID of the object that the action is performed on.
Redefine targeting.
Acceptable values:
-
0
: Inherit targeting settings from a higher level. Level hierarchy from top to bottom:- Campaign.
- Campaign on the site.
- Campaign in the site section.
- Campaign on the placement.
- Banner.
-
1
: Cancel targeting settings at higher levels and use the settings of the current level.
Template type for targeting by URL.
Acceptable values:
-
0
: Standard. In the URL template, use the*
symbol for a sequence of any characters of any length. -
1
: POSIX. In the URL template, use regular expressions according to the POSIX standard.
Default value: 0
.
URL of the page where ad serving is allowed.
If there are multiple URLs, every URL must be passed in a separate parameter. The maximum number of parameters with a URL is 5.
Sample entry:
targetingUrlOn[]=url1&targetingUrlOn[]=url2...