-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Description
Script can be found here
I attempted to implement it myself like below, but I am running into problems with UET not being available from the script that is being set, since it is part of the script being loaded.
const { uetq, $script } = useRegistryScript('bing', () => ({
scriptInput: {
src: 'https://bat.bing.com/bat.js',
async: true,
crossorigin: false,
},
scriptOptions: {
use() {
return { uetq: window.uetq }
},
},
clientInit: import.meta.server
? undefined
: () => {
window.uetq = window.uetq || []
const options = { ti: 'YOUR_KEY_HERE', enableAutoSpaTracking: true }
// @ts-expect-error untyped
options.queue = window.uetq
// @ts-expect-error untyped
window.uetq = new UET(options)
window.uetq.push('consent', 'default', { ad_storage: 'denied' })
},
}))
The original script creates a brand new script element with https://bat.bing.com/bat.js
as the source and then sets the window.uetq from there, but I am unsure how to recreate that in a registry script.
harlan-zw
Metadata
Metadata
Assignees
Labels
No labels