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

Report base URL in analytics plugin #2169

Closed
ghana04 opened this issue Feb 5, 2020 · 3 comments · Fixed by #2687
Closed

Report base URL in analytics plugin #2169

ghana04 opened this issue Feb 5, 2020 · 3 comments · Fixed by #2687
Labels
type: bug Something isn't working

Comments

@ghana04
Copy link

ghana04 commented Feb 5, 2020

  • [x ] I confirm that this is an issue rather than a question.

Bug report

When using Google Analytics plugin, the base Url configured in the config.js file is not returned by the plugin.

It seems that a fix for this was introduced in v0.14.4 which is not carried over to version 1.x.x. --> fix | current 0.x file.

Compare that to the current file in 1.x: enhanceAppFile.js

It seems that the only change required might be the following:

ga('set', 'page', to.fullPath) \\ current
ga('set', 'page', app.$withBase(to.fullPath)) \\ possible fix

Steps to reproduce

Implement GA plugin in your project with a config.base value configured.

What is expected?

The base URL is returned by the plugin.

What is actually happening?

The base URL is only returned when accessing pages from outside the VuePress site but not when navigating between pages on the VuePress site itself.

Other relevant information

  • Output of npx vuepress info in my VuePress project:
@billyyyyy3320
Copy link
Collaborator

Nice catch!

@billyyyyy3320 billyyyyy3320 added the type: bug Something isn't working label Feb 13, 2020
@mkfsn
Copy link

mkfsn commented Jul 20, 2020

Is there any workaround before this is merged/released?

@vittominacori
Copy link
Contributor

@ulivz any chance to check if #2687 solves and can be merged.

All of my projects with base path are sending wrong analytics data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants