Closed yuritsuki closed 5 years ago
console.log(this.$matomo.getPiwikUrl()) console.log(window._paq.push(['getPiwikUrl']));
As window._paq
is a plain javascript array it would not be possible for matomo to return any values.
Are you able to use this.$matomo.getUserId()
Yes, it works. I just checked if paq works. As I said I need to run ab tests which are able only via _paq.push(['AbTesting::create‘ ... (there are no api commands for ab testing) But I can’t get it working.
I think you can use this: https://developer.matomo.org/guides/ab-tests/browser#how-do-i-implement-an-experiment-without-using-_paqpush
Unfortunately I cannot do much about _paq.push
returning undefined. It is simply the way javascript works.
Thank you! I’ll try it tomorrow. If it works, I’ll close the issue.
Seems like my _paq push works. But yesterday I couldn't get any result because it comes to matomo reports only after a few hours. So now I see my yesterday actions results.
this.$matomo works perfect. Tried to set UserID then get it. But I can't get UserId via _paq previously set in this.$matomo. Actually, I need this working for A/B tests. $matomo doesnt have functions for it. window._paq.push returns undefined in any get*** functions.