GTM Script loaded in <script> but not running #17
-
Hello, I am experiencing an issue with my GTM script that is unable to connect to Google Analytics. I would like to know if there is any way to fix this issue or if there are additional steps I should take to establish a connection to Google Analytics. Thank you in advance for your help. nuxt 3 nuxt.config.ts:
The method from the official nuxt-cookie-control readme is also not working:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello @arthurgorecki, thanks for checking out this repo. I see that you use
To react to cookies being accepted or declined you could watch the Cookie Control's const cookieControl = useCookieControl()
if (cookieControl.cookiesEnabledIds.value.includes('google-analytics')) {
initGoogleAnalytics() // placeholder for your custom initialization
}
|
Beta Was this translation helpful? Give feedback.
-
Hello. Thank you, first, for your work. Is it possible that you provide a full example for implementation of gtag with nuxt cookie control? Especially with the new consent mode v2 of google. Thank your for your help! |
Beta Was this translation helpful? Give feedback.
Hello @arthurgorecki, thanks for checking out this repo.
This repo continues the work done on nuxt-cookie-control and was published as a major release of v2 with breaking changes and Vue 3 support only. I recommend reading this repo's README and comparing the definitions in there with your code.
I see that you use
cookies.(necessary|optional).cookies
e.g., which is calledcookies.(necessary|optional).targetCookieIds
in v2. Also, the following properties do not exist anymore:cookies.(necessary|optional).async
cookies.(necessary|optional).accepted
cookies.(necessary|optional).declined
cookies.(necessary|optional).initialState
To react to cookies being accepted or declined you could watch …