--- /dev/null
+@if($enabled)
+ {{--<!-- Global site tag (gtag.js) - Google Analytics -->--}}
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{$id}}"></script>
+ <script>
+ window.dataLayer = window.dataLayer || [];
+
+ function gtag() {
+ dataLayer.push(arguments);
+ }
+
+ gtag('js', new Date());
+ gtag('config', '{{$id}}');
+ </script>
+@endif
-@if($enabled)
- {{--<!-- Global site tag (gtag.js) - Google Analytics -->--}}
- <script async src="https://www.googletagmanager.com/gtag/js?id={{$id}}"></script>
- <script>
- window.dataLayer = window.dataLayer || [];
-
- function gtag() {
- dataLayer.push(arguments);
- }
-
- gtag('js', new Date());
- gtag('config', '{{$id}}');
- </script>
-@endif
+@include('gtag::head')
+@include('gtag::body')
], 'views');
$this->app['view']->creator(
- ['gtag::script'],
+ ['gtag::body', 'gtag::head', 'gtag::script'],
'Cubist\Gtag\ScriptViewCreator'
);
}