mardi 1 décembre 2015

Differentiating Adblock Disabled from Whitelist

Simple question here: I know there are lots of ways to detect a user is using adblock on the web using Javascript but I was wondering if there's a way to specifically detect when a user has whitelisted a website (as opposed to simply disable adblocking). I assume this varies based on the blocker but for the sake of simplicity lets just say AdBlock Plus.

Currently I can easily detect adblocking by simply seeing if my ads object has successfully loaded from an external script. I then store this boolean in localStorage so upon subsequent user visits I can detect if there's been a change in the user's adblocking. If so I thank them for disabling/whitelisting and update the localStorage. However it might be required to handle these two actions separately.

Any and all help appreciated. Thank you.




Aucun commentaire:

Enregistrer un commentaire