Skip to content
Snippets Groups Projects
Commit a3c6e024 authored by Ivan Trokhanenko's avatar Ivan Trokhanenko
Browse files

Issue #3321116 by donbuche: Change <script> code so it supports new GA properties

parent bbe6ba7c
No related branches found
No related tags found
No related merge requests found
Pipeline #381810 passed with warnings
......@@ -85,14 +85,12 @@ class GoogleAnalyticResponseSubscriber implements EventSubscriberInterface {
// Build script tags.
$script = [];
$script = <<<EOS
<script async src="https://www.googletagmanager.com/gtag/js?id=$compact"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '$compact', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '$compact');
</script>
EOS;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment