Activities

ooOsH

ooOsH posted a new feature request

analytics-module •

idea Support for Google Analytics Update

What problem does this feature solve?

Google's latest dynamic tagging solution, will you be supporting this?

What does the proposed changes look like?

(analytics.js) to the latest tag (gtag.js)

andrade1379

andrade1379 posted a new question

analytics-module •

Ability to disable for the user to opt-out of Google Analytics

Hello,

I was curious if simply setting this window property to "true" would truly disable tracking throughout the users session on my Nuxt static site.

window['ga-disable-GA_MEASUREMENT_ID'] = true;
emdahlstrom

emdahlstrom posted a new bug report

analytics-module •

bug No registrations from prod and Google Tag Assistant can't find analytics in prod

Version

v2.4.0

Reproduction link

https://www.raddadjuren.se

Steps to reproduce

Checking Google Tag Assistant in production on https://www.raddadjuren.se

What is expected ?

I expect Google Tag Assistant to find an analytics tag and be able to record analytics events.

What is actually happening?

However, analytics does not seem to be present in production. Google Tag Assistant does not report any events or tracking.

Additional comments?

Production is a static deploy on Netlify built with Nuxt 2.14.3.

Analytics works in dev and Google Tag Assistant can detect the tag and record events and tracking in dev.

nuxt/analytics is set up as a buildModule with the following toplevel config:

googleAnalytics: {
id: 'UA-REDACTED',
debug: {
enabled: true,
sendHitTask: true
}
},

This might well be a configuration error on my part and I will continue to look into this.

Any ideas on how to debug this is very welcome.

pmanikas

pmanikas posted a new question

analytics-module •

Defer analytics script

Is there a way to defer the analytics script so it can load after page load?

everyx

everyx posted a new feature request

analytics-module •

idea Add asyncID to document

What problem does this feature solve?

asyncID is awesome, we can set ID dynamic from API.

mystrdat

mystrdat posted a new question

analytics-module •

Dynamic documentation of all analytics events in the app

I'm looking into building automated documentation containing all the various events that are tracked by my Nuxt application using this module. I have some ideas on how to approach this (abstraction map above all events and building an MD table out of it), but I was wondering if the authors of this module would have some better ideas, perhaps even consider such a feature for the module itself. Thank you!

phil-la

phil-la posted a new question

analytics-module •

Landingpage = (not set)

I have increasingly traffic that shows (not set) in Google Analytics.

We are loading nuxt-analytics after cookie opt-in.
Can it be that information gets lost, when user lazy loads the plugin?

My page:
https://www.moebelland.de

marvinhuebner

marvinhuebner posted a new question

analytics-module •

Split Testing - Send to Google Analytics

I know it's not really an issue, but I just can't get it to work. Where do I integrate this code snippet to send the respective data for split testing to google analyitcs?

https://docs.netlify.com/site-deploys/split-testing/#send-to-google-analytics

<!-- install Google Analytics' JS tracker before using this code -->
<!-- https://developers.google.com/analytics/devguides/collection/analyticsjs/ -->
<script>
  ga('send', 'pageview', {
    'Branch':  '{{ getenv "BRANCH" }}'
  });
</script>

Thanks a lot.

SkyaTura

SkyaTura posted a new feature request

analytics-module •

idea Support runtimeConfig

What problem does this feature solve?

In order to attend 12factor, the module should use the new runtimeConfig feature.

gianniskarmas

gianniskarmas posted a new question

analytics-module •

Multiple domains with multiple id's

I have a complicated setup with multiple domains using i18n.

Trying to configure the analytics module to use each domain's ID but it is not possible through nuxt.config.js as it doesn't have access req.headers but only in env.

I'm using Plesk/Phussion Passenger to manage and run these node processes and tried adding custom Env Variables to each one but, while all domains share the shame directory structure, domain/language redirection happens through i18n and I can't make the analytics module to see the different ID's.

