- Edited
so I'm trying to add the gtm snippet into my head but the result isn't reflecting
I have tried to use the extend.php method.
the following is my code in extend.php
but upon inspect source, the code isnt being placed
`<?php
/*
- This file is part of Flarum.
* - (c) Toby Zerner toby.zerner@gmail.com
* - For the full copyright and license information, please view the LICENSE
- file that was distributed with this source code.
*/
use Flarum\Extend;
use Flarum\Frontend\Document;
return [
(new Extend\Frontend('forum'))
->content(function (Document $document) {
$document->head[] = "<!-- Google Tag Manager -->
<script>('GTM script')</script>
<!-- End Google Tag Manager -->";
})
];`