We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to use the googleTagManager registry script and the useScriptGoogleAnalytics composable.
I have the registry script set up like so:
modules: [ '@nuxt/scripts', ], scripts: { registry: { googleTagManager: { id: process.env.GOOGLE_TAG_MANAGER_ID ?? '', }, }, },
In my app.vue file, I'm using the composable like so:
const { proxy } = useScriptGoogleAnalytics() proxy.gtag('consent', 'default', { ad_personalization: 'denied', ad_storage: 'denied', ad_user_data: 'denied', analytics_storage: 'denied', })
But the gtag type shows an error in my IDE: "Expected 2 arguments, but got 3."
However, the modules/composable works as expected (I have tested it with the tag assistant).
How can I get the types working?
No response
The text was updated successfully, but these errors were encountered:
This is my current workaround, but ideally, it wouldn't be required:
npm i -D @types/gtag.js
export function useGtag() { const { proxy } = useScriptGoogleAnalytics() return { gtag: proxy.gtag as Gtag.Gtag, } }
Sorry, something went wrong.
No branches or pull requests
📚 What are you trying to do?
I'm trying to use the googleTagManager registry script and the useScriptGoogleAnalytics composable.
I have the registry script set up like so:
In my app.vue file, I'm using the composable like so:
But the gtag type shows an error in my IDE:
"Expected 2 arguments, but got 3."
However, the modules/composable works as expected (I have tested it with the tag assistant).
How can I get the types working?
🔍 What have you tried?
No response
ℹ️ Additional context
No response
The text was updated successfully, but these errors were encountered: