diff --git a/resources/js/app.js b/resources/js/app.js index c1a8540..5914d00 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -76,6 +76,8 @@ Alpine.data('form', () => ({ } ); + _paq.push(['trackEvent', 'anfrage', 'dateValidated', 'result', response.data.result]); + tippy('[data-tippy-target]', { content: response.data.result ? 'Dieser Termin ist voraussichtlich verfügbar' : 'Dieser Termin ist leider nicht buchbar', showOnCreate: true, @@ -105,12 +107,15 @@ Alpine.data('form', () => ({ behaviour: 'smooth', }); this.sending = false; + _paq.push(['trackEvent', 'anfrage', 'submitted']); } catch (e) { this.sending = false; if (!e instanceof axios.AxiosError || !e.response || !e.response.data || !e.response.data['X_WINTER_ERROR_FIELDS']) { + _paq.push(['trackEvent', 'anfrage', 'submitInternalError']); throw e; } const errors = e.response.data['X_WINTER_ERROR_FIELDS']; + _paq.push(['trackEvent', 'anfrage', 'submitValidationFailed']); Object.keys(errors).forEach((k) => { errors[k].forEach((msg) => error(msg)); });