Skip to content
Snippets Groups Projects
Unverified Commit 22777bdb authored by Nemanja's avatar Nemanja
Browse files

Remove `trackStructEvent`

parent 6b683a0f
Branches
Tags
No related merge requests found
......@@ -7,8 +7,6 @@ import { getUserId } from "metabase/selectors/user";
export const createTracker = store => {
if (Settings.snowplowEnabled()) {
createSnowplowTracker(store);
document.body.addEventListener("click", handleStructEventClick, true);
}
};
......@@ -22,15 +20,6 @@ export const trackPageView = url => {
}
};
/**
* @deprecated This uses GA which is not setup. We should use `trackSchemaEvent`.
*/
export const trackStructEvent = (category, action, label, value) => {
if (!category || !label || !Settings.trackingEnabled()) {
return;
}
};
export const trackSchemaEvent = (schema, version, data) => {
if (shouldLogAnalytics) {
const { event, ...other } = data;
......@@ -109,19 +98,6 @@ const trackSnowplowSchemaEvent = (schema, version, data) => {
});
};
const handleStructEventClick = event => {
if (!Settings.trackingEnabled()) {
return;
}
for (let node = event.target; node != null; node = node.parentNode) {
if (node.dataset && node.dataset.metabaseEvent) {
const parts = node.dataset.metabaseEvent.split(";").map(p => p.trim());
trackStructEvent(...parts);
}
}
};
const getSanitizedUrl = url => {
const urlWithoutSlug = url.replace(/(\/\d+)-[^\/]+$/, (match, path) => path);
const urlWithoutHost = new URL(urlWithoutSlug, Settings.snowplowUrl());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment