amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

A4A Cross Domained AMP Creatives Click URL Does Not Replace X/Y

Open keithwrightbos opened this issue 10 years ago • 8 comments

Short description of your issue:

A4A dynamically replaced CLICK_X/CLICK_Y for any links within its friendly frame upon click for AMP creatives. However, it is possible that AMP creatives can be cross domained if they could not be verified client-side (or failed server-side validation). Need to ensure that CLICK_X/CLICK_Y occurs in this situation.

Original design placed CLICK_X/CLICK_Y replacement on document for all AMP documents but was moved into amp-a4a.js by @cramforce We need it to exist in the cross domained AMP creative case as well (likely as part of amp-inabox effort).

keithwrightbos avatar Nov 29 '16 20:11 keithwrightbos

@keithwrightbos so we want to make it available for the whole AMP document?

I saw the CLICK_X/Y are derived from mouseEvent.pageX/Y. For clicks inside an iframe, do you know if it's relative to the iframe doc or the host doc? would there be a discrepancy between xorigin iframe and friendly iframe?

lannka avatar Nov 29 '16 20:11 lannka

Yes I believe so but only in the case that the document is a creative (e.g. amp-inabox case). CLICK_X/CLICK_Y should be relative to the iframe, not the container page so pageX/Y should be sufficient (please double check). In other words, it the click location within the creative.

keithwrightbos avatar Nov 29 '16 20:11 keithwrightbos

Logic should be the same as with the friendly iframe, so we can likely install the very same handler (factored out).

On Tue, Nov 29, 2016 at 12:46 PM, keithwrightbos [email protected] wrote:

Yes I believe so but only in the case that the document is a creative (e.g. amp-inabox case). CLICK_X/CLICK_Y should be relative to the iframe, not the container page so pageX/Y should be sufficient (please double check). In other words, it the click location within the creative.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/6385#issuecomment-263693510, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFeT_nEnI4gQdF_uxnmDBdRZJEiRiAWks5rDI8UgaJpZM4K_bNJ .

cramforce avatar Nov 29 '16 20:11 cramforce

Sounds like we agree to install the click handler to whole AMP document? Or is there a privacy or performance concern?

lannka avatar Dec 28 '16 21:12 lannka

SGTM in the event we know the document is an AMP inabox creative.

On Wed, Dec 28, 2016, 4:04 PM Hongfei Ding [email protected] wrote:

Sounds like we agree to install the click handler to whole AMP document? Or is there a privacy or performance concern?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/6385#issuecomment-269540504, or mute the thread https://github.com/notifications/unsubscribe-auth/ABr0L88U3sJNbwTevLwTeGCpfcKgMoFEks5rMs6pgaJpZM4K_bNJ .

keithwrightbos avatar Dec 28 '16 21:12 keithwrightbos

Yes. Very likely I can just move the logic in amp-a4a.js to amp-inabox.js.

lannka avatar Dec 28 '16 21:12 lannka

Ping @lannka for prioritization.

jasti avatar Feb 10 '17 06:02 jasti

@jasti let's aim for the coming sprint

lannka avatar Feb 11 '17 04:02 lannka