In my Nuxt.js configuration, I have included a module for Google Tag Manager like this:
modules: [
[
'@nuxtjs/google-tag-manager',
{
id: 'GTM-XXXXXXX'
}
]
]
Everything is functioning properly, but I am curious about how to potentially load this module conditionally based on the value of a cookie that has been set by the website.
We offer users the ability to choose which cookies they want to accept or decline, including the option to block tracking scripts.
Is there a recommended approach for handling this situation with modules or scripts loaded through the configuration? It would be ideal if we could dynamically adjust this based on any changes in the cookie values in the future.
Any assistance or guidance on this matter would be greatly appreciated.