Skip to content

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

@abruere

Description

@abruere

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions