vendor/pimcore/pimcore/bundles/CoreBundle/Resources/views/Analytics/Tracking/Google/Analytics/universalTrackingCode.html.twig line 1

Open in your IDE?
  1. {% block beforeScriptTag %}{{ blocks.beforeScriptTag|raw }}{% endblock %}
  2. <script>
  3.     {% block beforeScript %}{{ blocks.beforeScript|raw }}{% endblock %}
  4.     (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  5.     (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  6.     m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  7.     })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  8.     {% block beforeInit %}{{ blocks.beforeInit|raw }}{% endblock %}
  9.     {% block trackInit %}
  10.     {% if universalConfiguration %}
  11.     ga('create', '{{ trackId }}', {{ universalConfiguration|raw }});
  12.     {% else %}
  13.     ga('create', '{{ trackId }}');
  14.     {% endif %}
  15.     ga('set', 'anonymizeIp', true);
  16.     {% endblock %}
  17.     {% block beforeTrack %}{{ blocks.beforeTrack|raw }}{% endblock %}
  18.     {% block track %}
  19.     if (typeof _gaqPageView != "undefined"){
  20.         ga('send', 'pageview', _gaqPageView);
  21.     } else {
  22.         {% if defaultPath %}
  23.         ga('send', 'pageview', '{{ defaultPath }}');
  24.         {% else %}
  25.         ga('send', 'pageview');
  26.         {% endif %}
  27.     }
  28.     {% endblock %}
  29.     {% block afterTrack %}{{ blocks.afterTrack|raw }}{% endblock %}
  30.     {% block afterScript %}{{ blocks.afterScript|raw }}{% endblock %}
  31. </script>
  32. {% block afterScriptTag %}{{ blocks.afterScriptTag|raw }}{% endblock %}