# Добавление тега при создании контакта/сделки

По умолчанию модуль itgrix\_amo при создании контакта или сделки задаёт им тег `Itgrix`. При необходимости вы можете изменить тег перед отправкой запроса на создание контакта/сделки в CRM или добавить ещё один тег.

Синтаксис одинаковый для кастомизаций создания контактов и сделок.

{% hint style="info" %}
Кастомизация настраивается в файлах:

* **process\_contact\_creation\_params.php** для контактов;
* **process\_lead\_creation\_params.php** для сделок.

Они находятся в каталоге:
{% endhint %}

|          itgrix\_bx (Битрикс24)         |           itgrix\_amo (amoCRM)           |
| :-------------------------------------: | :--------------------------------------: |
| **/opt/itgrix\_bx/customizer/actions/** | **/opt/itgrix\_amo/customizer/actions/** |

{% hint style="info" %}
Для более ранних версий:
{% endhint %}

| itgrix\_bx (Битрикс24) ДО версии 3.4.0 | itgrix\_amo (amoCRM) ДО версии 2.6.0 |
| :------------------------------------: | :----------------------------------: |
|       **/opt/itgrix\_bx/custom/**      |     **/opt/itgrix\_amo/custom/**     |

**Пример добавления тегов `CustomTag1` и `CustomTag2`:**

```php
<?php
/**
 * @var $params
 */

// Нужно вернуть массив обновляемое_поле = значение

$CustomTag1 = 'CustomTag1';
$CustomTag2 = 'CustomTag2';

$params['tags_to_add'] = array(); 
// Добавляем каждый кастомный тег:
array_push($params['tags_to_add'], array('name' => $CustomTag1));
array_push($params['tags_to_add'], array('name' => $CustomTag2));

return array(
    'state' => 'success',
    'data' => $params
);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.itgrix.ru/custom_amo/izmenenie-tega-pri-sozdanii-kontakta-sdelki.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
