diff --git a/README.md b/README.md index 4527635..fa55185 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ Period::create($startDate, $endDate); ### Visitors and page views ```php -public function fetchVisitorsAndPageViews(Period $period): Collection +public function fetchVisitorsAndPageViews(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection ``` The function returns a `Collection` in which each item is an array that holds keys `activeUsers`, `screenPageViews` and `pageTitle`. @@ -171,7 +171,7 @@ The function returns a `Collection` in which each item is an array that holds ke ### Visitors and page views by date ```php -public function fetchVisitorsAndPageViewsByDate(Period $period): Collection +public function fetchVisitorsAndPageViewsByDate(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection ``` The function returns a `Collection` in which each item is an array that holds keys `date`, `activeUsers`, `screenPageViews` and `pageTitle`. @@ -179,7 +179,7 @@ The function returns a `Collection` in which each item is an array that holds ke ### Total visitors and pageviews ```php -public function fetchTotalVisitorsAndPageViews(Period $period): Collection +public function fetchTotalVisitorsAndPageViews(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection ``` The function returns a `Collection` in which each item is an array that holds keys `date`, `date`, `visitors`, and `pageViews`. @@ -187,7 +187,7 @@ The function returns a `Collection` in which each item is an array that holds ke ### Most visited pages ```php -public function fetchMostVisitedPages(Period $period, int $maxResults = 20): Collection +public function fetchMostVisitedPages(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection ``` The function returns a `Collection` in which each item is an array that holds keys `fullPageUrl`, `pageTitle` and `screenPageViews`. @@ -195,7 +195,7 @@ The function returns a `Collection` in which each item is an array that holds ke ### Top referrers ```php -public function fetchTopReferrers(Period $period, int $maxResults = 20): Collection +public function fetchTopReferrers(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection ``` The function returns a `Collection` in which each item is an array that holds keys `screenPageViews` and `pageReferrer`. @@ -211,7 +211,7 @@ The function returns a `Collection` in which each item is an array that holds ke ### Top browsers ```php -public function fetchTopBrowsers(Period $period, int $maxResults = 10): Collection +public function fetchTopBrowsers(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection ``` The function returns a `Collection` in which each item is an array that holds keys `screenPageViews` and `browser`. @@ -219,7 +219,7 @@ The function returns a `Collection` in which each item is an array that holds ke ### Top countries ```php -public function fetchTopCountries(Period $period, int $maxResults = 10): Collection +public function fetchTopCountries(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection ``` The function returns a `Collection` in which each item is an array that holds keys `screenPageViews` and `country`. @@ -227,7 +227,7 @@ The function returns a `Collection` in which each item is an array that holds ke ### Top operating systems ```php -public function fetchTopOperatingSystems(Period $period, int $maxResults = 10): Collection +public function fetchTopOperatingSystems(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection ``` The function returns a `Collection` in which each item is an array that holds keys `screenPageViews` and `operatingSystem`. diff --git a/src/Analytics.php b/src/Analytics.php index 83d2bc0..4c9628e 100644 --- a/src/Analytics.php +++ b/src/Analytics.php @@ -35,7 +35,7 @@ public function getPropertyId(): string * screenPageViews: int * }> */ - public function fetchVisitorsAndPageViews(Period $period, int $maxResults = 10, int $offset = 0): Collection + public function fetchVisitorsAndPageViews(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection { return $this->get( period: $period, @@ -43,6 +43,8 @@ public function fetchVisitorsAndPageViews(Period $period, int $maxResults = 10, dimensions: ['pageTitle'], maxResults: $maxResults, offset: $offset, + dimensionFilter: null, + keepEmptyRows: $keepEmptyRows, ); } @@ -54,7 +56,7 @@ public function fetchVisitorsAndPageViews(Period $period, int $maxResults = 10, * screenPageViews: int * }> */ - public function fetchVisitorsAndPageViewsByDate(Period $period, int $maxResults = 10, $offset = 0): Collection + public function fetchVisitorsAndPageViewsByDate(Period $period, int $maxResults = 10, $offset = 0, bool $keepEmptyRows = false): Collection { return $this->get( period: $period, @@ -65,6 +67,8 @@ public function fetchVisitorsAndPageViewsByDate(Period $period, int $maxResults OrderBy::dimension('date', true), ], offset: $offset, + dimensionFilter: null, + keepEmptyRows: $keepEmptyRows, ); } @@ -75,7 +79,7 @@ public function fetchVisitorsAndPageViewsByDate(Period $period, int $maxResults * screenPageViews: int * }> */ - public function fetchTotalVisitorsAndPageViews(Period $period, int $maxResults = 20, int $offset = 0): Collection + public function fetchTotalVisitorsAndPageViews(Period $period, int $maxResults = 20, int $offset = 0, bool $keepEmptyRows = false): Collection { return $this->get( period: $period, @@ -86,6 +90,8 @@ public function fetchTotalVisitorsAndPageViews(Period $period, int $maxResults = OrderBy::dimension('date', true), ], offset: $offset, + dimensionFilter: null, + keepEmptyRows: $keepEmptyRows, ); } @@ -96,7 +102,7 @@ public function fetchTotalVisitorsAndPageViews(Period $period, int $maxResults = * screenPageViews: int * }> */ - public function fetchMostVisitedPages(Period $period, int $maxResults = 20, int $offset = 0): Collection + public function fetchMostVisitedPages(Period $period, int $maxResults = 20, int $offset = 0, bool $keepEmptyRows = false): Collection { return $this->get( period: $period, @@ -107,6 +113,8 @@ public function fetchMostVisitedPages(Period $period, int $maxResults = 20, int OrderBy::metric('screenPageViews', true), ], offset: $offset, + dimensionFilter: null, + keepEmptyRows: $keepEmptyRows, ); } @@ -116,7 +124,7 @@ public function fetchMostVisitedPages(Period $period, int $maxResults = 20, int * screenPageViews: int * }> */ - public function fetchTopReferrers(Period $period, int $maxResults = 20, int $offset = 0): Collection + public function fetchTopReferrers(Period $period, int $maxResults = 20, int $offset = 0, bool $keepEmptyRows = false): Collection { return $this->get( period: $period, @@ -127,6 +135,8 @@ public function fetchTopReferrers(Period $period, int $maxResults = 20, int $off OrderBy::metric('screenPageViews', true), ], offset: $offset, + dimensionFilter: null, + keepEmptyRows: $keepEmptyRows, ); } @@ -151,7 +161,7 @@ public function fetchUserTypes(Period $period): Collection * screenPageViews: int * }> */ - public function fetchTopBrowsers(Period $period, int $maxResults = 10, int $offset = 0): Collection + public function fetchTopBrowsers(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection { return $this->get( period: $period, @@ -162,6 +172,8 @@ public function fetchTopBrowsers(Period $period, int $maxResults = 10, int $offs OrderBy::metric('screenPageViews', true), ], offset: $offset, + dimensionFilter: null, + keepEmptyRows: $keepEmptyRows, ); } @@ -171,7 +183,7 @@ public function fetchTopBrowsers(Period $period, int $maxResults = 10, int $offs * screenPageViews: int * }> */ - public function fetchTopCountries(Period $period, int $maxResults = 10, int $offset = 0): Collection + public function fetchTopCountries(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection { return $this->get( period: $period, @@ -182,6 +194,8 @@ public function fetchTopCountries(Period $period, int $maxResults = 10, int $off OrderBy::metric('screenPageViews', true), ], offset: $offset, + dimensionFilter: null, + keepEmptyRows: $keepEmptyRows, ); } @@ -191,7 +205,7 @@ public function fetchTopCountries(Period $period, int $maxResults = 10, int $off * screenPageViews: int * }> */ - public function fetchTopOperatingSystems(Period $period, int $maxResults = 10, int $offset = 0): Collection + public function fetchTopOperatingSystems(Period $period, int $maxResults = 10, int $offset = 0, bool $keepEmptyRows = false): Collection { return $this->get( period: $period, @@ -202,6 +216,8 @@ public function fetchTopOperatingSystems(Period $period, int $maxResults = 10, i OrderBy::metric('screenPageViews', true), ], offset: $offset, + dimensionFilter: null, + keepEmptyRows: $keepEmptyRows, ); }