Check if Matomo Event Tracker is present
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
763076ca8b
commit
d24a456152
|
@ -38,4 +38,8 @@ function onStart() {
|
||||||
g.async=true; g.src=u+'proxy.php'; s.parentNode.insertBefore(g,s);
|
g.async=true; g.src=u+'proxy.php'; s.parentNode.insertBefore(g,s);
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
{% else %}
|
||||||
|
<script>
|
||||||
|
var _paq = undefined;
|
||||||
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -76,7 +76,9 @@ Alpine.data('form', () => ({
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (_paq !== undefined) {
|
||||||
_paq.push(['trackEvent', 'anfrage', 'dateValidated', response.data.result ? 'valid' : 'invalid']);
|
_paq.push(['trackEvent', 'anfrage', 'dateValidated', response.data.result ? 'valid' : 'invalid']);
|
||||||
|
}
|
||||||
|
|
||||||
tippy('[data-tippy-target]', {
|
tippy('[data-tippy-target]', {
|
||||||
content: response.data.result ? 'Dieser Termin ist voraussichtlich verfügbar' : 'Dieser Termin ist leider nicht buchbar',
|
content: response.data.result ? 'Dieser Termin ist voraussichtlich verfügbar' : 'Dieser Termin ist leider nicht buchbar',
|
||||||
|
@ -107,15 +109,21 @@ Alpine.data('form', () => ({
|
||||||
behaviour: 'smooth',
|
behaviour: 'smooth',
|
||||||
});
|
});
|
||||||
this.sending = false;
|
this.sending = false;
|
||||||
|
if (_paq !== undefined) {
|
||||||
_paq.push(['trackEvent', 'anfrage', 'submitted']);
|
_paq.push(['trackEvent', 'anfrage', 'submitted']);
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.sending = false;
|
this.sending = false;
|
||||||
if (!e instanceof axios.AxiosError || !e.response || !e.response.data || !e.response.data['X_WINTER_ERROR_FIELDS']) {
|
if (!e instanceof axios.AxiosError || !e.response || !e.response.data || !e.response.data['X_WINTER_ERROR_FIELDS']) {
|
||||||
|
if (_paq !== undefined) {
|
||||||
_paq.push(['trackEvent', 'anfrage', 'submitInternalError']);
|
_paq.push(['trackEvent', 'anfrage', 'submitInternalError']);
|
||||||
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
const errors = e.response.data['X_WINTER_ERROR_FIELDS'];
|
const errors = e.response.data['X_WINTER_ERROR_FIELDS'];
|
||||||
|
if (_paq !== undefined) {
|
||||||
_paq.push(['trackEvent', 'anfrage', 'submitValidationFailed']);
|
_paq.push(['trackEvent', 'anfrage', 'submitValidationFailed']);
|
||||||
|
}
|
||||||
Object.keys(errors).forEach((k) => {
|
Object.keys(errors).forEach((k) => {
|
||||||
errors[k].forEach((msg) => error(msg));
|
errors[k].forEach((msg) => error(msg));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue