vendor/store.shopware.com/dtgsgoogletagmanagersw6/src/Resources/views/storefront/plugins/TagManager/tagmanager_main.html.twig line 1

Open in your IDE?
  1. {% set gtmConfig = config('DtgsGoogleTagManagerSw6.config') %}
  2. {% if gtmIsActive(gtmConfig.googleId) %}
  3.     {% if gtmConfig.pagehidingEnabled == true %}
  4.     {% for containerId in gtmGetContainerIds(gtmConfig.googleId) %}
  5.     <!-- Page-hiding snippet (recommended)  -->
  6.     <style>.async-hide { opacity: 0 !important} </style>
  7.     <script{{ page.extensions.GoogleTagManagerConfig.usercentricsCode }}>{% verbatim %}(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;
  8.                     h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
  9.                     (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
  10.                 })(window,document.documentElement,'async-hide','dataLayer',4000,
  11.                     {'{% endverbatim %}{{ containerId }}':true});</script>{% endfor %}
  12.     {% endif %}
  13.     {% for containerId in gtmGetContainerIds(gtmConfig.googleId) %}
  14.     <script{{ page.extensions.GoogleTagManagerConfig.usercentricsCode|raw }}>{% verbatim %}(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  15.                     new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  16.                 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  17.                 '{% endverbatim %}{{ gtmGetJsUrl(gtmConfig.customGtmJsUrl) }}{% verbatim %}gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  18.             }{% endverbatim %})(window,document,'script','dataLayer','{{ containerId }}');</script>{% endfor %}
  19. {%  endif %}