Analytics - Google - v1.0.0
GaTopContentData
ArtisanPackUI\AnalyticsGoogle\Reporting\GaTopContentData — immutable, readonly final DTO backing the top-content surface.
Constructor
public function __construct(
public readonly array $topPages, // list<{path, title, views, users}>
public readonly array $topEvents, // list<{event, count, users}>
public readonly DateRange $range,
)
topPages—list<array{path: string, title: string, views: float, users: float}>sorted byviewsdescending.topEvents—list<array{event: string, count: float, users: float}>sorted bycountdescending.range— the sameDateRangepassed toGaTopContentFetcher::fetch().
Methods
toArray(): array<string, mixed>
JSON shape returned by the /analytics-google/top-content endpoint:
[
'range' => [ 'startDate' => '29daysAgo', 'endDate' => 'today' ],
'top_pages' => [ [ 'path' => '/', 'title' => 'Home', 'views' => 1234.0, 'users' => 800.0 ], ... ],
'top_events' => [ [ 'event' => 'page_view', 'count' => 4567.0, 'users' => 800.0 ], ... ],
]