Mailchimp_Goal

The Mailchimp Subscription Form Mailchimp Goal class.

Defined (1)

The class is defined in the following location(s).

/classes/mailchimp/Mailchimp/Goal.php  
  1. class Mailchimp_Goal { 
  2. public function __construct(NM_Mailchimp $master) { 
  3. $this->master = $master; 
  4.  
  5. /** 
  6. * Retrieve goal event data for a particular list member. Note: only unique events are returned. If a user triggers 
  7. a particular event multiple times, you will still only receive one entry for that event. 
  8. * @param string $list_id 
  9. * @param associative_array $email 
  10. * - email string an email address 
  11. * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc. 
  12. * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes 
  13. * @param int $start 
  14. * @param int $limit 
  15. * @return associative_array Event data and metadata 
  16. * - data array An array of goal data structs for the specified list member in the following format 
  17. * - event string The URL or name of the event that was triggered 
  18. * - last_visited_at string A timestamp in the format 'YYYY-MM-DD HH:MM:SS' that represents the last time this event was seen. 
  19. * - total int The total number of events that match your criteria. 
  20. */ 
  21. public function events($list_id, $email, $start=0, $limit=25) { 
  22. $_params = array("list_id" => $list_id, "email" => $email, "start" => $start, "limit" => $limit); 
  23. return $this->master->call('goal/events', $_params); 
  24.  
  25. /** 
  26. * this allows programmatically trigger goal event collection without the use of front-end code. 
  27. * @param string $list_id 
  28. * @param associative_array $email 
  29. * - email string an email address 
  30. * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc. 
  31. * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes 
  32. * @param string $campaign_id 
  33. * @param string $event 
  34. * @return associative_array Event data for the submitted event 
  35. * - event string The URL or name of the event that was triggered 
  36. * - last_visited_at string A timestamp in the format 'YYYY-MM-DD HH:MM:SS' that represents the last time this event was seen. 
  37. */ 
  38. public function recordEvent($list_id, $email, $campaign_id, $event) { 
  39. $_params = array("list_id" => $list_id, "email" => $email, "campaign_id" => $campaign_id, "event" => $event); 
  40. return $this->master->call('goal/record-event', $_params); 
  41.