templates/Layout/_googletagmanager.html.twig line 1

Open in your IDE?
  1. {% if gtm_code is defined %}
  2.     <!-- Google Tag Manager -->
  3.     <noscript>
  4.         <iframe src="//www.googletagmanager.com/ns.html?id={{ gtm_code }}" height="0" width="0" style="display:none;visibility:hidden"></iframe>
  5.     </noscript>
  6.     <script>
  7.     (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='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','{{ gtm_code }}');
  8.     </script>
  9.     <!-- End Google Tag Manager -->
  10. {% endif %}
  11. {% if fb_pixel is defined %}
  12. <!-- Facebook Pixel Code -->
  13. <script>
  14.     !function(f,b,e,v,n,t,s)
  15.     {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
  16.         n.callMethod.apply(n,arguments):n.queue.push(arguments)};
  17.         if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
  18.         n.queue=[];t=b.createElement(e);t.async=!0;
  19.         t.src=v;s=b.getElementsByTagName(e)[0];
  20.         s.parentNode.insertBefore(t,s)}(window,document,'script',
  21.         'https://connect.facebook.net/en_US/fbevents.js');
  22.     fbq('init', {{ fb_pixel }});
  23.     fbq('track', 'PageView');
  24. </script>
  25. <noscript>
  26.     <img height="1" width="1"
  27.          src="https://www.facebook.com/tr?id=305425063737731&ev=PageView
  28. &noscript=1"/>
  29. </noscript>
  30. <!-- End Facebook Pixel Code -->
  31. {% endif %}