Why Google Analytics pageviews different from filter by day and by month
I wrote a script to sync Google Analytics (GA) pageviews to own DB in daily basis.
E.g.
- 2019-12-01 ->
342pageviews - 2019-12-02 ->
621pageviews - 2019-12-03 ->
781pageviews - 2019-12-04 ->
388pageviews - 2019-12-05 ->
562pageviews - …
- 2019-12-31 ->
597pageviews
So that I can generate report (in my web app, not GA) and filter by date range.
But then, I encounter an issue, when I filter the report range from 2019-06-01 to 2019-06-30,
the total pageviews are different from GA report.
Then I cross check it day by day, and both (GA & web app) are tally.

👆 from 2019-06-01 to 2019-06-21, both are tally

👆 from 2019-06-01 to 2019-06-22, the result are different.
From here, I assume the result for 2019-06-22 has problem

But when I cross check for 2019-06-22, both are tally again 🤔

👆 from 2019-06-19 to 2019-06-22, the result are tally also.
Then after googled for a while, I think is caused by the GA sampling, perhaps from range2019-06-01 to 2019-06-22, the data set are too large, thus Google just pick a sample set of data. See the references 👇

