<?php
use Twig\Environment;
use function Shopware\Core\Framework\Adapter\Twig\sw_get_attribute;
use function Shopware\Core\Framework\Adapter\Twig\sw_escape_filter;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* @WbmTagManagerAnalytics/storefront/layout/meta.html.twig */
class __TwigTemplate_6c5a77348753bfa0010ab685c7a35073 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'layout_head_meta_tags_charset' => [$this, 'block_layout_head_meta_tags_charset'],
'wbm_layout_head_tag_manager_data_layer_push' => [$this, 'block_wbm_layout_head_tag_manager_data_layer_push'],
'wbm_layout_head_tag_manager_snippet' => [$this, 'block_wbm_layout_head_tag_manager_snippet'],
];
}
protected function doGetParent(array $context)
{
// line 2
return "@SolidAdvancedSliderElements/storefront/layout/meta.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@WbmTagManagerAnalytics/storefront/layout/meta.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@WbmTagManagerAnalytics/storefront/layout/meta.html.twig"));
$this->parent = $this->loadTemplate("@SolidAdvancedSliderElements/storefront/layout/meta.html.twig", "@WbmTagManagerAnalytics/storefront/layout/meta.html.twig", 2);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
public function block_layout_head_meta_tags_charset($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "layout_head_meta_tags_charset"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "layout_head_meta_tags_charset"));
// line 4
echo " ";
$this->displayParentBlock("layout_head_meta_tags_charset", $context, $blocks);
echo "
<!-- WbmTagManagerAnalytics Head Snippet Start -->
";
// line 6
$this->displayBlock('wbm_layout_head_tag_manager_data_layer_push', $context, $blocks);
// line 25
echo " ";
$this->displayBlock('wbm_layout_head_tag_manager_snippet', $context, $blocks);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 6
public function block_wbm_layout_head_tag_manager_data_layer_push($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "wbm_layout_head_tag_manager_data_layer_push"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "wbm_layout_head_tag_manager_data_layer_push"));
// line 7
echo " <script id=\"wbmTagMangerDefine\" ";
echo sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "dataLayerScriptTagAttributes", [], "any", false, false, false, 7);
echo ">";
// line 8
echo "
let gtmIsTrackingProductClicks = Boolean(";
echo sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "isTrackingProductClicks", [], "any", false, false, false, 8);
// line 9
echo "),
gtmIsTrackingAddToWishlistClicks = Boolean(";
echo sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "isTrackingAddToWishlistClicks", [], "any", false, false, false, 9);
// line 10
echo "),
gtmContainerId = '";
echo sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "gtmContainerId", [], "any", false, false, false, 10);
// line 11
echo "',
hasSWConsentSupport = Boolean(Number(";
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "hasSWConsentSupport", [], "any", false, false, false, 11), "html", null, true);
// line 14
echo "));
window.wbmScriptIsSet = false;
window.dataLayer = window.dataLayer || [];
window.dataLayer.push(";
echo ($context["dataLayerUser"] ?? null);
echo ");";
echo "
</script>
";
// line 16
if (($context["dataLayer"] ?? null)) {
echo "<script id=\"wbmTagMangerDataLayer\" ";
echo sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "dataLayerScriptTagAttributes", [], "any", false, false, false, 16);
echo ">";
// line 18
echo "
window.dataLayer.push({ ecommerce: null });
window.dataLayer.push(";
echo ($context["dataLayer"] ?? null);
// line 20
echo ");
";
if (($context["onEvent"] ?? null)) {
// line 21
echo "
var onEventDataLayer = JSON.parse('";
echo ($context["onEvent"] ?? null);
// line 22
echo "');
";
}
// line 23
echo " </script>";
}
// line 24
echo " ";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 25
public function block_wbm_layout_head_tag_manager_snippet($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "wbm_layout_head_tag_manager_snippet"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "wbm_layout_head_tag_manager_snippet"));
// line 26
echo " ";
if (sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "gtmContainerId", [], "any", false, false, false, 26)) {
// line 27
echo " <script id=\"wbmTagManger\" ";
echo sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "scriptTagAttributes", [], "any", false, false, false, 27);
echo ">";
// line 33
echo "
function getCookie(name) {
var cookieMatch = document.cookie.match(name + '=(.*?)(;|\$)');
return cookieMatch && decodeURI(cookieMatch[1]);
}
var gtmCookieSet = getCookie('";
echo sw_escape_filter($this->env, sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "wbmCookieEnabledName", [], "any", false, false, false, 33), "html", null, true);
// line 34
echo "');
";
if (twig_test_empty(sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "gtmFunctionOverwrite", [], "any", false, false, false, 34))) {
// line 35
echo "
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+'";
echo twig_trim_filter(sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "extendedUrlParameter", [], "any", false, false, false, 35));
// line 36
echo "';f.parentNode.insertBefore(j,f);};
";
} else {
// line 37
echo "
var googleTag = ";
echo twig_replace_filter(sw_get_attribute($this->env, $this->source, ($context["wbmTagManagerConfig"] ?? null), "gtmFunctionOverwrite", [], "any", false, false, false, 37), ["
" => "", "
" => "", "\t" => ""]);
// line 38
echo "
";
}
// line 48
echo "
if (hasSWConsentSupport && gtmCookieSet === null) {
window.wbmGoogleTagmanagerId = gtmContainerId;
window.wbmScriptIsSet = false;
window.googleTag = googleTag;
} else {
window.wbmScriptIsSet = true;
googleTag(window, document, 'script', 'dataLayer', gtmContainerId);
googleTag = null;
}";
echo "
</script><!-- WbmTagManagerAnalytics Head Snippet End -->";
}
// line 50
echo " ";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "@WbmTagManagerAnalytics/storefront/layout/meta.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("{% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
{% block layout_head_meta_tags_charset %}
{{ parent() }}
<!-- WbmTagManagerAnalytics Head Snippet Start -->
{% block wbm_layout_head_tag_manager_data_layer_push %}
<script id=\"wbmTagMangerDefine\" {{ wbmTagManagerConfig.dataLayerScriptTagAttributes|raw }}>{% verbatim %}
let gtmIsTrackingProductClicks = Boolean({% endverbatim %}{{ wbmTagManagerConfig.isTrackingProductClicks|raw }}{% verbatim %}),
gtmIsTrackingAddToWishlistClicks = Boolean({% endverbatim %}{{ wbmTagManagerConfig.isTrackingAddToWishlistClicks|raw }}{% verbatim %}),
gtmContainerId = '{% endverbatim %}{{ wbmTagManagerConfig.gtmContainerId|raw }}{% verbatim %}',
hasSWConsentSupport = Boolean(Number({% endverbatim %}{{ wbmTagManagerConfig.hasSWConsentSupport }}{% verbatim %}));
window.wbmScriptIsSet = false;
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({% endverbatim %}{{ dataLayerUser|raw }}{% verbatim %});{% endverbatim %}
</script>
{% if dataLayer %}<script id=\"wbmTagMangerDataLayer\" {{ wbmTagManagerConfig.dataLayerScriptTagAttributes|raw }}>{% verbatim %}
window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({% endverbatim %}{{ dataLayer|raw }}{% verbatim %});
{% endverbatim %}{% if onEvent %}{% verbatim %}
var onEventDataLayer = JSON.parse('{% endverbatim %}{{ onEvent|raw }}{% verbatim %}');
{% endverbatim %}{% endif %}
</script>{% endif %}
{% endblock %}
{% block wbm_layout_head_tag_manager_snippet %}
{% if wbmTagManagerConfig.gtmContainerId %}
<script id=\"wbmTagManger\" {{ wbmTagManagerConfig.scriptTagAttributes|raw }}>{% verbatim %}
function getCookie(name) {
var cookieMatch = document.cookie.match(name + '=(.*?)(;|\$)');
return cookieMatch && decodeURI(cookieMatch[1]);
}
var gtmCookieSet = getCookie('{% endverbatim %}{{ wbmTagManagerConfig.wbmCookieEnabledName }}{% verbatim %}');
{% endverbatim %}{% if wbmTagManagerConfig.gtmFunctionOverwrite is empty %}{% verbatim %}
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);};
{% endverbatim %}{% else %}{% verbatim %}
var googleTag = {% endverbatim %}{{ wbmTagManagerConfig.gtmFunctionOverwrite|replace({\"\\n\": \"\", \"\\r\": \"\", \"\\t\": \"\"})|raw }}{% verbatim %}
{% endverbatim %}{% endif %}{% verbatim %}
if (hasSWConsentSupport && gtmCookieSet === null) {
window.wbmGoogleTagmanagerId = gtmContainerId;
window.wbmScriptIsSet = false;
window.googleTag = googleTag;
} else {
window.wbmScriptIsSet = true;
googleTag(window, document, 'script', 'dataLayer', gtmContainerId);
googleTag = null;
}{% endverbatim %}
</script><!-- WbmTagManagerAnalytics Head Snippet End -->{% endif %}
{% endblock %}
{% endblock %}
", "@WbmTagManagerAnalytics/storefront/layout/meta.html.twig", "/var/customers/webs/fporzellan/htdocs/custom/plugins/WbmTagManagerAnalytics/src/Resources/views/storefront/layout/meta.html.twig");
}
}