Skip to content

Commit da0131c

Browse files
committed
feat: add apple wallet page action
1 parent ee5db9c commit da0131c

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

pages/pass/[admissionKey].vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useQRCode } from '@vueuse/integrations/useQRCode'
1515
1616
Framework7.use(Framework7Vue)
1717
18+
const app = useNuxtApp()
1819
const route = useRoute()
1920
const { data: admission, isLoading: admissionIsLoading, error } = useAdmission(route.params.admissionKey as string)
2021
const { data: admissionPkPass } = useAdmissionPkPass(route.params.admissionKey as string)
@@ -29,6 +30,13 @@ const qrcode = useQRCode(() => admission.value?.admissionKey ?? '', {
2930
useSeoMeta({
3031
title: admission.value?.event.name ?? 'SSTAA Pass',
3132
})
33+
34+
function reportEvent() {
35+
app.$newrelic.addPageAction('add-to-apple-wallet-clicked', {
36+
eventId: admission.value?.eventId,
37+
admissionKey: admission.value?.admissionKey,
38+
})
39+
}
3240
</script>
3341

3442
<template>
@@ -105,7 +113,7 @@ useSeoMeta({
105113

106114
<br>
107115

108-
<a v-if="admissionPkPass" :href="`/cdn/apple-wallet/${admission.eventId}/${route.params.admissionKey}.pkpass`" target="_blank" class="external cursor-pointer">
116+
<a v-if="admissionPkPass" :href="`/cdn/apple-wallet/${admission.eventId}/${route.params.admissionKey}.pkpass`" target="_blank" class="external cursor-pointer" @click="reportEvent">
109117
<img
110118
src="~/assets/pass/add-to-apple-wallet.svg"
111119
alt="Add to Apple Wallet"

plugins/new-relic.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@ export default defineNuxtPlugin(() => {
99
loader_config: { accountID: '4337277', trustKey: '4337277', agentID: config.newRelic.agentId, licenseKey: 'NRJS-1b1f41c1d6baafe183c', applicationID: config.newRelic.applicationId },
1010
}
1111

12-
const _ = new BrowserAgent(options)
12+
const newrelic = new BrowserAgent(options)
13+
14+
return {
15+
provide: {
16+
newrelic,
17+
},
18+
}
1319
})

0 commit comments

Comments
 (0)