|
|
|
|
|
by regus
689 days ago
|
|
I worked at a company that did this. Here is the formula for viewability: Percent In View = Area of the Intersection of the Ad and the Viewport / Area of the Ad You would get the area of the ad using getBoundingClientRect, and the area of the viewport using window.innerWidth and window.innerHeight. It was not possible to do this if the ad was within a hostile iframe (cross origin iframe) so you needed to use a third party source for this information like SafeFrame. All of this was greatly simplified when Intersection Observer was officially supported by modern browsers. |
|