Reputation: 21
We are building a web app/widget for a publisher. We want the widget to be Google AMP ready (<amp-iframe>
documentation).
Does anyone know if a standard iframe will work on an AMP page?
Upvotes: 0
Views: 945
Reputation: 171
A regular Iframe will NOT work in an AMP page. If you want the widget to be google AMP ready you'll need to serve it through an AMP-IFRAME tag.
I'm guessing that your widget needs user authored javascript and possibly other JS libraries with it. If this is the case it all has to be pulled into an AMP-IFRAME tag in order to work. The other caveat to this is the AMP-IFRAME tag must make the call securely via HTTPS.
For example, our 8 news stations have a custom video player that requires a ton of external user authored JS that has to be pulled in to run our preroll, ads and tracking. We also use m3u8 url's which is not supported by the AMP-VIDEO tag or HTML5. So in a way or custom video player is basically a widget that allows you to play custom video with ads and preroll. Because of this we have an embed directory that we have served via HTTPS and the embed template that we hit via HTTPS will spit out our video player into the AMP-IFRAME tag. So everything for the widget is all served as a single call from an HTTPS directory.
This is a great resource for AMP page questions and understanding: Turn Your AMP Up To 11.
Hope this helps.
Upvotes: 1