I have developed a php script to transfer statistics from a legacy stats system for Wordpress Multiuser to Piwik. Now I want to transfer our back stats (about ~1 300 000 actions) using it, but it’s going too slow (about 3000 items per hour).
I think the reason is because I use the sites SitesManager.getSitesIdFromSiteUrl by calling it via HTTP.
So, for every action I am performing this:
$piwik_api_call = $piwik_url . '?module=API&method=SitesManager.getSitesIdFromSiteUrl&url='. $site_url .'&token_auth='. $token_auth .''; $reply = file_get_contents($piwik_api_call);
Is there a way to include the SitesManager API into my own script?