var/cache/dev_h709f23ac6750a26dad7ce174fa60cb15/twig/5f/5f6f87d17d97a5b148a2c47f5068550efcdb2b5acf2469539ca4f9575a15d0ad.php line 42

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use function Shopware\Core\Framework\Adapter\Twig\sw_get_attribute;
  4. use function Shopware\Core\Framework\Adapter\Twig\sw_escape_filter;
  5. use Twig\Error\LoaderError;
  6. use Twig\Error\RuntimeError;
  7. use Twig\Extension\SandboxExtension;
  8. use Twig\Markup;
  9. use Twig\Sandbox\SecurityError;
  10. use Twig\Sandbox\SecurityNotAllowedTagError;
  11. use Twig\Sandbox\SecurityNotAllowedFilterError;
  12. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  13. use Twig\Source;
  14. use Twig\Template;
  15. /* @WbmTagManagerAnalytics/storefront/layout/meta.html.twig */
  16. class __TwigTemplate_6c5a77348753bfa0010ab685c7a35073 extends Template
  17. {
  18.     private $source;
  19.     private $macros = [];
  20.     public function __construct(Environment $env)
  21.     {
  22.         parent::__construct($env);
  23.         $this->source $this->getSourceContext();
  24.         $this->blocks = [
  25.             'layout_head_meta_tags_charset' => [$this'block_layout_head_meta_tags_charset'],
  26.             'wbm_layout_head_tag_manager_data_layer_push' => [$this'block_wbm_layout_head_tag_manager_data_layer_push'],
  27.             'wbm_layout_head_tag_manager_snippet' => [$this'block_wbm_layout_head_tag_manager_snippet'],
  28.         ];
  29.     }
  30.     protected function doGetParent(array $context)
  31.     {
  32.         // line 2
  33.         return "@SolidAdvancedSliderElements/storefront/layout/meta.html.twig";
  34.     }
  35.     protected function doDisplay(array $context, array $blocks = [])
  36.     {
  37.         $macros $this->macros;
  38.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  39.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@WbmTagManagerAnalytics/storefront/layout/meta.html.twig"));
  40.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  41.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@WbmTagManagerAnalytics/storefront/layout/meta.html.twig"));
  42.         $this->parent $this->loadTemplate("@SolidAdvancedSliderElements/storefront/layout/meta.html.twig""@WbmTagManagerAnalytics/storefront/layout/meta.html.twig"2);
  43.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  44.         
  45.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  46.         
  47.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  48.     }
  49.     // line 3
  50.     public function block_layout_head_meta_tags_charset($context, array $blocks = [])
  51.     {
  52.         $macros $this->macros;
  53.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  54.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""layout_head_meta_tags_charset"));
  55.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  56.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""layout_head_meta_tags_charset"));
  57.         // line 4
  58.         echo "    ";
  59.         $this->displayParentBlock("layout_head_meta_tags_charset"$context$blocks);
  60.         echo "
  61.     <!-- WbmTagManagerAnalytics Head Snippet Start -->
  62.     ";
  63.         // line 6
  64.         $this->displayBlock('wbm_layout_head_tag_manager_data_layer_push'$context$blocks);
  65.         // line 25
  66.         echo "    ";
  67.         $this->displayBlock('wbm_layout_head_tag_manager_snippet'$context$blocks);
  68.         
  69.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  70.         
  71.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  72.     }
  73.     // line 6
  74.     public function block_wbm_layout_head_tag_manager_data_layer_push($context, array $blocks = [])
  75.     {
  76.         $macros $this->macros;
  77.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  78.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""wbm_layout_head_tag_manager_data_layer_push"));
  79.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  80.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""wbm_layout_head_tag_manager_data_layer_push"));
  81.         // line 7
  82.         echo "        <script id=\"wbmTagMangerDefine\" ";
  83.         echo sw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "dataLayerScriptTagAttributes", [], "any"falsefalsefalse7);
  84.         echo ">";
  85.         // line 8
  86.         echo "
  87.             let gtmIsTrackingProductClicks = Boolean(";
  88.         echo sw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "isTrackingProductClicks", [], "any"falsefalsefalse8);
  89.         // line 9
  90.         echo "),
  91.                 gtmIsTrackingAddToWishlistClicks = Boolean(";
  92.         echo sw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "isTrackingAddToWishlistClicks", [], "any"falsefalsefalse9);
  93.         // line 10
  94.         echo "),
  95.                 gtmContainerId = '";
  96.         echo sw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "gtmContainerId", [], "any"falsefalsefalse10);
  97.         // line 11
  98.         echo "',
  99.                 hasSWConsentSupport = Boolean(Number(";
  100.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "hasSWConsentSupport", [], "any"falsefalsefalse11), "html"nulltrue);
  101.         // line 14
  102.         echo "));
  103.             window.wbmScriptIsSet = false;
  104.             window.dataLayer = window.dataLayer || [];
  105.             window.dataLayer.push(";
  106.         echo ($context["dataLayerUser"] ?? null);
  107.         echo ");";
  108.         echo "
  109.         </script>
  110.         ";
  111.         // line 16
  112.         if (($context["dataLayer"] ?? null)) {
  113.             echo "<script id=\"wbmTagMangerDataLayer\" ";
  114.             echo sw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "dataLayerScriptTagAttributes", [], "any"falsefalsefalse16);
  115.             echo ">";
  116.             // line 18
  117.             echo "
  118.             window.dataLayer.push({ ecommerce: null });
  119.             window.dataLayer.push(";
  120.             echo ($context["dataLayer"] ?? null);
  121.             // line 20
  122.             echo ");
  123.             ";
  124.             if (($context["onEvent"] ?? null)) {
  125.                 // line 21
  126.                 echo "
  127.             var onEventDataLayer = JSON.parse('";
  128.                 echo ($context["onEvent"] ?? null);
  129.                 // line 22
  130.                 echo "');
  131.             ";
  132.             }
  133.             // line 23
  134.             echo "        </script>";
  135.         }
  136.         // line 24
  137.         echo "    ";
  138.         
  139.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  140.         
  141.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  142.     }
  143.     // line 25
  144.     public function block_wbm_layout_head_tag_manager_snippet($context, array $blocks = [])
  145.     {
  146.         $macros $this->macros;
  147.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  148.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""wbm_layout_head_tag_manager_snippet"));
  149.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  150.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""wbm_layout_head_tag_manager_snippet"));
  151.         // line 26
  152.         echo "        ";
  153.         if (sw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "gtmContainerId", [], "any"falsefalsefalse26)) {
  154.             // line 27
  155.             echo "        <script id=\"wbmTagManger\" ";
  156.             echo sw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "scriptTagAttributes", [], "any"falsefalsefalse27);
  157.             echo ">";
  158.             // line 33
  159.             echo "
  160.             function getCookie(name) {
  161.                 var cookieMatch = document.cookie.match(name + '=(.*?)(;|\$)');
  162.                 return cookieMatch && decodeURI(cookieMatch[1]);
  163.             }
  164.             var gtmCookieSet = getCookie('";
  165.             echo sw_escape_filter($this->envsw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "wbmCookieEnabledName", [], "any"falsefalsefalse33), "html"nulltrue);
  166.             // line 34
  167.             echo "');
  168.             ";
  169.             if (twig_test_empty(sw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "gtmFunctionOverwrite", [], "any"falsefalsefalse34))) {
  170.                 // line 35
  171.                 echo "
  172.             var googleTag = 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='https://www.googletagmanager.com/gtm.js?id='+i+dl+'";
  173.                 echo twig_trim_filter(sw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "extendedUrlParameter", [], "any"falsefalsefalse35));
  174.                 // line 36
  175.                 echo "';f.parentNode.insertBefore(j,f);};
  176.             ";
  177.             } else {
  178.                 // line 37
  179.                 echo "
  180.             var googleTag = ";
  181.                 echo twig_replace_filter(sw_get_attribute($this->env$this->source, ($context["wbmTagManagerConfig"] ?? null), "gtmFunctionOverwrite", [], "any"falsefalsefalse37), ["
  182. => """ " => """\t" => ""]);
  183.                 // line 38
  184.                 echo "
  185.             ";
  186.             }
  187.             // line 48
  188.             echo "
  189.             if (hasSWConsentSupport && gtmCookieSet === null) {
  190.                 window.wbmGoogleTagmanagerId = gtmContainerId;
  191.                 window.wbmScriptIsSet = false;
  192.                 window.googleTag = googleTag;
  193.             } else {
  194.                 window.wbmScriptIsSet = true;
  195.                 googleTag(window, document, 'script', 'dataLayer', gtmContainerId);
  196.                 googleTag = null;
  197.             }";
  198.             echo "
  199.         </script><!-- WbmTagManagerAnalytics Head Snippet End -->";
  200.         }
  201.         // line 50
  202.         echo "    ";
  203.         
  204.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  205.         
  206.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  207.     }
  208.     public function getTemplateName()
  209.     {
  210.         return "@WbmTagManagerAnalytics/storefront/layout/meta.html.twig";
  211.     }
  212.     public function isTraitable()
  213.     {
  214.         return false;
  215.     }
  216.     public function getDebugInfo()
  217.     {
  218.         return array (  227 => 50,  212 => 48,  208 => 38,  203 => 37,  199 => 36,  195 => 35,  191 => 34,  182 => 33,  178 => 27,  175 => 26,  165 => 25,  155 => 24,  152 => 23,  148 => 22,  144 => 21,  139 => 20,  134 => 18,  129 => 16,  119 => 14,  115 => 11,  111 => 10,  107 => 9,  103 => 8,  99 => 7,  89 => 6,  78 => 25,  76 => 6,  70 => 4,  60 => 3,  37 => 2,);
  219.     }
  220.     public function getSourceContext()
  221.     {
  222.         return new Source("{% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
  223. {% block layout_head_meta_tags_charset %}
  224.     {{ parent() }}
  225.     <!-- WbmTagManagerAnalytics Head Snippet Start -->
  226.     {% block wbm_layout_head_tag_manager_data_layer_push %}
  227.         <script id=\"wbmTagMangerDefine\" {{ wbmTagManagerConfig.dataLayerScriptTagAttributes|raw }}>{% verbatim %}
  228.             let gtmIsTrackingProductClicks = Boolean({% endverbatim %}{{ wbmTagManagerConfig.isTrackingProductClicks|raw }}{% verbatim %}),
  229.                 gtmIsTrackingAddToWishlistClicks = Boolean({% endverbatim %}{{ wbmTagManagerConfig.isTrackingAddToWishlistClicks|raw }}{% verbatim %}),
  230.                 gtmContainerId = '{% endverbatim %}{{ wbmTagManagerConfig.gtmContainerId|raw }}{% verbatim %}',
  231.                 hasSWConsentSupport = Boolean(Number({% endverbatim %}{{ wbmTagManagerConfig.hasSWConsentSupport }}{% verbatim %}));
  232.             window.wbmScriptIsSet = false;
  233.             window.dataLayer = window.dataLayer || [];
  234.             window.dataLayer.push({% endverbatim %}{{ dataLayerUser|raw }}{% verbatim %});{% endverbatim %}
  235.         </script>
  236.         {% if dataLayer %}<script id=\"wbmTagMangerDataLayer\" {{ wbmTagManagerConfig.dataLayerScriptTagAttributes|raw }}>{% verbatim %}
  237.             window.dataLayer.push({ ecommerce: null });
  238.             window.dataLayer.push({% endverbatim %}{{ dataLayer|raw }}{% verbatim %});
  239.             {% endverbatim %}{% if onEvent %}{% verbatim %}
  240.             var onEventDataLayer = JSON.parse('{% endverbatim %}{{ onEvent|raw }}{% verbatim %}');
  241.             {% endverbatim %}{% endif %}
  242.         </script>{% endif %}
  243.     {% endblock %}
  244.     {% block wbm_layout_head_tag_manager_snippet %}
  245.         {% if wbmTagManagerConfig.gtmContainerId %}
  246.         <script id=\"wbmTagManger\" {{ wbmTagManagerConfig.scriptTagAttributes|raw }}>{% verbatim %}
  247.             function getCookie(name) {
  248.                 var cookieMatch = document.cookie.match(name + '=(.*?)(;|\$)');
  249.                 return cookieMatch && decodeURI(cookieMatch[1]);
  250.             }
  251.             var gtmCookieSet = getCookie('{% endverbatim %}{{ wbmTagManagerConfig.wbmCookieEnabledName }}{% verbatim %}');
  252.             {% endverbatim %}{% if wbmTagManagerConfig.gtmFunctionOverwrite is empty %}{% verbatim %}
  253.             var googleTag = 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='https://www.googletagmanager.com/gtm.js?id='+i+dl+'{% endverbatim %}{{ wbmTagManagerConfig.extendedUrlParameter|trim|raw }}{% verbatim %}';f.parentNode.insertBefore(j,f);};
  254.             {% endverbatim %}{% else %}{% verbatim %}
  255.             var googleTag = {% endverbatim %}{{ wbmTagManagerConfig.gtmFunctionOverwrite|replace({\"\\n\": \"\", \"\\r\": \"\", \"\\t\": \"\"})|raw }}{% verbatim %}
  256.             {% endverbatim %}{% endif %}{% verbatim %}
  257.             if (hasSWConsentSupport && gtmCookieSet === null) {
  258.                 window.wbmGoogleTagmanagerId = gtmContainerId;
  259.                 window.wbmScriptIsSet = false;
  260.                 window.googleTag = googleTag;
  261.             } else {
  262.                 window.wbmScriptIsSet = true;
  263.                 googleTag(window, document, 'script', 'dataLayer', gtmContainerId);
  264.                 googleTag = null;
  265.             }{% endverbatim %}
  266.         </script><!-- WbmTagManagerAnalytics Head Snippet End -->{% endif %}
  267.     {% endblock %}
  268. {% endblock %}
  269. ""@WbmTagManagerAnalytics/storefront/layout/meta.html.twig""/var/customers/webs/fporzellan/htdocs/custom/plugins/WbmTagManagerAnalytics/src/Resources/views/storefront/layout/meta.html.twig");
  270.     }
  271. }