How to add Google Tag Manager to admin pages

I would love to get some analytics about the pages viewed by my users therefore I am using: https://github.com/spatie/laravel-googletagmanager From their documentation: First you'll need to include Google Tag Manager's script. Google's docs recommend doing this right after the body tag.
{{-- layout.blade.php --}}
<html>
<head>
@include('googletagmanager::head')
{{-- ... --}}
</head>
<body>
@include('googletagmanager::body')
{{-- ... --}}
</body>
</html>
{{-- layout.blade.php --}}
<html>
<head>
@include('googletagmanager::head')
{{-- ... --}}
</head>
<body>
@include('googletagmanager::body')
{{-- ... --}}
</body>
</html>
As I can't find any layout file, neither I know how to publish them I looked up for https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files. I am wondering what the best way would be. Cheers,
GitHub
GitHub - spatie/laravel-googletagmanager: Easily setup and send dat...
Easily setup and send data to Google Tag Manager in Laravel apps - GitHub - spatie/laravel-googletagmanager: Easily setup and send data to Google Tag Manager in Laravel apps
3 Replies
LordOfDrols
LordOfDrolsOP15mo ago
For future reference:
->renderHook('panels::head.end', fn(): string => Blade::render("@include('googletagmanager::head')"))
->renderHook('panels::body.start', fn(): string => Blade::render("@include('googletagmanager::body')"));
->renderHook('panels::head.end', fn(): string => Blade::render("@include('googletagmanager::head')"))
->renderHook('panels::body.start', fn(): string => Blade::render("@include('googletagmanager::body')"));
Aiman Yusuf
Aiman Yusuf7mo ago
test
Want results from more Discord servers?
Add your server