nuxt-community / google-analytics-module

Google Analytics Module for Nuxt 2
https://google-analytics.nuxtjs.org/
MIT License
638 stars 54 forks source link

I cannot make it working #71

Closed silgon closed 4 years ago

silgon commented 4 years ago

I installed the package as specified yarn add --dev @nuxtjs/google-analytics The following code:

  buildModules: [
    ['@nuxtjs/google-analytics', {
      id: 'UA-12301-2' // with my real id instead
    }]
  ]

I put it in export default or/and module.exports and it doesn't work. When I build the application and I put it in the server, there are no calls to google analytics.

For reference, the important part of the package.json file:

  "scripts": {
    "dev": "nuxt --hostname 0.0.0.0",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
    "precommit": "npm run lint"
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.9.5",
    "bootstrap-vue": "^2.4.1",
    "downloadjs": "^1.4.7",
    "html-loader": "^0.5.5",
    "nuxt": "^2.11.0",
    "nuxt-i18n": "^6.5.0",
    "vue-scrollto": "^2.17.1"
  },
  "devDependencies": {
    "@nuxtjs/eslint-module": "^1.1.0",
    "@nuxtjs/google-analytics": "^2.2.3",
    "babel-eslint": "^10.0.1",
    "eslint": "^4.19.1",
    "eslint-friendly-formatter": "^4.0.1",
    "eslint-loader": "^2.1.1",
    "eslint-plugin-vue": "^4.0.0"
  }

Any guidance is appreciated, thanks!

This question is available on Nuxt community (#c56)
ghost commented 4 years ago

This issue as been imported as question since it does not respect analytics-module issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/analytics-module/issues/c56.

silgon commented 4 years ago

It was a nonsensical issue and completely my fault, I was testing with firefox and it was automatically blocking trackers, in this case google analytics.