Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this.$metaInfo not available in layout.vue #21

Open
sebastianjung opened this issue Nov 13, 2019 · 3 comments
Open

this.$metaInfo not available in layout.vue #21

sebastianjung opened this issue Nov 13, 2019 · 3 comments

Comments

@sebastianjung
Copy link

According to this: https://github.com/nuxt-community/google-gtag#to-make-sure-that-every-page-is-tracked-correctly

one can put the mounted() Code inside of the layout.vue file which does not work because the layout file has no this.$metaInfo information accessible.

If i am right the readme should be changed from

// make sure to set disableAutoPageTrack: true inside of nuxt.config.js
// inside of your Page.vue/Layout.vue file

to

// make sure to set disableAutoPageTrack: true inside of nuxt.config.js
// inside of your Page.vue files

BTW: Is there any way to globally import that code as a mixin into all page components only? (Not all components globally)

@vibonacci
Copy link

I'm facing the same issue. For now I will be using the disableAutoPageTrack to false method

@rkJun
Copy link

rkJun commented Apr 2, 2020

To track all pages, I need to put tracking code on every page.
Is there any other way?

@jamiecarter7
Copy link

Bump ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants