I am trying to track events happening on my client's website(Squarespace) so I can use these events for marketing automation in Active Campaign.
I read through this article: https://help.activecampaign.com/hc/en-us/articles/221870128-An-overview-of-Event-Tracking#an-overview-of-event-tracking-0-0
On how to setup but since I am not an API expert I am finding it difficult to understand as I do not program scripts. This is the code I was given as an example;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://trackcmp.net/event");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, array( "actid" => 23033, "key" => "c12973b078007927842301eff932e7d78b74b3e", "event" => "YOUR_EVENT", "eventdata" => "ANY_DATA", "visit" => json_encode(array( // If you have an email address, assign it here. "email" => "", )), ));
$result = curl_exec($curl);
if ($result !== false) {
$result = json_decode($result);
if ($result->success) {
echo 'Success! ';
} else {
echo 'Error! ';
}
echo $result->message;
}
else {
echo 'CURL failed to run: ', curl_error($curl);
}
Please can someone help me out with a step by step guide on what to do.