amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Audit window.context and ensure all info & API are available for AMP ads

Open jasti opened this issue 9 years ago • 6 comments

Because of the lack of JavaScript, we want to ensure that all AMP creatives served as friendly iframes have access to all the parent information and APIs like any 3P creative does. Specifically, does the creative need to use amp-analytics/ amp-pixel? Would an AMP ad need to trigger the available APIs?

CC @ampproject/a4a @zhouyx @alanorozco

jasti avatar Apr 12 '17 23:04 jasti

So when you say "parent information and APIs like any 3p creative does", what are you looking for? A 3p creative (in a cross-domain iframe) can execute any JS, so in some sense, no, an AMP creative can't have all its APIs. But I think (correct me if I'm wrong) that you're getting at "the same information offered by window.context to a 3p creative"?

The AMP creative's "API" is, as you say, amp-analytics and amp-pixel. Or anything else it can do with any (allowed) AMP component. Are you concerned primarily with its monitoring/reporting capabilities (via analytics)?

tdrl avatar Apr 13 '17 13:04 tdrl

I'm not sure I follow the intent of this issue. Preferentially rendered AMP creatives are friendly to and utilize the publisher page AMP runtime and therefore can access it directly via AMP extensions. Are you proposing there are capabilities provided by the window context API that are not available via AMP extension? I'm not sure they're really comparable as I would argue the motivation around creation of window context does not apply in this case (e.g. allow for access to AMP runtime information because tag/creative is within xdomain frame & allow custom JS access)

keithwrightbos avatar Apr 13 '17 13:04 keithwrightbos

@tdrl @keithwrightbos Right, you are both on point. Basically, I'd like to verify we support everything listed here https://github.com/ampproject/amphtml/blob/master/ads/README.md#available-information and https://github.com/ampproject/amphtml/blob/master/ads/README.md#available-apis available for AMP ads as well.

For e.g. reg APIs, can AMP ads call render start? can AMP ads set no content? getHtml? Regarding info, is all info listed under 'available-information' available via amp-analytics as well?

jasti avatar Apr 13 '17 23:04 jasti

amp-analytics inside FIE AMP creative has slightly set of available vars: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/0.1/a4a-variable-source.js#L27 but should be covered well already. @jasti , let us know if you want something more.

Regards,

Hongfei

On Thu, Apr 13, 2017 at 4:39 PM, Vamsee Jasti [email protected] wrote:

@tdrl https://github.com/tdrl @keithwrightbos https://github.com/keithwrightbos Right, you are both on point. Basically, I'd like to verify we support everything listed here https://github.com/ampproject/amphtml/blob/master/ads/README.md#available- information and https://github.com/ampproject/amphtml/blob/master/ads/ README.md#available-apis available for AMP ads as well.

For e.g. reg APIs, can AMP ads call render start? can AMP ads set no content? getHtml? Regarding info, is all info listed under 'available-information' available via amp-analytics as well?

— You are receiving this because you are on a team that was mentioned. Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/8741#issuecomment-294048562, or mute the thread https://github.com/notifications/unsubscribe-auth/AIGnAduZIXSlNC1AHZXTYmqYPQvk4kXTks5rvrIsgaJpZM4M8GM9 .

lannka avatar Apr 14 '17 04:04 lannka

great, and the APIs?

jasti avatar Apr 14 '17 16:04 jasti

@jasti there's no APIs needed for FIE case. If you were talking about the fast fetch delayed rendering case, same APIs are exposed, but creative needs to load ampcontext lib to be able to access the APIs. According to @keithwrightbos this is still unclear what creatives are relying on those APIs. I will close this for now.

lannka avatar May 10 '17 17:05 lannka