Tried to set it up as a function like below as also with linkers but with no luck, always only the default ID is getting called:

[
            '@nuxtjs/google-analytics', {
                // id: process.env.GA_ID,
                debug: {
                    enabled: true,
                    sendHitTask: true
                },
                id: () => {
                    switch (process.env.HOST) {
                    case 'example.eu':
                        return 'UA-47218809-1';
                    case 'example.com':
                        return 'UA-47218809-2';
                    case 'example.nl':
                        return 'UA-47218809-3';
                    case 'example.co.uk':
                        return 'UA-47218809-4';
                    case 'example.fr':
                        return 'UA-47218809-5';
                    default:
                        return 'UA-47218809-1';
                    }
                }/*,
                autoLink: true,
                linkers: ['example.eu', 'example.com', 'example.nl', 'example.de', 'example.co.uk', 'example.fr'] */
            }
        ]

Any hints of how this complicated setup can use analytic IDs correctly?
Many Thanks

Epistol

Epistol posted a new question

analytics-module •

Is it still relevant as Google Analytics is moving to Gtag ?

As noted in the Vue-Analytics repo :

"Google moved from analytics.js to its new gtag.js library and I've created a new plugin called vue-gtag. "

Could this repo use vue-gtag ?

jillztom

jillztom posted a new question

analytics-module •

Add multiple ids to support multiple domains

I wanted to deploy the same app to three different domains. These three domains will have different GA Ids. How would I go about adding these ids in the config?

AGSarmiento

AGSarmiento posted a new question

analytics-module •

Analytics.js throwing errors when using array of IDs

Hello,

I'm looking at a problem with errors and the analytics-module in Nuxt.

I've installed @nuxtjs/google-analytics as a dev dependency, and I've added the configuration in nuxt.config.js, as explained here: https://github.com/nuxt-community/analytics-module#readme. Btw, I'm using Nuxt 2.12.0, so my configuration looks like the first one recommended in the docs.

The difference with my configuration is that I'm using 2 id's and one sampleRate for each of those ids, like so:

