From 42a51049059280a1b6eb93f74094a178eb59cc8f Mon Sep 17 00:00:00 2001 From: Bas van Dinther Date: Fri, 29 Sep 2023 11:12:27 +0200 Subject: [PATCH] Get referrer by sessionSource and defaultChannelGrouping (#23) --- src/Traits/Analytics/ResourceAnalytics.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Traits/Analytics/ResourceAnalytics.php b/src/Traits/Analytics/ResourceAnalytics.php index f786f8c..7c4a6f2 100644 --- a/src/Traits/Analytics/ResourceAnalytics.php +++ b/src/Traits/Analytics/ResourceAnalytics.php @@ -12,7 +12,7 @@ public function getTopReferrers(Period $period, int $limit): array $googleAnalytics = $this->googleAnalytics ->setDateRange($period) ->addMetrics('sessions') - ->addDimensions('pageReferrer') + ->addDimensions('sessionSource', 'sessionDefaultChannelGrouping') ->orderByMetric('sessions', Direction::DESC) ->limit($limit); @@ -25,7 +25,7 @@ public function getTopReferrersByPageTitle(Period $period, int $limit): array $googleAnalytics = $this->googleAnalytics ->setDateRange($period) ->addMetrics('sessions') - ->addDimensions('pageReferrer', 'pageTitle') + ->addDimensions('sessionSource', 'sessionDefaultChannelGrouping', 'pageTitle') ->orderByMetric('sessions', Direction::DESC) ->limit($limit); @@ -38,7 +38,7 @@ public function getTopReferrersByPagePath(Period $period, int $limit): array $googleAnalytics = $this->googleAnalytics ->setDateRange($period) ->addMetrics('sessions') - ->addDimensions('pageReferrer', 'pagePath') + ->addDimensions('sessionSource', 'sessionDefaultChannelGrouping', 'pagePath') ->orderByMetric('sessions', Direction::DESC) ->limit($limit);