Search code examples
amp-html

amp-iframe google places sometimes refuses to render


I have amp-iframe with google places on my website, the issue is that sometimes it renders and sometimes it doesn't.

For instance, in this URL it renders https://www.didomenicapalermo.com.ar/venta/casas/modernas-en-barrio-el-cazador-escobar/amp

<amp-iframe width="600" height="400" layout="responsive" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation" frameborder="0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyD6dkHc8fW_mUsoWRH7XZoje20cAfLqpjw&q= -34.30814559434459,-58.7645224110413&zoom=15"></amp-iframe>

But in thoose URL's it doesn't https://www.didomenicapalermo.com.ar/venta/terrenos/y-lotes-en-esquina-comercial-de-escobar-zona-norte/amp

<amp-iframe width="600" height="400" layout="responsive" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation" frameborder="0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyD6dkHc8fW_mUsoWRH7XZoje20cAfLqpjw&amp;q=-34.340968537270385,-58.78817459781499&amp;zoom=15"></amp-iframe>

https://www.didomenicapalermo.com.ar/venta/terrenos/con-todos-los-servicios-escobar/amp

<amp-iframe width="600" height="400" layout="responsive" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation" frameborder="0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyD6dkHc8fW_mUsoWRH7XZoje20cAfLqpjw&amp;q=-34.33815254252059,-58.797808417633064&amp;zoom=15"></amp-iframe>

https://www.didomenicapalermo.com.ar/venta/terrenos/con-agua-corriente-cloacas-escobar/amp

<amp-iframe width="600" height="400" layout="responsive" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation" frameborder="0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyD6dkHc8fW_mUsoWRH7XZoje20cAfLqpjw&amp;q=-34.343364984291966,-58.78496684381105&amp;zoom=15"></amp-iframe>

Double checked the code, and it seems to be ok for me, but still fails in some URL's.

PS: No 600px error!


Solution

  • Your issue is that amp-iframe is missing from the pages where Google Map is not rendering.

    Add amp-iframe

    <script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js">
    </script>
    

    Also, your AMP pages are invalid. You can validate AMP pages here