Here is documentation how add custom field to ActiveCampaign https://www.activecampaign.com/api/example.php?call=contact_add
Here is my code in Laravel:
$client = new Client();
$res = $client->request('POST', 'https://domain-example.com/admin/api.php?api_action=contact_add', [
'form_params' => [
'api_key' => 'api_key',
'actid' => 'actid',
'api_action' => 'contact_add',
'api_output' => 'json',
'email' => $_POST['email'],
'field[utm_source, 0]' => $_POST['utm_source'],
'p[123]' => 10,
'field[%REFERRAL_PAGE%, 0]' => $_SERVER['HTTP_REFERER']
]
]);
Result: contact added,but the field utm_source
is empty. In Laravel I checked , this property is not empty before send. Other fields are not empty too, the problem is only with custom field utm_source
. Any thoughts why it happens?