Hello,
I have set up Event Tracking on our pages following the instructions on https://help.activecampaign.com/hc/en-us/articles/221870128-An-overview-of-Event-Tracking
I have set up a PHP Curl POST request which I trigger via a JavaScript onclick
event. For example I have a “Download Now” button which triggers the JavaScript onclick
event, which in turn calls the PHP script to send the event to Active Campaign.
This appears to be working correctly, but the event logged isn’t attributed to a user.
According to the link above, this code is where I need to supply the users email address:
"visit" => json_encode(array(
// If you have an email address, assign it here.
"email" => "",
)),
If I manually put an email address here, I can see the event being tracked against that user. I want to know how I can populate this field automatically with the current user. I can’t find any documentation that explains how to achieve this!
To further explain, I have a landing page with a form. Once the form is completed the user goes to a “thank you” landing page. When they click the “Download Now” button on the thank you page, I want to track this event against the user.