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.
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 ) or if there is an existing tutorial about this issue.
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.
Other segments work as expected, as a matter of fact I think that custom variables actually work as well.
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?
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?