Skip to content

Commit 7ac672f

Browse files
demianrenzulliaddyosmani
authored andcommitted
Update docs with ad-related considerations (#122)
Adding sub-section with considerations to take for sites monetizing through ads. cc // @addyosmani
1 parent 8cd1183 commit 7ac672f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,16 @@ Cross-origin prefetching (e.g a.com/foo.html prefetches b.com/bar.html) has a nu
357357

358358
To workaround this problem, you can consider passing along session information via the [ping attribute](https://caniuse.com/#feat=ping) (separately) so the origin can stitch a session together asynchronously.
359359

360+
### Ad-related considerations
361+
362+
Sites that rely on ads as a source of monetization should not prefetch ad-links, to avoid unintentionally countinig clicks against those ad placements, which can lead to inflated Ad CTR (click-through-rate).
363+
364+
Ads appear on sites mostly in two ways:
365+
366+
- **Inside iframes:** By default, most ad-servers render ads within iframes. In these cases, those ad-links won't be prefetched by Quicklink, unless a developer explicitly passes in the URL of an ads iframe. The reason is that the library look-up for in-viewport elements is restricted to those of the top-level origin.
367+
368+
- **Outside iframes:**: In cases when the site shows same-origin ads, displayed in the top-level document (e.g. by hosting the ads themselves and by displaying the ads in the page directly), the developer needs to explicitly tell Quicklink to avoid prefetching these links. This can be achieved by passing the URL or subpath of the ad-link, or the element containing it to the [custom ignore patterns list](/#custom-ignore-patterns).
369+
360370
## Related projects
361371

362372
* Using [Gatsby](https://gatsbyjs.org)? You already get most of this for free baked in. It uses `Intersection Observer` to prefetch all of the links that are in view and provided heavy inspiration for this project.

0 commit comments

Comments
 (0)