diff options
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); |
