From e89a7bb329abf3cd252fea7f624acbc454d7caf4 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Tue, 11 Jun 2024 21:36:58 +0100 Subject: Add pageview logging via PostHog --- app/Http/Middleware/PageView.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/Http/Middleware/PageView.php (limited to 'app/Http/Middleware/PageView.php') diff --git a/app/Http/Middleware/PageView.php b/app/Http/Middleware/PageView.php new file mode 100644 index 0000000..dda0662 --- /dev/null +++ b/app/Http/Middleware/PageView.php @@ -0,0 +1,28 @@ + request()->ip(), + 'event' => '$pageview', + 'properties' => array( + '$current_url' => url()->current(), + ), + ]); + return $next($request); + } +} -- cgit v1.2.3-54-g00ecf