buildModules: [
    [
        '@nuxtjs/google-analytics',
        {
            id: ['firstIdNumber', 'secondIdNumber'],
            customIdFields: {
                'firstIdNumber': {
                    sampleRate: 1
                 },
                'secondIdNumber': {
                    sampleRate: 100
                 }
            }
        }
    ]

The code is working, and the sampleRates are being set correctly. The thing is that when I set this up, when I set up two ids, I get a lot of errors coming from analytics.js that look like this:

Screenshot 2020-06-10 at 17.02.28.png

Each of these errors shows up three times in the console. This doesn't happen when I have only id.

I hope someone can help me wth this issue.

Thanks.

termorrell

termorrell posted a new bug report

analytics-module •

bug Nuxt Analytics not working when building with yarn generate

Version

2.3.0

Reproduction link

https://gist.github.com/termorrell/72a2c6f3a8dc926c7c46953e57f1ca94

Steps to reproduce

I have added the analytics module following the documentation in the README.

export default {
...
buildModules: [
    ['@nuxtjs/google-analytics', {
      id: 'UA-********-**'
    }],
  ],
...
}

Running when running yarn generate I cannot see any events firing to Google Analytics. This is also the case when adding the debug: enabled flag to true.

What is expected ?

When building the site with yarn generate I would expect to see the events firing to Google Analytics.

What is actually happening?

No events are being fired. I can see my GA ID in the compiled Nuxt JS but they are not appearing in network requests and not appearing in the GA dashboard.

madsh93

madsh93 posted a new question

analytics-module •

this.$ga.set is sent when leaving a page

Hi

I have set up following code:

created() {
this.$ga.set({
dimension1: this.productId,
dimension2: 'offerdetail'
})
}

However, it seems to only fire on initial launch. But then it fires when leaving the page. I have tried to describe the process below.

Initial load/Enter product page(ID: 1) (dimension1 == 1)
Enter front page (dimension1 == 1)
Enter new product page(ID: 2) (dimension1 == 1)
Enter front page (dimension1 == 2)

I have tried using both created() and mounted(). Am I doing something wrong?

madsh93

madsh93 posted a new question

analytics-module •

this.$ga.set is send when leaving a page

Hi

I have set up following code:

created() {
this.$ga.set({
dimension1: this.productId,
dimension2: 'offerdetail'
})
}

However, it seems to only fire on initial launch. But then it fires when leaving the page. I have tried to describe the process below.

Initial load/Enter product page(ID: 1) (dimension1 == 1)

Enter front page (dimension1 == 1)

Enter new product page(ID: 2) (dimension1 == 1)

Enter front page (dimension1 == 2)

I have tried using both created() and mounted(). Am I doing something wrong?

jb-alvarado

jb-alvarado posted a new question

analytics-module •

Opt-In

Hello,
I need some help from you. In Europa users have to opt-in for google analytics and this I try to realize with nuxtjs/google-analytics.

I thought I deactivate the module by default:

buildModules: [
        '@nuxtjs/google-analytics'
    ],

    googleAnalytics: {
        id: 'UA-1111111',
        set: [
            { field: 'anonymizeIp', value: true }
        ],
        disabled: true
    },

And in my Footer.vue component, where I have my cookie banner, I integrate the function to opt-in:

<template>
    <div id="footer">
        ...
        <b-button class="btn-left" @click="setCookieLaw(false)">
            Essenzielle Cookies
        </b-button>
        <b-button class="accept" @click="setCookieLaw(true)">
            OK
        </b-button>
        ...
    </div>
</template>

<script>
export default {
    ...
    created () {
        this.initCookieLaw()
    },

    methods: {
        setCookieLaw (useAnalytics) {
            this.$cookies.set('useAnalytics', useAnalytics, {
                path: '/',
                maxAge: 60 * 60 * 24 * 365
            })

            if (useAnalytics && process.client) {
                this.$ga.enable()
            } 

        },
        initCookieLaw () {
            const analytics = this.$cookies.get('useAnalytics')

            if (analytics && process.client) {
                this.$ga.enable()
            }
        }
    }
}
</script>

With this way I have now following situation:

  • I load the page, the banner come up and I hit ok. After that I navigate trough the page and this gets tracked
    • the problem with that is to, that the first page gets not tracked
  • but when I reload the page the debugging from analytics module says that the user had opt-out, so it is not possible to track

If I integrate a button some where in the page which call initCookieLaw(), the module is opt-in again. So why I can not initialize the enable functions after a page reload?

Do I have a misconception here?

silgon

silgon posted a new question

analytics-module •

I cannot make it working

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!

jssouders

jssouders posted a new question

analytics-module •

Which module to use for Google Analytics

I have a new NUXT application that needs to have Google Analytics integrated within the application. It appears that there is a very stable analytics-module (https://www.npmjs.com/package/@nuxtjs/google-analytics), but it is utilizing the analytics.js script that Google no longer recommends. Google currently recommends using gtag.js script for integrating with Google Analytics. The only package in the NUXTJS community is the google-gtag (https://www.npmjs.com/package/@nuxtjs/google-gtag) module. Is this the currently recommended module to use when integrating with Google Analytics? It appears that this package is not downloaded that frequently or released that often compared to analytics-module. Any help in the right direction would be appreciated.

carrera

carrera posted a new question

analytics-module •

Screenview tracking metrics are set to zero

My screens are not tracked, but my settings seem to be alright.

nuxt.config.js

['@nuxtjs/google-analytics', { id: process.env.ANALYTICS_ID, autoTracking: { page: false, screenview: true, exception: true, // pageviewOnLoad: false, }, debug: { enabled: true, sendHitTask: true } }],