Skip to content

Report base URL in analytics plugin #2169

Closed
@ghana04

Description

@ghana04
  • [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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions