Hey,
My main use with Piwik is with custom variables to show stats on specific pages. So a lot of my API requests with PHP use the segment parameter. For instance, a common one is:
$piwik->makeRequest(array(
'method' => 'Actions.get',
'period' => 'range',
'date' => '2013-01-01,today',
'segment' => 'customVariablePageName3==contentId;customVariablePageValue3==' . $this->accountBlogId . ';' .
'customVariablePageName4==contentType;customVariablePageValue4==blog' .
( $mobile ? ';' . 'customVariablePageName5==mobile;customVariablePageValue5==' . (int)$mobile : '' )
));
Note: There’s a few parameters missing from there such as idSite and token_auth, but those are added within the makeRequest function.
That being said, on a page where I list numerous blog posts and their view count using the above request, the page loads quite slowly trying to access this data for each post. So I did some Googling today and started arching my Piwik stats as described here: How to Set up Auto-Archiving of Your Reports - Analytics Platform - Matomo. However, that doesn’t appear to help with the page load speed at all. Is this archive only used in the main Piwik dashboard? Do I somehow need to specify to use the archive? Does the archive not really work with custom variable searches?
Thanks!
- Josh