Open
Description
📚 What are you trying to do?
I can't figure out how to load the optional id correctly
simple product page to load a consumer id in addition to the main one.
my not working example:
// /product/[id].vue
const consumerGtagId = computed(() => pageData?.gtag)
const {
gtag,
proxy: proxyGtag,
load: loadGtag,
} = useScriptGoogleAnalytics({
id: '', // without - type error
l: 'customer',
key: 'gtag-customer',
scriptOptions: {
// consent ?
trigger: 'manual',
},
})
if (consumerGtagId.value) {
proxyGtag.gtag('config', consumerGtagId.value as any) // any - because type only `reset`
loadGtag()
}
🔍 What have you tried?
No response
ℹ️ Additional context
No response