Total Complexity | 2 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | class TrackController extends Controller |
||
24 | { |
||
25 | // Protected Properties |
||
26 | // ========================================================================= |
||
27 | |||
28 | protected array|bool|int $allowAnonymous = [ |
||
29 | 'track-page-view-url', |
||
30 | 'track-event-url', |
||
31 | ]; |
||
32 | |||
33 | // Public Methods |
||
34 | // ========================================================================= |
||
35 | |||
36 | /** |
||
37 | * @param string $url |
||
38 | * @param string $title |
||
39 | */ |
||
40 | public function actionTrackPageViewUrl(string $url, string $title): void |
||
41 | { |
||
42 | InstantAnalytics::$plugin->ga4->addPageViewEvent($url, $title); |
||
43 | $this->redirect($url, 200); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @param string $url |
||
48 | * @param string $eventName |
||
49 | * @param array $params |
||
50 | */ |
||
51 | public function actionTrackEventUrl( |
||
59 | } |
||
60 | } |
||
61 |