Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

355
Visualizações
how do i stop google analytics from tracking a webpage from my options in VueJs or NuxtJs

I have set up google analytics in my NuxtJs app, I also have cookies that save the preferences of the users. when the user rejects the cookies, I set a cookie where Cookie.set('disableAnalytics', true);

and also in my nuxt.config.js file, I have where

require('dotenv').config()
import Cookie from 'js-cookie';

export default {
    googleAnalytics: {
        id: process.env.GOOGLE_ANALYTICS_ID,
        disableScriptLoader: Cookie.get("disableAnalytics") || false
    }
}

I EXPECT that it somehow disables the script loader, and cause google analytics to not track the user.

BUT THIS IS NOT THE CASE, when I check the analytics console while visiting the site, Google analytics is still tracking.

Please, How can I solve the problem, and stop google analytics from tracking when the disableAnalytics cookie is set to true?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda