vendor/shopware/storefront/Resources/views/storefront/component/analytics.html.twig line 1
{% block component_head_analytics %}
{% block component_head_analytics_gtag %}
{% if context.salesChannel.analytics and context.salesChannel.analytics.isActive() %}
{% set trackingId = context.salesChannel.analytics.getTrackingId() %}
<script>
{% block component_head_analytics_gtag_config %}
window.gtagActive = true;
window.gtagURL = 'https://www.googletagmanager.com/gtag/js?id={{ trackingId }}'
window.controllerName = '{{ controllerName|lower }}';
window.actionName = '{{ controllerAction|lower }}';
window.trackOrders = '{{ context.salesChannel.analytics.isTrackOrders() }}';
window.gtagTrackingId = '{{ trackingId }}';
window.dataLayer = window.dataLayer || [];
window.gtagConfig = {
'anonymize_ip': '{{ context.salesChannel.analytics.isAnonymizeIp() }}',
'cookie_domain': 'none',
'cookie_prefix': '_swag_ga',
};
function gtag() { dataLayer.push(arguments); }
{% endblock %}
</script>
{% endif %}
{% endblock %}
{% endblock %}