5use \Bitrix\Seo\Retargeting\Audience;
19 'COUNT_VALID' =>
'APPROXIMATE_COUNT',
20 'COUNT_MATCHED' =>
'APPROXIMATE_COUNT',
21 'SUPPORTED_CONTACT_TYPES' => array(
22 self::ENUM_CONTACT_TYPE_EMAIL,
23 self::ENUM_CONTACT_TYPE_PHONE,
24 self::ENUM_CONTACT_TYPE_IDFA_GAID,
25 self::ENUM_CONTACT_TYPE_INTERNAL_ID
29 public function add(array $data)
32 'methodName' =>
'retargeting.audience.add',
33 'parameters' => array(
34 'accountId' => $this->accountId,
35 'name' => $data[
'NAME'],
36 'description' => $data[
'DESCRIPTION'],
40 $responseData = $response->getData();
41 if (isset($responseData[
'id']))
43 $response->setId($responseData[
'id']);
53 foreach (static::$listRowMap[
'SUPPORTED_CONTACT_TYPES'] as $contactType)
55 if (!isset($contacts[$contactType]))
60 $contactsCount = count($contacts[$contactType]);
61 for ($i = 0; $i < $contactsCount; $i++)
63 $contact = $contacts[$contactType][$i];
64 $contact = hash(
'sha256', $contact);
69 $data[] = array($contact,
'');
73 $data[] = array(
'', $contact);
80 'schema' => array(
'EMAIL',
'PHONE'),
88 'methodName' =>
'retargeting.audience.contacts.add',
89 'parameters' => array(
90 'accountId' => $this->accountId,
92 'contacts' => Json::encode(
102 'methodName' =>
'retargeting.audience.contacts.remove',
103 'parameters' => array(
104 'accountId' => $this->accountId,
106 'contacts' => Json::encode(
116 'methodName' =>
'retargeting.audience.list',
117 'parameters' => array(
118 'accountId' => $this->accountId
121 $data = $response->getData();
122 $data = array_values(array_filter($data,
function ($item) {
123 return ($item[
'subtype'] ==
'CUSTOM');
125 $response->setData($data);
137 for ($i=1; $i<10;$i++)
142 'FIELDS' => [
'AUDIENCE_SIZE',
'AUDIENCE_REGION'],
150 'methodName' =>
'retargeting.audience.lookalike.add',
151 'parameters' => array(
152 'accountId' => $this->accountId,
153 'audienceId' => $sourceAudienceId,
154 'options' => $options
157 if ($result->isSuccess())
159 $result->setId($result->getData()[
'id']);
const ENUM_CONTACT_TYPE_PHONE
const ENUM_CONTACT_TYPE_EMAIL
removeContacts($audienceId, array $contacts, array $options)
static isSupportAddAudience()
importContacts($audienceId, array $contacts, array $options)
prepareContacts(array $contacts=array())
const MIN_CONTACTS_FOR_ACTIVATING
const MAX_CONTACTS_PER_PACKET
getLookalikeAudiencesParams()
createLookalike($sourceAudienceId, array $options)