add
Creates targeting conditions for dynamic ads and sets bids or priorities for the created conditions.
The bid or priority is used depending on which display strategy is selected in the campaign:
-
If you've set up an automatic strategy for your campaign, the
StrategyPriority
parameter is used: ads for dynamic text ad targets with higher priority get more traffic if possible, and are paused last when the budget runs low. -
If you've set up a manual strategy for your campaign, the
Bid
parameter is used.
The ContextBid
parameter isn't used at this time.
If an item in the input array contains parameters that are not appropriate for the strategy, the values of these parameters are saved and a warning is issued.
-
If your campaign uses an automatic strategy, but the
Bid
parameter is set for a dynamic text ad target, this bid value won't be applied. When the strategy changes from automatic to manual, the bid will be selected by an automatic algorithm. -
If your campaign uses a manual strategy, but the
StrategyPriority
parameter is set for a dynamic text ad target, the set priority value will be applied later when the strategy changes to an automatic one.
If the strategy allows for setting bids but the bid is not specified, the minimum bid is set by default (the minimum bid depends on the advertiser's currency). If the strategy allows for setting priority but the priority is not specified, the average priority is set by default.
Learn more
- How the "add" method works
- How to handle errors
- Ad target for dynamic ads (DynamicTextAdTarget — Webpage)
- Dynamic ads
- Dynamic ads
Restrictions
Dynamic text ad targets can only be added to a DYNAMIC_TEXT_AD_GROUP type of ad group.
Maximum of 50 dynamic text ad targets per ad group.
Maximum of 1000 dynamic text ad targets per method call.
Request
Request structure in JSON format:
{
"method": "add",
"params": { /* params */
"Webpages": [{ /* WebpageAddItem */
"Name": (string), /* required */
"AdGroupId": (long), /* required */
"Conditions": [{ /* WebpageCondition */
"Operand": ( "DOMAIN" | "OFFERS_LIST_URL" | "PAGE_CONTENT" | "PAGE_TITLE" | "URL" ), /* required */
"Operator": ( "EQUALS_ANY" | "NOT_EQUALS_ALL" | "CONTAINS_ANY" | "NOT_CONTAINS_ALL" ), /* required */
"Arguments": [(string), ... ] /* required */
}, ... ],
"Bid": (long),
"ContextBid": (long),
"StrategyPriority": ( "LOW" | "NORMAL" | "HIGH" )
}, ... ] /* required */
}
}
Parameter |
Type |
Description |
Required |
params structure (for JSON) / AddRequest structure (for SOAP) |
|||
|
array of WebpageAddItem |
The dynamic text ad targets to add. |
Yes |
WebpageAddItem structure |
|||
|
string |
Name of a dynamic text ad target (maximum of 100 characters). |
Yes |
|
long |
ID of the group to add the dynamic text ad target to. |
Yes |
|
array of WebpageCondition |
Rules for page filtering. Maximum of 10 items in the array. A dynamic ad is generated if the page meets all the selection rules at the same time. If this parameter is omitted, a dynamic text ad target is created with the PAGES_ALL type ("All website pages"). |
No |
|
long |
The bid on search, multiplied by 1,000,000. Integer. Only used for a manual strategy. Specified in the advertiser's currency. Restrictions are listed in the currency reference. To get it, use the Dictionaries.get method and specify the Copied |
No |
|
long |
This parameter is reserved for future use. |
No |
|
PriorityEnum |
The priority of the dynamic text ad target: LOW, NORMAL or HIGH. Only used for an automatic strategy. |
No |
WebpageCondition structure |
|||
|
WebpageCondition OperandEnum |
The operand is a property of a site page to compare with the argument. For a description of the operands, see Selection rule. |
Yes |
|
StringCondition OperatorEnum |
How the operand and argument are compared. For a description of the operators, see Selection rule. |
Yes |
|
array of string |
An array of strings to compare the operand to. Maximum of 10 strings in the array. If the operand is OFFERS_LIST_URL, the length of each string must be less than 1024 characters. In all other cases, each string can have a maximum of 100 characters. |
Yes |
Response
Response structure in JSON format:
{
"result": { /* result */
"AddResults": [{ /* ActionResult */
"Id": (long),
"Warnings": [{ /* ExceptionNotification */
"Code": (int), /* required */
"Message": (string), /* required */
"Details": (string)
}, ... ],
"Errors": [{ /* ExceptionNotification */
"Code": (int), /* required */
"Message": (string), /* required */
"Details": (string)
}, ... ]
}, ... ]
}
}
Parameter |
Type |
Description |
result structure (for JSON) / AddResponse structure (for SOAP) |
||
|
array of ActionResult |
Results of adding dynamic text ad targets. |
ActionResult structure |
||
|
long |
ID of the created dynamic text ad target. Returned if there aren't any errors. See the section Operations on object arrays. |
|
array of ExceptionNotification |
Warnings that occurred during the operation. |
|
array of ExceptionNotification |
Errors that occurred during the operation. |
Example
Selection of tablet pages for creating ads of tablets that are represented in the list of tablets, excluding those that are sold out and out of stock.
{
"method" : "add",
"params": {
"Webpages":[
{
"AdGroupId":831821811,
"Name":"Планшеты",
"Bid":800000,
"Conditions": [
{
"Operand":"PAGE_CONTENT",
"Operator":"NOT_CONTAINS_ALL",
"Arguments":["Товар временно отсутствует в продаже"]
},
{
"Operand":"PAGE_CONTENT",
"Operator":"NOT_CONTAINS_ALL",
"Arguments": ["Товар распродан"]
},
{
"Operand":"OFFERS_LIST_URL",
"Operator":"EQUALS_ANY",
"Arguments":["http://example.com/tablets/tablets-195"]
}
]
}
]
}
}