How does Data Sampling work?
By default every time a popup pops, a new request is made and a database query is performed to track an impression. If your site has very high traffic it will consume many resources because of the requests and MySQL saves.
With data sampling enabled, every time a popup is shown it will generate a random number between 1 and N, being N the sample rate. If the random number turns out to be 1, then the views count of that post/page will be incremented by N.
For example, if you choose a data sample rate of 100 and you have 1000 visitors every minute, instead of performing 1000 requests and database queries every minute you will reduce that number down to 100 approx.
If your sample rate is 100, it means that the probability of hitting 1 is 1/100. When the random number hits 1, the impressions will be increased by 100. In other words 1 request/ query every 100 impressions.
Will this impact on the accuracy of the statistics?
Yes, as we are taking a data sample, the stats will more and more accurate as more visits we have approximating to the real number. It’s a tradeoff between accuracy and performance.
On the settings page of the WP Popups plugin, you can tweak the sample rate. For low / medium traffic sites you should use around 30 / 60 rate. As you lower the sample rate, stats will be more accurate, but also the database writing frequency will be higher.