Commit 623debf9 authored by Avris's avatar Avris

🤦‍♂️

parent 4f3368aa
......@@ -9,6 +9,7 @@ use Twig\TwigFunction;
final class GoogleAnalytics extends AbstractExtension
{
const CODE = <<<HTML
<script async src="https://www.googletagmanager.com/gtag/js?id=%s"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
......@@ -39,7 +40,7 @@ HTML;
{
return [
new TwigFunction('googleAnaytics', function () {
return $this->trackingId ? sprintf(static::CODE, $this->trackingId) : '';
return $this->trackingId ? sprintf(static::CODE, $this->trackingId, $this->trackingId) : '';
}, ['is_safe' => ['html']]),
];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment