Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
How to track event in Wordpress and store in contact ActiveCampaign

May I ask how to track the specific event with the event tracking ActiveCampaign code? For example, if I want to track the person who click the button on Wordpress website and the button click event will appear in the activity of that person. How do I add on in this php sample code here.

<?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>";
?>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!