Skip to content

Commit

Permalink
Try manual tracking on marker-open
Browse files Browse the repository at this point in the history
  • Loading branch information
eronisko committed Mar 1, 2024
1 parent f16bd3b commit e29feae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/Micrio.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script setup lang="ts">
import type { Coords, HTMLMicrioElement, Models } from "Micrio";
const gtm = useGtm();
const props = defineProps<{
id: string;
cancelTourAfterMs?: number;
Expand Down Expand Up @@ -67,6 +69,15 @@ onMounted(() => {
}
});
});
element.addEventListener("marker-open", (e: any) => {
gtm?.trackEvent({
category: "Micrio",
action: e.type,
value: e.detail.title,
label: [props.id, e.detail.title].join(" "),
});
});
});
watch(
Expand Down

0 comments on commit e29feae

Please sign in to comment.