AmazingDreams / vue-matomo

Vue plugin for Matomo Analytics
MIT License
272 stars 60 forks source link

Setting custom document title #99

Closed ristemingov closed 1 year ago

ristemingov commented 2 years ago

Hi,

Matomo documentation has example of custom setting document titles

https://developer.matomo.org/guides/tracking-javascript-guide#javascript-tracker-features

especially this example:

_paq.push(['setDocumentTitle', document.domain + "/" + document.title]);

Can this be achieved here?

Thanks.

chrisrueger commented 2 years ago

Would be interested in this too.

jordan-boyer commented 2 years ago

We don't have a direct option for this but as writting in the doc you have acces to _paq in the window.

So you can just write :

if (window._paq) {
   window._paq.push(['setDocumentTitle', document.domain + "/" + document.title]);
}
AmazingDreams commented 1 year ago

Also

this.$matomo.setDocumentTitle(document.domain + "/" + document.title)