Created
February 14, 2018 15:55
-
-
Save ovlb/3cb25795e0096b66e0a2885508708918 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Check current status | |
| const optOutWish = () => { | |
| const doNotTrack = navigator.doNotTrack === '1' | |
| const hasOptedOut = localStorage.getItem('fb-pixel-status') === 'opt-out' | |
| return doNotTrack || hasOptedOut | |
| } | |
| // Output to an element in the document | |
| const setDebugStatus = () => { | |
| $status = document.querySelector('.js-opt-out-status') | |
| const optOut = optOutWish() | |
| const text = optOut ? 'Pixel ist deaktiviert.' : 'Pixel ist aktiviert.' | |
| $status.innerText = text | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment