From 003365cca0de34987feaccd0d8d50cd736294321 Mon Sep 17 00:00:00 2001 From: Bas van Dinther Date: Fri, 29 Sep 2023 11:09:03 +0200 Subject: [PATCH] Get referrer by sessionSource and defaultChannelGrouping --- 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);