add

Creates retargeting lists.

  1. Restrictions
  2. Request
  3. Response

Restrictions

Maximum of 2,000 retargeting lists per advertiser.

Maximum of 1000 retargeting lists per method call.

Request

Request structure in JSON format:

{
  "method": "add",
  "params": { /* params */
    "RetargetingLists": [{  /* RetargetingListAddItem */
      "Type": ( RETARGETING | AUDIENCE ),
      "Name": (string), /* required */
      "Description": (string),
      "Rules": [{  /* RetargetingListRuleItem */
        "Arguments": [{  /* RetargetingListRuleArgumentItem */
           "MembershipLifeSpan": (int),
           "ExternalId": (long) /* required */
        }, ... ], /* required */
        "Operator": ( "ALL" | "ANY" | "NONE" ) /* required */
      }, ... ] /* required */
    }, ... ]
  }
}
ParameterTypeDescriptionRequired
Params structure (for JSON) / AddRequest structure (for SOAP)
RetargetingListsarray of RetargetingListAddItemRetargeting lists to add.Yes
RetargetingListAddItem structure
TypeRetargetingListTypeEnum

Type of retargeting list. See the section Type of retargeting lists.

The default value is RETARGETING.

No
NamestringName of the retargeting list (maximum of 250 characters).Yes
DescriptionstringText note for the retargeting list (maximum of 4096 characters).No
Rulesarray of RetargetingListRuleItemRules for selecting site users. In order for the retargeting list to apply, the user must meet all the rules at once.

For restrictions on user selection rules and examples of the structure, see the section Rules for user selection.

Yes
RetargetingListRuleItem structure
Argumentsarray of RetargetingListRuleArgumentItem

Goals and segments.

See the section Goals and segments.

Yes
OperatorRetargetingListRuleOperatorEnum

Logical operator for the retargeting list:

  • ALL — The rule is met if the user completed all the goals and is included in all the segments.

  • ANY — The rule is met if the user completed at least one of the goals or the user's session is included in at least one of the segments.

  • NONE — The rule is met if the user didn't complete any of the goals and the user's session isn't included in any of the segments.

Yes
RetargetingListRuleArgumentItem structure
MembershipLifeSpanintNumber of days (from 1 to 90) for checking whether goals are completed or segments are matched.For Yandex.Metrica goals and segments
ExternalIdlong

ID of the goal or segment.

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)
      }, ... ] 
    }, ... ]
  }
}
ParameterTypeDescription
Result structure (for JSON) / AddResponse structure (for SOAP)
AddResultsarray of ActionResultResults of adding retargeting lists.
ActionResult structure
IdlongID of the created retargeting list. Returned if there aren't any errors. See the section Operations on object arrays.
Warningsarray of ExceptionNotification

Warnings that occurred during the operation.

Errorsarray of ExceptionNotification

Errors that occurred during the operation.