vue-yandex-metrika icon indicating copy to clipboard operation
vue-yandex-metrika copied to clipboard

Wrong page URL in autotracking

Open PureLines opened this issue 4 years ago • 1 comments

Relevant code or config:

new Router({
  mode: 'history',
  base: '/app_url/',
  [...]
});

Problem description: In autotracking mode it doesn't respect base router option and sends wrong url to Yandex.Metrika. For example, https://domain.com/visited_page instead of https://domain.com/app_url/visited_page.

Suggested solution: It happens because to.path is relative to Router. So I suppose it needs concatenation of config.router.options.base and to.path here: https://github.com/vchaptsev/vue-yandex-metrika/blob/b8481f0a110f83291a7544c801420b4e5aa50166/src/helpers.js#L83

PureLines avatar Nov 06 '20 21:11 PureLines

@vchaptsev Could you take a look at this, please?

PureLines avatar Nov 30 '20 13:11 PureLines