DataLook Docs
Install guides

Laravel (PHP)

Install DataLook on Laravel (PHP) — the plain script tag, or the first-party proxy that beats ad blockers. Both on one page.

Add the tag to your Blade layout.

Add the script to your layout <head>

resources/views/layouts/app.blade.php
<script defer src="https://cdn.datalook.app/s.js" data-site="YOUR_SITE_ID"></script>

The proxy install serves both s.js and the collector from your own domain, so ad blockers — which match on domain, not path — can't see us. You rewrite one innocuous path prefix to our CDN; the script figures out the rest.

A catch-all route forwards the prefix with the HTTP client.

Add the route

routes/web.php
use Illuminate\Support\Facades\Http;use Illuminate\Http\Request;Route::match(['get', 'post'], '/_axis/{path}', function (Request $request, string $path) {    $target = "https://cdn.datalook.app/{$path}";    $headers = ['X-Forwarded-For' => $request->ip()];    $res = $request->isMethod('post')        ? Http::withHeaders($headers)->withBody($request->getContent(),              $request->header('Content-Type', 'text/plain'))->post($target)        : Http::withHeaders($headers)->get($target);    return response($res->body(), $res->status())        ->header('Content-Type', $res->header('Content-Type'));})->where('path', '.*');

Point the script at the prefix

<script defer src="/_axis/s.js" data-site="YOUR_SITE_ID"></script>

Heads up

Your server now sits between the visitor and us, so forward the visitor IP (X-Forwarded-For) or your country breakdown will collapse to your server location. The DNS proxy avoids this entirely — see the proxy overview.