vue-yandex-metrika
vue-yandex-metrika copied to clipboard
Wrong page URL in autotracking
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
@vchaptsev Could you take a look at this, please?