Iframe VS. inject code

  1. What are the load time differences between iframes vs. inject codes?

  2. What are the SEO implications of using an iframe vs. inject codes?

  3. Generally, do browsers/does Google prefer iframes or inject codes?

  4. Mobile display/load time implications of each

  5. Anything else I’m not aware of / thinking about


This thread is extracted from our email support prior to launching this forum.

 1) We could do with some emperical data on this, but both are very reasobly unless you include many graphs. We lazy load the visualization, but some processing is done on page load. This can be improved, but we don’t have any timelines. Inject is generally faster in my experience, but not significant unless you’re loading on the order of 10 charts.

 2, 3) Our working hypothesis until now is that SEO is better for inject, however, we are doing some internal experiments on whether this is correct. The Iframe is linked to more rich data, which is used by some.

 4) The only difference here is the speed alluded to in (1), and the fact that Iframes are currently not responsive.

 5a) If using inject codes, we are aware of the odd chart failing to load when loading many charts are loaded. Our recommendation in that case is to switch out the chart that fails to load with an Iframe.

 5b) Iframes are more secure and isolated by default. None of them know anything about the page they’re hosted on, except if they are communicating with the host page through some messaging.

 5c) Some publishing platforms do not support scripts at all. In that case, an Iframe can be loaded with a script that makes it dynamic, which is run if the vendor supports it.

1 Like