5use \Bitrix\Seo\Retargeting\Audience;
18 'SUPPORTED_CONTACT_TYPES' => array(
19 self::ENUM_CONTACT_TYPE_EMAIL,
20 self::ENUM_CONTACT_TYPE_IDFA_GAID
27 'email' => self::ENUM_CONTACT_TYPE_EMAIL,
29 static::$listRowMap[
'SUPPORTED_CONTACT_TYPES'] = array($map[$row[
'CONTENT_TYPE']]);
30 return parent::normalizeListRow($row);
48 public function add(array $data)
50 $response = $this->request->send(array(
51 'methodName' =>
'audience.add',
52 'parameters' => array(
53 'ACCOUNT_ID' => $this->accountId,
54 'NAME' => $data[
'NAME'],
59 $responseData = $response->getData();
60 if (isset($responseData[
'id']))
62 $response->setId($responseData[
'id']);
70 if ($type && isset($contacts[$type]))
72 return $contacts[$type];
76 foreach (static::$listRowMap[
'SUPPORTED_CONTACT_TYPES'] as $contactType)
78 if (!isset($contacts[$contactType]) || !is_array($contacts[$contactType]))
83 $data = $contacts[$contactType];
91 $response = $this->request->send(array(
92 'methodName' =>
'audience.importcontacts',
93 'parameters' => array(
94 'ACCOUNT_ID' => $this->accountId,
105 $response = $this->request->send(array(
106 'methodName' =>
'audience.removecontacts',
107 'parameters' => array(
108 'ACCOUNT_ID' => $this->accountId,
119 $response = $this->request->send(array(
120 'methodName' =>
'audience.list',
121 'parameters' => array(
122 'ACCOUNT_ID' => $this->accountId,
132 return (is_array($row) && $row[$key]) ? $row[$key] :
null;
removeContacts($audienceId, array $contacts, array $options)
static isSupportMultiTypeContacts()
static isSupportAddAudience()
static isSupportAccount()
importContacts($audienceId, array $contacts, array $options)
static normalizeListRow(array $row)
static isSupportRemoveContacts()
const MIN_CONTACTS_FOR_ACTIVATING
prepareContacts(array $contacts=array(), $type=null)
const MAX_CONTACTS_PER_PACKET
getAudienceIdFromRow(array $row=null)