Oath viewability plugin
npm install oath-viewabilityOath viewability detection plugin
npm install --save oath-viewability
`Usage
$3
`es
import oathViewabilityLoader from 'oath-viewability'const someDOMElement = document.getElementById('my-element')
oathViewabilityLoader.then((oathViewability) => {
const elementViewability = new oathViewability(someDOMElement)
elementViewability.then((detector) => {
detector.getPercent() // {0-100}
detector.getVisible() // {0|1}
})
})
`$3
Embed the script from
./node_modules/oath-viewability/dist/clj.js`js
(function(window) {
var someDOMElement = document.getElementById('my-element');
window.oath.viewability.then(function(oathViewability) {
var elementViewability = new oathViewability(someDOMElement)
elementViewability.then(function(detector) {
detector.getPercent(); // {0-100}
detector.getVisible(); // {0|1}
})
});
})(window);`Local usage
You can use npm start` if you want to check demopage on http://localhost:8080/demo/