ad blockers resistent code
This commit is contained in:
@@ -18,7 +18,12 @@ class TrackingScriptController extends Controller
|
||||
->header('Content-Type', 'application/javascript');
|
||||
}
|
||||
|
||||
$collectUrl = route('collect.store');
|
||||
// Use ad-blocker resistant endpoint if script is loaded from /cdn/resources/
|
||||
// Otherwise use the original endpoint for backward compatibility
|
||||
$currentRoute = request()->route()->getName();
|
||||
$collectUrl = $currentRoute === 'tracking.script.alt'
|
||||
? route('collect.store.alt')
|
||||
: route('collect.store');
|
||||
|
||||
$js = view('tracking.tracker', [
|
||||
'trackingId' => $trackingId,
|
||||
|
||||
Reference in New Issue
Block a user