Hi @bwbama,
URL parameters have no effect whatsoever on how WPP tracks page views. Your issue is likely being caused by something else, can’t say what exactly though without more details.
It appears to be an issue with Cloudflare APO: https://support.cloudflare.com/hc/en-us/articles/360049822312-Understanding-Automatic-Platform-Optimization-APO-with-WordPress
Is there some kind of nonce set that expires?
It seems after a certain amount of time of the page being cached a 403 is returned:
POST wpp.min.js?ver=5.2.4:1 POST https://www.bamapolitics.com/wp-json/wordpress-popular-posts/v1/popular-posts 403
-
This reply was modified 5 years, 1 month ago by
Brent Wilson.
Yes, WordPress Popular Posts uses a nonce when updating the views count of a post / page for security reasons (the REST API itself, which WPP uses to perform the views count update, requires that for the same reasons.)
This nonce expires roughly every 24 hours. Because of that any sort of caching system you use on your website (a caching plugin, or CloudFlare’s APO in this case) needs to be regenerated every 24 hours or less, otherwise if the browser loads a cached post/page that’s over 24 hours old it’ll contain an expired nonce. When WPP attempts to use it to update the post/page views count the REST API will reject the request because the nonce is -as explained earlier- no longer valid, hence the 403 Forbidden error message you’re seeing.
So, if you want to continue using WPP in conjunction with CF’s APO (or any other plugin that relies on nonces, like Contact Form 7 and many others) please make sure that APO’s cache expires at least every 24 hours (twice a day is what I recommend.)
-
This reply was modified 5 years, 1 month ago by
Hector Cabrera. Reason: Included explanation about the 403 error
Marking as resolved due to inactivity.
OP if you still need a hand with this please feel free to leave a comment below.