I'm having a trouble on my site. I have my own script which counts how many times the ads display in a page using PHP script, which always run every page refresh without any condition and it sums up the ads to 2 Million+ page views. but on my Google Analytics the page views is only at 100k+. How does the Google ads pageview works? Is it have a special condition like IP per count? or for a specific IP there is a certain x amount of time to add it to count?
For Google AdSense there is a IP limit.
For example if a client makes some fast hits (5 - 10), his ip is banned for a short time (1 - 2 minutes) and no more ads will be shown, or cached ads that are not counted as impressions will be served.
Also if the client uses ad blocker software (we all hate this), no ads are shown, and they are also calculated by your counter.
Finally if your pages contain errors it is also possible that not all impressions are shown on Google AdSense reports.