ampproject / amphtml

The AMP web component framework.
https://amp.dev
Apache License 2.0
14.89k stars 3.89k forks source link

Centralized LinkRewriterManager #25132

Closed nickcroce closed 3 years ago

nickcroce commented 4 years ago

Change Requested

At Narrativ, we work with publishers to help monetize their content. In many cases, publishers want to work with both us and other affiliate networks such as Skimlinks -- i.e. primarily using Narrativ as a gateway to merchant products, and falling back to Skimlinks when a link cannot be monetized through us. As demand for AMP solutions grows, we want to provide as seamless an experience for our clients as possible.

Currently, Skimlinks has developed both a LinkRewriter and LinkRewriterManager class to enable multiple affiliates on a publisher site and prioritize monetization. However, since the LinkRewriterManager is initialized in the amp-skimlinks extension, there is a dependency between our extension and theirs: https://github.com/ampproject/amphtml/blob/master/extensions/amp-skimlinks/0.1/amp-skimlinks.js#L79-L84

Additionally, the presence of both amp-smartlinks and amp-skimlinks causes a validation error. If this functionality could be bubbled up to a central place, it might alleviate some of these issues we're experiencing.

Potential Implementation

Thanks for your time, let me know if you have any questions!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.