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

Page views sent to google analytics don’t include config.base in URLs #818

Closed
abruere opened this issue Sep 9, 2018 · 2 comments
Closed

Comments

@abruere
Copy link
Contributor

abruere commented Sep 9, 2018

Bug report

Version 0.14.2

Steps to reproduce

  1. Add a config.base path like /docs/

  2. (a) Set config.ga to a valid Google Analytics User Id, (b) set NODE_ENV to production and (c) see URL without base prefix in google analytics panel
    OR just insert this here (https://github.com/vuejs/vuepress/blob/v0.14.2/lib/app/clientEntry.js#L37) :

router.afterEach(function (to) {
  console.log(to, to.fullPath)
})

What is expected?

Page views sent to google analytics should include config base such as /docs/somepage.html. This is especially expected if vuepress is used to serve only a part of a website in some folder such as /docs.

What is actually happening?

Router to.fullPath is just somepage.html, and is used to log page views.

Other relevant information

  • Your OS: Ubuntu 16.04
  • Node.js version: 8.11.2
  • Browser version: Firefox 61
  • Is this a global or local install? Local install
  • Which package manager did you use for the install? Yarn
@abruere
Copy link
Contributor Author

abruere commented Sep 9, 2018

I can submit a PR to fix this using app.$withBase helper.

abruere added a commit to stelace/vuepress that referenced this issue Sep 9, 2018
@ulivz ulivz closed this as completed in 559888b Sep 15, 2018
@ulivz
Copy link
Member

ulivz commented Sep 15, 2018

Release at @0.14.4.

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

2 participants