ArtisanPack UI
DocsAnalytics - GoogleGaOverviewData

GaOverviewData

Analytics - Google v1.1.0

— immutable, readonly DTO backing the GA overview surface. - — . - — sorted by ascending. is . - — the same passed to . JSON shape returned by the...

ArtisanPackUI\AnalyticsGoogle\Reporting\GaOverviewData — immutable, readonly final DTO backing the GA overview surface.

Constructor

public function __construct(
    public readonly array $totals,      // {sessions, users, page_views, avg_engagement_seconds}
    public readonly array $trend,       // list<{date, sessions, users, page_views}>
    public readonly DateRange $range,
)
  • totals — array{sessions: float, users: float, page_views: float, avg_engagement_seconds: float}.
  • trend — list<array{date: string, sessions: float, users: float, page_views: float}> sorted by date ascending. date is YYYY-MM-DD.
  • range — the same DateRange passed to GaOverviewFetcher::fetch().

Methods

toArray(): array<string, mixed>

JSON shape returned by the /analytics-google/overview endpoint:

[
    'range'  => [ 'startDate' => '29daysAgo', 'endDate' => 'today' ],
    'totals' => [ 'sessions' => 1234.0, 'users' => 800.0, 'page_views' => 4567.0, 'avg_engagement_seconds' => 92.4 ],
    'trend'  => [ [ 'date' => '2026-06-12', 'sessions' => 45.0, 'users' => 30.0, 'page_views' => 180.0 ], ... ],
]

Stay in the Loop

Monthly tips, tutorials and package updates — plus a free Quick Start cheat sheet.

Subscribe
Edit this page on GitHub