{% if this.GTMId %}
   {% if this.isFrontendTests %}
      <div {{ attributes.defaults(stimulus_controller(this.shortName)) }}></div>
   {% else %}
      {% if not this.noscript %}
         <!-- Google Tag Manager -->
         <script data-cookieconsent="ignore">(function(w,d,s,l,i) {w[l] = w[l] || [];w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
               var f = d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l != 'dataLayer' ? '&l=' + l : '';
               j.async = true;j.src='//{{ this.getGTMDomain() }}/gtm.js?id=' + i + dl;f.parentNode.insertBefore(j, f);
            })(window, document, 'script', 'dataLayer','{{ this.GTMId }}');</script>
         <!-- End Google Tag Manager -->
      {% else %}
         <div {{ attributes.defaults(stimulus_controller(this.shortName)) }}{% if app.environment == 'dev' %} isDevelopment{% endif %}></div>
         <!-- Google Tag Manager -->
         <noscript>
            <iframe src="//{{ this.getGTMDomain() }}/ns.html?id={{ this.GTMId }}" height="0" width="0" style="display:none;visibility:hidden"></iframe>
         </noscript>
         <!-- End Google Tag Manager -->
      {% endif %}
   {% endif %}
{% endif %}
