I need to optimize my website to PageSpeedInsight and I would like load an iframe only after click or when appear on the screen.
I have test many scripts but MapsAPI is always load when I test with Google PageSpeedInsight and the score is bad. Also, I can't update the iframe code.
Thanks
To only load an iframe when it appears on screen use loading="lazy".
<iframe src="https://example.com" loading="lazy"></iframe>
There's an article on web.dev with more detail.