Fire matomoTrackEvents not in then but before

This commit is contained in:
Daniel Egger 2023-04-05 12:18:44 +02:00
parent 0c5f2dc522
commit b27e13fa12
5 changed files with 91 additions and 92 deletions

View File

@ -214,9 +214,8 @@ export default {
},
},
},
}).then(() => {
matomoTrackEvent('Auftrag', 'Ergebnis mit Lehrperson geteilt', this.assignment.id);
});
matomoTrackEvent('Auftrag', 'Ergebnis mit Lehrperson geteilt', this.assignment.id);
},
reopen() {
this.$apollo.mutate({
@ -265,8 +264,8 @@ export default {
})
.then(() => {
this.spellcheckLoading = false;
matomoTrackEvent('Auftrag', 'Rechtschreibung geprüft', this.assignment.id);
});
matomoTrackEvent('Auftrag', 'Rechtschreibung geprüft', this.assignment.id);
},
},

View File

@ -135,7 +135,8 @@ export default {
title: 'Snapshot löschen',
})
.then(() => {
this.$apollo.mutate({
this.$apollo
.mutate({
mutation: DELETE_SNAPSHOT_MUTATION,
variables: {
input: {
@ -177,7 +178,8 @@ export default {
});
}
},
}).then(() => {
})
.then(() => {
matomoTrackEvent('Modul Snapshot', 'Snapshot gelöscht', this.$route.params.slug);
});
})
@ -215,13 +217,14 @@ export default {
},
});
},
}).then(() => {
if (this.snapshot.shared) {
matomoTrackEvent('Modul Snapshot', 'Snapshot mit Team geteilt', this.$route.params.slug);
} else {
matomoTrackEvent('Modul Snapshot', 'Snapshot nicht mehr geteilt', this.$route.params.slug);
}
});
const slug = this.$route.params.slug;
if (this.snapshot.shared) {
matomoTrackEvent('Modul Snapshot', 'Snapshot mit Team geteilt', slug);
} else {
matomoTrackEvent('Modul Snapshot', 'Snapshot nicht mehr geteilt', slug);
}
},
},
};

View File

@ -111,8 +111,7 @@ export default {
createSnapshot: { snapshot },
},
}) => {
log.debug('snapshot created', snapshot)
matomoTrackEvent('Modul Snapshot', 'Snapshot erstellt', this.$route.params.slug);
log.debug('snapshot created', snapshot);
this.showPopover = false;
this.$modal.open('snapshot-created', {
@ -120,6 +119,7 @@ export default {
});
}
);
matomoTrackEvent('Modul Snapshot', 'Snapshot erstellt', this.$route.params.slug);
},
},
};

View File

@ -77,9 +77,9 @@ export default {
this.$apollo.mutate({
mutation,
variables,
}).then(() => {
matomoTrackModuleVisibilityEvent(this.type, this.block, hidden);
});
matomoTrackModuleVisibilityEvent(this.type, this.block, hidden);
},
},
};

View File

@ -174,8 +174,7 @@ export default {
data: JSON.stringify(data),
};
this.$apollo
.mutate({
this.$apollo.mutate({
mutation: UPDATE_ANSWER,
variables: {
input: {
@ -204,15 +203,13 @@ export default {
store.writeQuery({ query, variables, data: newData });
}
},
})
.then(() => {
});
if (exit) {
matomoTrackEvent('Übung', 'Übung erfolgreich abgeschlossen', this.id)
matomoTrackEvent('Übung', 'Übung erfolgreich abgeschlossen', this.id);
this.$router.go(-1);
} else {
matomoTrackEvent('Übung', 'Übungsschritt abgeschlossen', this.id)
matomoTrackEvent('Übung', 'Übungsschritt abgeschlossen', this.id);
}
});
};
survey.onComplete.add((sender, options) => {