{% extends "@Storefront/storefront/component/analytics.html.twig" %}
{% block component_head_analytics %}
{% if context.salesChannel.analytics and context.salesChannel.analytics.isActive() %}
{% set trackingId = context.salesChannel.analytics.getTrackingId() %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ trackingId }}"></script>
<script>
window.gtagActive = true;
window.controllerName = '{{ controllerName|lower }}';
window.actionName = '{{ controllerAction|lower }}';
window.dataLayer = window.dataLayer || [];
window.trackOrders = '{{ context.salesChannel.analytics.isTrackOrders() }}';
function gtag() { dataLayer.push(arguments); }
{% block component_head_analytics_tag_config %}
window.gtagCallback = function gtagCallbackFunction() {
gtag('js', new Date());
gtag('config', '{{ trackingId }}', {
'anonymize_ip': '{{ context.salesChannel.analytics.isAnonymizeIp() }}',
'cookie_domain': 'none',
'cookie_prefix': '_swag_ga',
});
};
{% endblock %}
</script>
<script>
function gtag_report_conversion_mailto(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;
}
};
gtag('event', 'conversion', {
'send_to': 'AW-777785196/_jjhCNy7__cCEOye8PIC',
'event_callback': callback
});
return false;
}
</script>
<script>
function gtag_report_conversion_tel(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;
}
};
gtag('event', 'conversion', {
'send_to': 'AW-777785196/mhZfCKDB__cCEOye8PIC',
'event_callback': callback
});
return false;
}
</script>
{% if controllerAction is same as("finishPage") %}
<script>
gtag('event', 'conversion', {'send_to': 'AW-777785196/amxJCMzjuOYBEOye8PIC'});
</script>
{% endif %}
<script async src="{{ "analytics.gtagScriptSrc"|trans|sw_sanitize }}"></script>
<script>
{{ "analytics.gtagScripts"|trans|sw_sanitize }}
</script>
<script>
{{ "analytics.gtagScript2"|trans|sw_sanitize }}
</script>
<script>
{{ "analytics.gtagScript3"|trans|sw_sanitize }}
</script>
<script>
{{ "analytics.gtagScript4"|trans|sw_sanitize }}
</script>
{% endif %}
{% endblock %}