Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 4243

How to track the subdomains? (3 replies)

$
0
0
Hi.
I wan to track one domain with subdomains of it.
I have read here that I should put cookie with domain in javascript
[...]
_paq.push(['setSiteId', 1]);
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setCookieDomain', '*.example.com']); // Same cookie as: example.com, www.example.com, subdomain.example.com, ...
_paq.push(['setDomains', '*.example.com']); // Download & Click tracking alias domains
_paq.push(['trackPageView']);
[...]

but code my Piwik gives me different from example, without _paq.push. Like this:
var pkBaseURL = (("https:" == document.location.protocol) ? "https://domain/analytics/" : "http://domain/analytics/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 75);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();

Can somebody help me to add this coockie staff to my code?

Viewing all articles
Browse latest Browse all 4243

Trending Articles