custom/plugins/Tuerschild_2/src/Resources/views/storefront/component/analytics.html.twig line 1

Open in your IDE?
  1. {% extends "@Storefront/storefront/component/analytics.html.twig" %}
  2. {% block component_head_analytics %}
  3.     {% if context.salesChannel.analytics and context.salesChannel.analytics.isActive() %}
  4.         {% set trackingId = context.salesChannel.analytics.getTrackingId() %}
  5.         <script async src="https://www.googletagmanager.com/gtag/js?id={{ trackingId }}"></script>
  6.         <script>
  7.             window.gtagActive = true;
  8.             window.controllerName = '{{ controllerName|lower }}';
  9.             window.actionName = '{{ controllerAction|lower }}';
  10.             window.dataLayer = window.dataLayer || [];
  11.             window.trackOrders = '{{ context.salesChannel.analytics.isTrackOrders() }}';
  12.             function gtag() { dataLayer.push(arguments); }
  13.             {% block component_head_analytics_tag_config %}
  14.                 window.gtagCallback = function gtagCallbackFunction() {
  15.                     gtag('js', new Date());
  16.                     gtag('config', '{{ trackingId }}', {
  17.                         'anonymize_ip': '{{ context.salesChannel.analytics.isAnonymizeIp() }}',
  18.                         'cookie_domain': 'none',
  19.                         'cookie_prefix': '_swag_ga',
  20.                     });
  21.                 };
  22.             {% endblock %}
  23.         </script>
  24.         <script>
  25.             function gtag_report_conversion_mailto(url) {
  26.                 var callback = function () {
  27.                     if (typeof(url) != 'undefined') {
  28.                         window.location = url;
  29.                     }
  30.                 };
  31.                 gtag('event', 'conversion', {
  32.                     'send_to': 'AW-777785196/_jjhCNy7__cCEOye8PIC',
  33.                     'event_callback': callback
  34.                 });
  35.                 return false;
  36.             }
  37.         </script>
  38.         <script>
  39.             function gtag_report_conversion_tel(url) {
  40.                 var callback = function () {
  41.                     if (typeof(url) != 'undefined') {
  42.                         window.location = url;
  43.                     }
  44.                 };
  45.                 gtag('event', 'conversion', {
  46.                     'send_to': 'AW-777785196/mhZfCKDB__cCEOye8PIC',
  47.                     'event_callback': callback
  48.                 });
  49.                 return false;
  50.             }
  51.         </script>
  52.         {% if controllerAction  is same as("finishPage") %}
  53.             <script>
  54.                 gtag('event', 'conversion', {'send_to': 'AW-777785196/amxJCMzjuOYBEOye8PIC'});
  55.             </script>
  56.         {% endif %}
  57.         <script async src="{{ "analytics.gtagScriptSrc"|trans|sw_sanitize }}"></script>
  58.         <script>
  59.             {{ "analytics.gtagScripts"|trans|sw_sanitize }}
  60.         </script>
  61.         <script>
  62.             {{ "analytics.gtagScript2"|trans|sw_sanitize }}
  63.         </script>
  64.         <script>
  65.             {{ "analytics.gtagScript3"|trans|sw_sanitize }}
  66.         </script>
  67.         <script>
  68.             {{ "analytics.gtagScript4"|trans|sw_sanitize }}
  69.         </script>
  70.     {% endif %}
  71. {% endblock %}