'My Label 1', 'nb_visits' => '1'), array('label' => 'My Label 2', 'nb_visits' => '5'), )); return $table; } /** * Returns the example metric we archive in Archiver.php. * @param string $idSite (might be a number, or the string all) */ public function getExampleArchivedMetric(string $idSite, string $period, string $date, ?string $segment = null): DataTable\DataTableInterface { Piwik::checkUserHasViewAccess($idSite); $archive = Archive::build($idSite, $period, $date, $segment); return $archive->getDataTableFromNumeric([ExampleMetric::EXAMPLEPLUGIN_METRIC_NAME, ExampleMetric2::EXAMPLEPLUGIN_CONST_METRIC_NAME]); } public function getSegmentHash(string $idSite, string $segment) { Piwik::checkUserHasViewAccess($idSite); $segment = new Segment($segment, [$idSite]); return $segment->getHash(); } }