Commit deb3e2e4 authored by Alex Buijs's avatar Alex Buijs

Trigger tracking event without user interaction

parent 8b8c5984
...@@ -20,12 +20,14 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -20,12 +20,14 @@ document.addEventListener('DOMContentLoaded', () => {
// Save the URL fragment from the current window location. This will be present if the user was // Save the URL fragment from the current window location. This will be present if the user was
// redirected to sign-in after attempting to access a protected URL that included a fragment. // redirected to sign-in after attempting to access a protected URL that included a fragment.
preserveUrlFragment(window.location.hash); preserveUrlFragment(window.location.hash);
});
if (gon.tracking_data) {
const { category, action, ...data } = gon.tracking_data;
if (gon.tracking_data) { $('#signin-container a[data-toggle="tab"]').on('shown.bs.tab', e => {
const tab = document.querySelector(".new-session-tabs a[href='#register-pane']"); if (e.target.dataset.qaSelector === 'register_tab') {
const { category, action, ...data } = gon.tracking_data;
tab.addEventListener('click', () => {
Tracking.event(category, action, data); Tracking.event(category, action, data);
}); }
} });
}); }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment