diff options
| author | horus | 2022-11-16 00:45:29 +0100 |
|---|---|---|
| committer | horus | 2022-11-16 00:45:29 +0100 |
| commit | 3cebb5cdc22dfbdc5fcb4692753e4811046cf47c (patch) | |
| tree | 556c6df4f1b0ad10f59d65139e5ff527a25a4433 /app/Http/Controllers/LinkController.php | |
| parent | f4e8c78413b4f48ddb9910afa356c3d711188f2b (diff) | |
| download | kategorischeraperitif-3cebb5cdc22dfbdc5fcb4692753e4811046cf47c.tar.gz | |
fix some rough edges with the link shorter and matomo tracking
Diffstat (limited to 'app/Http/Controllers/LinkController.php')
| -rw-r--r-- | app/Http/Controllers/LinkController.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/Http/Controllers/LinkController.php b/app/Http/Controllers/LinkController.php index 4515e04..a9d343f 100644 --- a/app/Http/Controllers/LinkController.php +++ b/app/Http/Controllers/LinkController.php @@ -14,7 +14,7 @@ class LinkController extends Controller { */ public function redirect(Request $request, $shortlink) { - $matomo = new \MatomoTracker( env('MATOMO_LINK_SHORTER_ID'), env('MATOMO_URL')); + $matomo = new \MatomoTracker( env('MATOMO_LINK_SHORTER_ID'), env('MATOMO_BACKEND_URL')); $matomo->setTokenAuth( env('MATOMO_LINK_SHORTER_AUTH_TOKEN') ); #$matomo->setVisitorId( $matomo->getVisitorId() ); $matomo->setIp( $request->header('X_REAL_IP') ); @@ -23,13 +23,14 @@ class LinkController extends Controller { $matomo->setBrowserLanguage( $request->server('HTTP_ACCEPT_LANGUAGE') ); $matomo->setUserAgent( $request->server('HTTP_USER_AGENT') ); - $data = DB::table('all_view')->select('name', 'shop', 'spirit_type', 'long_url')->where('url', "https://l.fuselkoenig.de/" . $shortlink)->limit(1)->get()->first(); + #$data = DB::table('all_view')->select('name', 'shop', 'spirit_type', 'long_url')->where('url', $shortlink)->limit(1)->get()->first(); + $data = DB::table('angebot')->select('name', 'shop', 'spirit_type', 'url as long_url')->where('short_url', $shortlink)->limit(1)->get()->first(); $matomo->doTrackPageView( $data->name . " - " . $data->shop ); $matomo->doTrackEvent("Redirect", "Shop", $data->shop); $matomo->doTrackEvent("Redirect", "Name", $data->name); $matomo->doTrackEvent("Redirect", "Spirit Type", $data->spirit_type); - $matomo->doTrackEvent("Redirect", "Short URL", $shortlink); + $matomo->doTrackEvent("Redirect", "Short URL", env('LINK_SHORTER_BASE_DOMAIN') . $shortlink); $matomo->doTrackEvent("Redirect", "Long URL", $data->long_url); #return response()->json($data); |
