Quantcast
Channel: Support & Bugs - Matomo forums
Viewing all articles
Browse latest Browse all 5706

setDocumentTitle not working?

$
0
0

@Andre_Paulo wrote:

I tried using _paq.push(['setDocumentTitle', "<?php echo $_SESSION['name']; ?>"]); To replace the title of the page with the username of the user but it keeps showing the <title> of the page. On the HTML Source its showing the correct name: http://i.imgur.com/aTDvNyI.png
Here is all the code:
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//analytics.domain.com/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '4']);
_paq.push(['setDocumentTitle', "<?php echo $_SESSION['name']; ?>"]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();

EDIT: Console doesn't throw any error.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5706

Trending Articles