feat: tracking integration with GTM and CMP

This commit is contained in:
Björn Fromme
2026-01-27 17:31:41 +01:00
parent d5944bf717
commit e9548d9f38
21 changed files with 453 additions and 51 deletions
@@ -95,6 +95,10 @@
</div>
</div>
{% include '_partials/_tracking.html.twig' with {
'url': '/trichter_Z1/schritt0_login_oder_gast',
'title': 'Login oder Gast'
} %}
{% endblock %}
{% block footer %}
-1
View File
@@ -6,7 +6,6 @@
date_id: params.dateId,
hotel_id: params.hotelId,
agency: params.agency,
theme: params.theme,
r: params.returnUrl
}) }}"
hx-trigger="load"
@@ -101,4 +101,8 @@
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
{% include '_partials/_tracking.html.twig' with {
'url': '/trichter_Z1/schritt1_zimmerauswahl',
'title': 'Zimmerauswahl'
} %}
{% endblock %}
@@ -75,4 +75,8 @@
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
{% include '_partials/_tracking.html.twig' with {
'url': '/trichter_Z1/schritt2_teilnehmende_leistungen',
'title': 'Teilnehmende und Leistungen'
} %}
{% endblock %}
@@ -85,4 +85,8 @@
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
{% include '_partials/_tracking.html.twig' with {
'url': '/trichter_Z1/schritt3_zahlungsart',
'title': 'Zahlungsart'
} %}
{% endblock %}
@@ -567,4 +567,8 @@
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
{% include '_partials/_tracking.html.twig' with {
'url': '/trichter_Z1/schritt4_uerbersicht_bestaetigung',
'title': 'Übersicht und Bestätigung'
} %}
{% endblock %}
@@ -55,4 +55,23 @@
</div>
</div>
{% if bookingTotal is not null and travelName is not null %}
<script>
window.dataLayer = window.dataLayer || [];
var consent = (window.CookieFirst && window.CookieFirst.consent) || { advertising: false };
if (consent.advertising) {
dataLayer.push({
'event': 'Transaction',
'userInfo': '{{ is_granted('ROLE_USER') ? 'mitglied' : 'gast' }}',
'transactionId': '{{ bookingNumber }}',
'transactionTotal': {{ bookingTotal }},
'transactionProducts': [{
'name': '{{ travelName|e('js') }}',
'price': {{ bookingTotal }},
'quantity': 1
}]
});
}
</script>
{% endif %}
{% endblock %}