Sub-stats or multiple sites

Hi all and thx to the piwik community for your great job

I’m building a website which will allow every city of my country (about 35000, france) to get their own page
the urls will look like www.site.com/cityname/otherstuff

i need to provide simple analytics for each city using VisitsSummary.getLastVisitsGrapht and Actions.getActions
can i get these datas without setting up a new site in piwik for each city ? (this works but very slow to get the datas, even in dev with only my trafic on a few pages, from what i’ve read this can be speed up with setting the cron archive things, right ?)

any ideas welcome
thx

PS is there a way to do the same job as the cron script for archive without cron on a windows server ? (from an url ?)

edit : for the action.getActions i found i can use filter_column_recursive=label and filter_pattern_recursive=cityname; this does the tricks (removing the search box with javascript so users can’t acces other cities stats)

hi,

i’ve tried a few things since my last post so here we go :

i’ve inserted in the database my 35000 “sub-sites” (straight in the db, not using the sitemanager.addsite method, maybe that’s a first mistake ?..)

at first the dashboard was very slow to load so i disabled auto-archiving and the display of site selector (right top corner) in the global.ini file
the dashboard then load good again, but :

impossible to access the manage sites page and impossible to make any query having idSite=all (global stats for the whole website) even with the php.ini max_execution_time = 3000, query for 1 site works fine …

so here’s a next question : is it possible to setup 2 piwik tracking code on the same page ? one would record everything for global stats and one would record depending on the city ?

if not i was thinking about setting up another web analytics for the global stat ? do you know if piwik and google analytics works fine together (would be really better if i could find a better solution) ?

once again thx for all the work, it’s just awsome !!!

i’ve inserted in the database my 35000 “sub-sites” (straight in the db, not using the sitemanager.addsite method, maybe that’s a first mistake ?..)

that should work as well, but this is not recommended!

impossible to access the manage sites page and impossible to make any query having idSite=all (global stats for the whole website) even with the php.ini max_execution_time = 3000, query for 1 site works fine …

what is the error in your error log?

so here’s a next question : is it possible to setup 2 piwik tracking code on the same page ? one would record everything for global stats and one would record depending on the city ?

yes.

Hi Matthieu and thx for the aswer, this should be good for me then, i’ll try it (i’ll re-insert the subsites with sitemanager querys) and let you know (the site manager interface isn’t the most important thing for me now )

in my php error log :

Fatal error: Maximum execution time of 3000 seconds exceeded in …/piwik/core/Access.php on line 210

i made a few test with the site manager page (should be better on a real server than my pc)

the page become very slow to load with 2500-3000 sites with firefox often asking if i want to stop some javascript (jquery.js)

adding search and pagination on that page and it’s done

jquery.js?

I think you misunderstood. Matt was suggesting you use the API, not the UI.

[quote=vipsoft @ Mar 26 2009, 08:01 PM]jquery.js?

I think you misunderstood. Matt was suggesting you use the API, not the UI.[/quote]
maybe i didn’t explain well what i did style_emoticons/<#EMO_DIR#>/tongue.gif

i added sites using the api called from a simple php script
then i tried to load the site management page in piwik interface :

  • 500 sites : everything good
  • 1000 sites : still pretty good
  • 2000 sites : time to laod the page becomes long
  • 3000 sites : more than a minute to load the page, when you click something firefox ask if i want to stop the script jquery.js

this is not a big issue for me now as i can manage everything through the api and i’m not sure a lot of users will have so much sites in one piwik install …

do you have error after disabling the site selector?
site selector doesn’t scale, but if you disable it, Piwik should work fine even with 30k websites?

by the way if you use SVN version we fixed memory leak and improved performance of archiving so it may help with your configuration.

hi & thx for the answers,

i have disabled the site selector.

Everything works fine except the page that display all the registred sites(upperright corner -> parameters -> site tab). this page needs a very very long time to load when there is more 2500 sites, and then some js errors as mentioned in my previous post (with 30000 sites the page never load, max exec time error
In my case this page is not very usefull, so i can deal without it.

i’ll try to update to the svn version soon

We’ve just released a new plugin which could really helpful to you: Roll-Up Reporting aggregates data from multiple websites, mobile apps and shops into a Roll-Up site to gain new insights and save time.

Roll-Up ReportingRoll-Up Reporting lets you aggregate data from multiple websites and apps into one single site. It lets you answer questions like “How many visits happened on all of my websites and apps?” and “Which campaigns contributed the most across several of my websites?” or “How do my various Brands overall compare with each other?” When you have several shops (eg white-labels) it is very valuable to see how your ecommerce shops are performing overall. Or when you are a web agency and you are serving many customers and want to provide each customer with a single aggregate view of all their web properties. Roll-Up Reporting lets you analyze this aggregated data in one site so easily. It saves you lots of time and helps you gain the insights you need instantly.

The Roll-Up Reporting User Guide and the
Roll-Up Reporting FAQ cover how to get the most out of this plugin.

For any other question feel free to contact us.