{% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
{% block layout_head_meta_tags_charset %}
{{ parent() }}
{% block wbm_layout_head_tag_manager_data_layer_push %}
<script>
let gtmIsTrackingProductClicks = Boolean({{ wbmTagManagerConfig.isTrackingProductClicks|raw }}), gtmContainerId = '{{ wbmTagManagerConfig.gtmContainerId|raw }}', hasSWConsentSupport = Boolean(Number({{ wbmTagManagerConfig.hasSWConsentSupport }}));
window.wbmScriptIsSet = false;
</script>
{% if dataLayer %}<script {{ wbmTagManagerConfig.dataLayerScriptTagAttributes|raw }}>{% verbatim %}
window.dataLayer = window.dataLayer || [];
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 %}<!-- WbmTagManagerEcomm Head Snippet Start -->
<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 }}{% 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><!-- WbmTagManagerEcomm Head Snippet End -->{% endif %}
{% endblock %}
{% endblock %}