amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Fast Fetch allow AMP creatives to remain after pause in viewer

Open keithwrightbos opened this issue 9 years ago • 5 comments

Current Fast Fetch, AMP creatives are destroyed when a user swipes between pages in the viewer. Presumably this is to ensure that custom JS within creatives cannot execute when a user is not viewing the page. AMP creatives do not allow for custom JS and therefore any of their custom pings (amp-pixel or amp-analytics) already ensure they cannot fire when in the "prerender" state. Leaving the creative in place will ensure a creative is visible if/when the user swipes back.

cc/ @ampproject/a4a

keithwrightbos avatar May 04 '17 21:05 keithwrightbos

@dvoytenko @jridgewell @lannka:

General thoughts?

Is it safe to assume that AMP analytics events (e.g. visibility, ini-load) and amp-pixel for delayed impressions will not fire again once met on the original page render? In other words, for a slot on the page the fired the amp-pixel or amp-analytics, if the user swipes away, we do not remove the creative or amp-analytics within unlayoutCallback and the user swipes back, the pings will not be sent again?

keithwrightbos avatar May 05 '17 14:05 keithwrightbos

already ensure they cannot fire when in the "prerender" state

The page should never go back into prerender state after it's initially shown, so this isn't an issue. The reason we unload all the iframes is because they're really expensive resources, especially if they have JS running inside.

If A4A can't have iframes, then it should definitely not be unloading during pause.

jridgewell avatar May 05 '17 17:05 jridgewell

I agree. I think we can forgo unloaded fie a4a.

dvoytenko avatar May 05 '17 18:05 dvoytenko

Another reason for unload, btw, is that we need to force-pause any playing videos and audios. With FIE A4A, we execute pause against all known resources. So this is already done.

dvoytenko avatar May 05 '17 18:05 dvoytenko

Great then we will start as an experiment to measure impact. Likely in a later version will use the time between pause and resume to potentially refetch to ensure that ad is not too stale.

@bradfrizzell will be taking lead on implementation

keithwrightbos avatar May 10 '17 14:05 keithwrightbos