AmazingDreams / vue-matomo

Vue plugin for Matomo Analytics
MIT License
282 stars 61 forks source link

Setting custom document title #99

Closed ristemingov closed 2 years 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 2 years ago

Also

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