vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.48k stars 4.78k forks source link

Google Analytics not working - Vue 1.x #1579

Closed JeffBeltran closed 5 years ago

JeffBeltran commented 5 years ago

Bug report

Google Analytics does not appear to work. https://github.com/JeffBeltran/faker.js-docs for code or https://fakerjsdocs.netlify.com/ for deployed site. Inspecting the site i can see the ga id in the source so it's making it's way to the deployed site.

One thing i did notice is that when i build the site locally i only see the following

yarn run v1.15.2
$ vuepress build docs
wait Extracting site metadata...
tip Apply theme @vuepress/theme-default ...
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/last-updated (i.e. "@vuepress/plugin-last-updated") ...
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...
[2:42:17 PM] Compiling Client
[2:42:17 PM] Compiling Server
[2:42:23 PM] Compiled Server in 6s
[2:42:27 PM] Compiled Client in 10s
wait Rendering static HTML...
success Generated static files in dist.

so not sure if the plugin is even being called?

Version

"@vuepress/plugin-google-analytics": "^1.0.0-alpha.47",
"vuepress": "^1.0.0-alpha.47"

Steps to reproduce

Using netlify to build and deploy docs from https://github.com/JeffBeltran/faker.js-docs to https://fakerjsdocs.netlify.com/ followed instructions via https://v1.vuepress.vuejs.org/plugin/official/plugin-google-analytics.html

What is expected?

To see that google analytics url is called https://www.googletagmanager.com/gtag/js?id=UA-00000000

What is actually happening?

nothing

Other relevant information

ulivz commented 5 years ago

Hi and thanks for your issue! In the interest of keeping this project organized, we try to keep requests on this repo to a few main topics. Unfortunately, you may have created a wrong issue.

The google-analytics plugin only integrates Google Analytics, but not include GTM, and this is the real tracking request:

image

JeffBeltran commented 5 years ago

sorry about that, i honestly didn't realize there was a difference. Thanks for taking the time to look over this and reply.