Currently if I ONLY embed the w1 tracking code in my js macro, it still shows +1 view if I visit w2 and w3. I tried altering the cookies with setCookieDomain (below) but it didn’t seem to do anything. Under the webpages, I have children pages as well so …/display/w1/page1. Any ideas to fix my problem would be greatly appreciated.
What you are describing is not a subdomain, just a different path on the same domain.
(Please read this: Subdomain - Wikipedia )
Also, setCookieDomain() only accepts a domain name (no protocol, port or path)
If you want to separate stats for these three web sites, I would suggest creating a Website in Piwik for each of your sites. They will then have different tracking codes (You have to put the unique tracking code on each site, w1, w2 and w3 will all be different.)
Oh, I guess my terminology was wrong. When you say create a website in Piwik for each of my sites, do you mean going to settings --> websites --> add a new website? If so, I’ve already added the three websites as follows:
Id:1
Name: w1
URLs:ci0000000078424:8080/display/w1
…(etc for the rest)
and each have their own View Tracking Code, it’s just when I embed say ONLY ‘w1’ into my webpage, if I visit w2 or w3 it still adds +1 view to w1 (even though i didnt call the w2 or w3 tracking code)
Use only the standard tracking code (Under Websites -> View tracking code), don’t add or remove anything to it.
If that does not work, please provide the three different tracking codes, exactly as you are using them.
[quote=datran]
Hey littleguy,
Thanks for the prompt response!
Oh, I guess my terminology was wrong. When you say create a website in Piwik for each of my sites, do you mean going to settings --> websites --> add a new website? If so, I’ve already added the three websites as follows:
Id:1
Name: w1
URLs:ci0000000078424:8080/display/w1
…(etc for the rest)
and each have their own View Tracking Code, it’s just when I embed say ONLY ‘w1’ into my webpage, if I visit w2 or w3 it still adds +1 view to w1 (even though i didnt call the w2 or w3 tracking code)
Basically I was just trying to test 1 of the tracking codes so I only used the w1 tracking code seen on websites --> view tracking code. I placed only that code into a javascript macro and ran the macro on all three sites. Ideally what I wanted to happen was that although all three sites ran that macro, only w1 would get +1 views because the macro only has w1 tracking code. Could this issue be because I’m using a macro to call the javascript?
[…]
// The idSite Y will be different from other user pages
tracker = Piwik.getTracker(pkBaseUrl, Y);
tracker.setCookiePath(’/user/MyUsername’);
tracker.trackPageView();
[…]
Not sure why I’d need username configurations? Or is there another way to implement CookiePath? An example would be awesome,