Show unique page stats to customers of my portal

Hi! I would greatly appreciate if you could point me in to right direction or suggest a tutorial.

My problem is as follows:
I’m building a web portal that advertises vacation rental homes. Owners of holiday homes can register on the website and advertise their accommodation. Each house gets a dedicated link. I would like to implement Piwik in order that each registered user (so, in this case holiday home owner) can see statistics for his own house (his own unique page) on my web site.

How can I achieve this?

Registering new SiteId for each new house owner doesn’t seem as a convenient solution.

Thanks in advance! :slight_smile:

You can create a site for each home owner, or you can also query with segmentation to only select pages, with a specific custom variable, or users who visited a given set of pages.

Thanks Matt! I will test these options and most certainly have more questions.

Hi Matt!
I started by exploring the solution to “query with segmentation to only select pages, with a specific custom variable”.
I installed Piwik on my website and created a custom variable of the scope “page” who’s name is actually the house name (the house name is unique and the URL for each house is unique on my website).
In Visitors > Custom Variables now I can browse through different house names and obtain basic analytics data (visits, actions, actions per visit, average time on website and bounce rate). How can I obtain more data (e.g. the data that is available for the website as a whole - visitors by location, screen resolutions etc.)?
Please point me into right direction by providing the relevant documentation (e.g. who’s my friend in API documentation :slight_smile: ) or if there is an existing tutorial about this issue.


yes see the segmentation doc at: Segmentation - Compare segments of visitors - Analytics Platform - Matomo

Thanks again Matt!

I read the Segmentation and Live! API docs - the combination of the two seems as ideal solution for me. I set up a testing environment containing an index page and additional three pages containing three different houses. Each page has javascript tracking code of course and each page has unique custom variable of the scope “page”.

I tried adding the ‘&segment=customVariablePageName1==House-412’ and even tried adding ‘&segment=customVariablePageName1==House-412;customVariablePageValue1==Visitornumber’ to the sample xml report provided in the Live! API docs that describe the ‘Live.getLastVisitsDetails’ method. ‘House-412’ is obviously the name of the custom variable on the page for which I tried to get the data.

The output is showing not only the data for the page containing custom variable with the name ‘House-412’ but for all pages of my testing environment. Why is that happening? Am I using the segmentation in a wrong way?

I do understand that I should parse the data afterwards to show it as I wish, but would like to get only the data about a specific page that contains specific custom variable.

Thanks for your help.

Sorry Im not sure. Do other segment work as expected such as segment=country==fr ?

Other segments work as expected, as a matter of fact I think that custom variables actually work as well. :slight_smile:
I realised that in this set of data (‘Live.getLastVisitsDetails’) when using ‘&segment=customVariablePageName1==House-412’ I do get visitors that have visited the page with that particular custom variable. In the “actionDetails” part of the report there are other pages with other custom variables that this same visitor has visited, which I now realise it is fine. Am I right? This part confused me previously. Additionally the “customVariables” section of the report is empty, I don’t know why?

Now I will parse the data and try to show it as I want. Another question occurred - in the same situation as described previously, in my Piwik Dashboard for the page with custom variable “House-412” I get the data e.g. Visits = 3, Unique visitors = 3. At the same time in the generated report I don’t see this data. Am I missing something?

Generally speaking, as I now understand “getLastVisitsDetails” is a visitor level report and not page level report. Is there a report containing data as “getLastVisitsDetails” which can be generated on a page level?

Do you mean, that Custom Variables filterning via &segment does not work for all reports?
Do you mean &segment only works well for “Visit” scope custom variables?

what exactly is the problem? is there a difference also between dashboards and other submenu reports?

Sorry for confusing you with such description. I think now we can conclude that &segment is working with the ‘Live.getLastVisitsDetails’.

“The Live! API lets you access complete visit level information about your visitors.” it is stated in the documentation. My question now would be how can I get complete page level information about the visitors of a particular page? By that I mean, I would like to get information about unique visitors, total visits, countries, actions, referrer keywords, referrer Url, screen dimensions etc. only for a page that is selected using ‘&segment=customVariablePageName1==’. Which modules/methods do you suggest?

Thanks for your patience!


I’m reverting to this old topic since I didn’t find a solution.

Is there a solution to my last question?

Thanks for help!

How about creating a segment Custom Var name == XX AND Page title == YY

Then you can request any report in Piwik

So I would be able to pull “page level data” about a particular page like visitors, countries etc.? This sounds great!

Yes! we try to make it great :wink: