请问如何使用事件跟踪ActiveCampaign 代码来跟踪特定事件?例如,如果我想跟踪单击 Wordpress 网站上的按钮的人,并且按钮单击事件将出现在该人的活动中。如何在此处添加此 php 示例代码。
<?php
// Set up an object instance using our PHP API wrapper.
define( "ACTIVECAMPAIGN_URL", "URL" );
define( "ACTIVECAMPAIGN_API_KEY", "KEY" );
require_once( "C:\\xampp\htdocs\\Tracking\\activecampaign-api-php-master\\includes\\ActiveCampaign.class.php" );
$ac = new ActiveCampaign( ACTIVECAMPAIGN_URL, ACTIVECAMPAIGN_API_KEY );
$ac->track_actid = "actid"; // your unique tracking account ID (found on the Integrations page).
$ac->track_key = "key"; // your unique event key (found on the Integrations page).
$ac->track_email = "email"; // (optional) contact email address to associate the event with.
$post_data = array(
"event" => "event",
"eventdata" => "event_data",
// any extra (optional) visit data to include?
"visit" => array(
//"url" => "",
//"referrer" => "",
//"ip4" => "",
//"ip6" => "",
//"ua" => "",
//"browser" => "",
//"platform" => "",
//"device" => "",
//"utm_source" => "",
//"utm_campaign" => "",
//"utm_medium" => "",
//"utm_term" => "",
//"utm_content" => "",
),
);
$response = $ac->api( "tracking/log", $post_data );
echo "<pre>";
print_r( $response );
echo "</pre>";
?>