Clarification on event tracking parameters needed

In the example code for php code to track events, I’m unclear on the values to enter to track a link click on our wordpress site.

For example, in this code snippet: event" => “YOUR_EVENT”,
“eventdata” => “ANY_DATA”,
“visit” => json_encode(array(
// If you have an email address, assign it here.
** “email” => “”,**

  1. “assign an email value”?? Does this reference the contact’s email that’s been cookied?
  2. Can you provide a specific example of the correct values if I want to track which contact clicked a site link AND how to add a tag to their contact record.
  3. What would go in “event data” ?

I’ve created the code with the keys and event name. The rest could use a code example.

Thanks.

Hello,

The email value refers to the email address of the Contact that you would like to associate the event to. This can definitely be pulled from the cookie if it exists. Alternately if there is another means on your site for users to enter or display an email address (such as a form field) you can also use javascript to pull in the email address from there.

The eventdata is the data associated with your event. You use this to store a value unique to that particular event. For instance, if your event is browsed_product you can use the eventdata to pass in the product that was browsed.

Adding a Tag to the contact will require a second API call to the contactTags v3 endpoint.

Please let me know if you have any further questions about this!

Thank you,
-Matt