1 | <?php |
||
8 | trait ManagesEvents |
||
9 | { |
||
10 | use Action; |
||
11 | |||
12 | /** |
||
13 | * This value is unique to ActiveCampaign account and can be found named "Event Key" |
||
14 | * on Settings > Tracking > Event Tracking inside ActiveCampaign account. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | public $eventKey; |
||
19 | |||
20 | /** |
||
21 | * This value is unique to ActiveCampaign account and can be found named "actid" |
||
22 | * on Settings > Tracking > Event Tracking API. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | public $actid; |
||
27 | |||
28 | /** |
||
29 | * Creates a new event (name only). |
||
30 | * |
||
31 | * @param string $name |
||
32 | * |
||
33 | * @return Event |
||
34 | */ |
||
35 | public function createEvent($name) |
||
45 | |||
46 | /** |
||
47 | * List all events. |
||
48 | * |
||
49 | * @return Event[] |
||
50 | */ |
||
51 | public function events() |
||
59 | |||
60 | /** |
||
61 | * List name of all events. |
||
62 | * |
||
63 | * @return Event[] |
||
64 | */ |
||
65 | public function eventNames() |
||
74 | |||
75 | /** |
||
76 | * Removes an existing event tracking event (name only). |
||
77 | * |
||
78 | * @param $name |
||
79 | * |
||
80 | * @throws \TestMonitor\ActiveCampaign\Exceptions\NotFoundException |
||
81 | */ |
||
82 | public function deleteEvent($name) |
||
86 | |||
87 | /** |
||
88 | * Tracks an event by name. |
||
89 | * |
||
90 | * @param string $name name of the event to track |
||
91 | * @param string $email email address of the contact to track this event for, optional |
||
92 | * @param array $eventData a value to store for the event, optional |
||
93 | * |
||
94 | * @return bool TRUE on success, FALSE otherwise |
||
95 | * @throws \TestMonitor\ActiveCampaign\Exceptions\FailedActionException |
||
96 | */ |
||
97 | public function trackEvent($name, $email = '', $eventData = []) |
||
124 | } |
||
125 |