How to handle subdirectories as different websites?

I have a problem that’s keeping me busy all day long.
I run a website f.ex. ( It uses some subdirectories for images, but all pages are on the main level f.ex.(,

Now i added a (wordpress) blog to my site. In order to get the most SEO-effect i don’t want it to be in a subomain, but in a subdirectory ( Blog). In Piwik created a new “website” for this subdirectory. has it’s own tracking code while Blog has another tracking code (actually only the id is different).

Things work fine so far: The one tracking code tracks my website only, the other tracking code tracks my blog only.

Now i want to do is: measure if a user comes to my website from the blog. And that’s where trouble comes in. When s.o. comes from the blog to the website the blog-piwik doesn’t show me the user has moved from blog to website. Also the website-piwik doesn’t show me the user came from the blog.

I tried to ad stuff like ?link=website to all bloglinks that point to my website, and hoped i could track it as a goal, but it doesn’t work (Doesn’t show up in the goals). I also tried to put tracker.setCookiePath("/blog/" ) in the trackingcode of the blog, but it didn’t do anything.

Here’s my question: Can i tell piwik to handle and Blog as if it were different domains?

I’d be glad if you could help me with that.

Thanks in advance,


Goals -> Add a new goal ->

  • When a Visitor
  • Click on a Link to an external website
  • Matches the expression
  • [the URI of your homepage]
  • once or more than once, regardless

^— That goal should work just fine, just tested it on one of tracked pages.
Though I set it to a complete uri (

So long,

Hi A.Kalkhoff,

thx for the reply. I just tested it but it doesn’t seem to work.
The blog-piwik ( doesn’t accept as a externeal website.
Did u change anything in your tracking code?

Thx, Phill

Nope, my tracking code is the same on all pages.
Sorry, I don’t know what the problem is in your case then :confused:

So long,

You should be able to do this via Campaign Tagging:

Hi Matt,
thx for your reply.

Thats what i am doing right now. I add to every link in blog that points to my website a campaign “blog” and a keyword “posttitle” so i know if visitors come from the blog and from what post they came.

But it still feels like a workaround to me. Trouble is that i have to add the campaigndata to every link by hand. So its likely i forgett it or make a mistake in the future. Another thing is that this way i only see if someone came from the blog, but I don’t see on the blog who left for the website.

I still wonder if there is a way to treat “” and “” as if they were two completely independend domains. I think it shouldn’t be too hard for piwik to handle this. All you need is a different cookie for the subdiretory. But tracker.setCookiePath("/blog/" ) didn’t do anything.

For now the solution with manually adding the campaigns is ok, but for the future it just doesn’t seem to be scalable enough.

Thanks so far Matt and Kalkhoff. I’d still like to encourage everyone to send me their ideas.

Best, Phil

I know this question already two years old. however, I am face with the same question.

How to treat subdirectory as diffrent website. I want it as automate as possible without adding a newsite for each of the subdirectory.
I can define it directly in url. and it automatically treated as diffrent website.

if it is not possible, do you guys know any others analytics tools that able to do that?