ActionsModule
Documentation
https://developer.matomo.org/api-reference/reporting-api#Actions
Module Usage
All the below methods can be called in the following manner:
$actionsModule = Piwik::getActions();
$actionsModule->get($arguments, $format);
If you are using the format from configuration, it does not need to be specified
$actionsModule = Piwik::getActions();
$actionsModule->get($arguments);
If you are not specifying additional arguments or a format, neither parameters need to be passed in
$actionsModule = Piwik::getActions();
$actionsModule->get();
If you are using a method which has an additional required parameter and don't need to specify additional arguments or a format, it can be called as below
$actionsModule = Piwik::getActions();
$actionsModule->getPageTitle($pageName);
Methods
get(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1, // if not specified, idSite from global config will be used
'period' => 'day', // if not specified, period from global config will be used
'date' => 'yesterday', // if not specified, date from global config will be used
'segment' = '', // optional
'columns' = '' // optional
];
$format = 'json';
$actions = Piwik::getActions()->get($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$actions = Piwik::getActions()->get($arguments, $format);
getPageUrls(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '', // optional
'expanded' => '', // optional
'idSubtable' => '', // optional
'depth' => '', // optional
'flat' => '' //optional
];
$format = 'json';
$pageUrls = Piwik::getActions()->getPageUrls($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$pageUrls = Piwik::getActions()->getPageUrls($arguments, $format);
getPageUrlsFollowingSiteSearch(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '', // optional
'expanded' => '', // optional
'idSubtable' => '' // optional
];
$format = 'json';
$pageUrls = Piwik::getActions()->getPageUrlsFollowingSiteSearch($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$pageUrls = Piwik::getActions()->getPageUrlsFollowingSiteSearch($arguments, $format);
getPageTitlesFollowingSiteSearch(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '', // optional
'expanded' => '', // optional
'idSubtable' => '' // optional
];
$format = 'json';
$pageTitles = Piwik::getActions()->getPageTitlesFollowingSiteSearch($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$pageTitles = Piwik::getActions()->getPageTitlesFollowingSiteSearch($arguments, $format);
getEntryPageUrls(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '', // optional
'expanded' => '', // optional
'idSubtable' => '', // optional
'flat' => '' // optional
];
$format = 'json';
$entryPageUrls = Piwik::getActions()->getEntryPageUrls($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$entryPageUrls = Piwik::getActions()->getEntryPageUrls($arguments, $format);
getExitPageUrls(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '', // optional
'expanded' => '', // optional
'idSubtable' => '', // optional
'flat' => '' // optional
];
$format = 'json';
$exitPageUrls = Piwik::getActions()->getExitPageUrls($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$exitPageUrls = Piwik::getActions()->getExitPageUrls($arguments, $format);
getPageUrl(...)
Parameters
Verbose Example
$pageUrl = 'https://example.com/test';
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '' // optional
];
$format = 'json';
$pageUrl = Piwik::getActions()->getPageUrl($pageUrl, $arguments, $format);
Simplified Example
$pageUrl = 'https://example.com/test';
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$pageUrl = Piwik::getActions()->getPageUrl($pageUrl, $arguments, $format);
getPageTitles(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '', // optional
'expanded' => '', // optional
'idSubtable' => '', // optional
'flat' => '' // optional
];
$format = 'json';
$pageTitles = Piwik::getActions()->getPageTitles($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$pageTitles = Piwik::getActions()->getPageTitles($arguments, $format);
getEntryPageTitles(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '', // optional
'expanded' => '', // optional
'idSubtable' => '', // optional
'flat' => '' // optional
];
$format = 'json';
$entryPageTitles = Piwik::getActions()->getEntryPageTitles($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$entryPageTitles = Piwik::getActions()->getEntryPageTitles($arguments, $format);
getExitPageTitles(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '', // optional
'expanded' => '', // optional
'idSubtable' => '', // optional
'flat' => '' // optional
];
$format = 'json';
$exitPageTitles = Piwik::getActions()->getExitPageTitles($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$exitPageTitles = Piwik::getActions()->getExitPageTitles($arguments, $format);
getPageTitle(...)
Parameters
Verbose Example
$pageName = 'test';
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '' // optional
];
$format = 'json';
$pageTitle = Piwik::getActions()->getPageTitle($pageName, $arguments, $format);
Simplified Example
$pageName = 'test';
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$pageTitle = Piwik::getActions()->getPageTitle($pageName, $arguments, $format);
getDownloads(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '', // optional
'expanded' => '', // optional
'idSubtable' => '', // optional
'flat' => '' // optional
];
$format = 'json';
$downloads = Piwik::getActions()->getDownloads($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$downloads = Piwik::getActions()->getDownloads($arguments, $format);
getDownload(...)
Parameters
Verbose Example
$downloadUrl = 'https://example.com/test';
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '' // optional
];
$format = 'json';
$download = Piwik::getActions()->getDownload($downloadUrl, $arguments, $format);
Simplified Example
$downloadUrl = 'https://example.com/test';
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$download = Piwik::getActions()->getDownload($downloadUrl, $arguments, $format);
getOutlinks(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '', // optional
'expanded' => '', // optional
'idSubtable' => '', // optional
'flat' => '' // optional
];
$format = 'json';
$outlinks = Piwik::getActions()->getOutlinks($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$outlinks = Piwik::getActions()->getOutlinks($arguments, $format);
getOutlink(...)
Parameters
Verbose Example
$outlinkUrl = 'https://example.com/test';
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '' // optional
];
$format = 'json';
$outlink = Piwik::getActions()->getOutlink($outlinkUrl, $arguments, $format);
Simplified Example
$outlinkUrl = 'https://example.com/test';
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$outlink = Piwik::getActions()->getOutlink($outlinkUrl, $arguments, $format);
getSiteSearchKeywords(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '' // optional
];
$format = 'json';
$siteSearchKeywords = Piwik::getActions()->getSiteSearchKeywords($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$siteSearchKeywords = Piwik::getActions()->getSiteSearchKeywords($arguments, $format);
getSiteSearchNoResultKeywords(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '' // optional
];
$format = 'json';
$siteSearchNoResultKeywords = Piwik::getActions()->getSiteSearchNoResultKeywords($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$siteSearchNoResultKeywords = Piwik::getActions()->getSiteSearchNoResultKeywords($arguments, $format);
getSiteSearchCategories(...)
Parameters
Verbose Example
$arguments = [
'idSite' => 1,
'period' => 'day',
'date' => 'yesterday',
'segment' => '' // optional
];
$format = 'json';
$siteSearchCategories = Piwik::getActions()->getSiteSearchCategories($arguments, $format);
Simplified Example
$arguments = []; // will use idSite, period and date from config
$format = 'json';
$siteSearchCategories = Piwik::getActions()->getSiteSearchCategories($arguments, $format);