Collecting analytics data for different users in a SaaS web-app

Hi everybody,

This question may have been asked before, but I couldn’t find any concrete answer, neither here nor on other forums (including Stackoverflow), that’s why I’m writing here.
I’m using PIWIK to analyse user behavior on a SaaS web application. So far it’s working great, but as we’ll have different users, I want to be able to differentiate between users/customers.
Each user will have it’s own subdomain, but as I’m using one PIWIK ID, I have no way to distinguish between stats generated by different customers.
One solution would be to use different (unique) IDs for each customer, which I think will not make sense as we have to create several PIWIK accounts!

Is there any straightforward way to get the results I’m looking for?

Thanks in advance and looking forward to hearing from you great guys :slight_smile:

Hi @tracifier,

No worries, this is what this forum is for. If the answer was posted before, we’ll just add it to the thread.

Right now, you could in still gather everything under one site UUID and segment the users based on a session custom dimensions (e.g. Account name or Customer name with value).

One Piwik PRO account can have multiple sites. When it comes to the free (Core) plan, you are limited to 10 sites per account which might be a problem if you have more customers and you’d like to create a separate site for each of them.

If this limit isn’t a problem, then you could even create a Piwik PRO site programmatically using Administration API when a new customer creates an account and install the Piwik PRO container with proper site UUID when you deploy a new app instance for your client.

Hi Anthony,

Thanks for your quick, yet constructive reply. I had a look at the segments and I think it’s what we’re looking for. I’ve created a test segment and set a condition (page URL is=‘xyz’) and then found it the following section in the API call:

"filters": {
		"operator": "and",
		"conditions": [
				"operator": "or",
				"conditions": [
						"column_id": "event_url",
						"condition": {
							"operator": "eq",
							"value": "xyz"

if I understand correctly, it means that the conditions set in the segment are added to the API call, and then the response will be adjusted accordingly. So does it mean I can just add the above section to my API call or I necessarily need to create segments beforehand?

With regards,

Hmm, could you perhaps add some screenshots to add context? Segments are usually mentioned when using Piwik PRO Analytics UI and not the reporting API, so I don’t fully understand the question :sweat_smile:.

In general it will depend on what you want to achieve. If you want session based data, then filtering based on event_url might not work because we are jumping into the event scope. That’s why I mention creating a session custom dimension here:

Hi Anhony,

Yeah you’re right, I’m testing different options (including segments and adding filters to the API calls) to find out whether it’s what we’re looking for or not, and if it didn’t work out I’ll come back to you again.

Anyway we’re really glad to be using your top product, I hope soon our product finds enough users so we can switch to the paid version and use your other cool features as well.

Thanks for your nice support

1 Like