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