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

Disclaimer

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

1 Like

 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

We’ve been advised by our SEO team to use inject over iframe, but I don’t know if the benefits are still true or if anything has changed on the end of SEO. We try to only use iframes when the chart doesn’t display on page load. However, because we often have to extend the height of our charts, a vertical scrollbar will show up with iframes. To get rid of them, we extend the height of the chart’s container on the web page itself.

1 Like

Hi,

Per our investigation, Google generally does not treat iframes any differently than scripts, and we’ve transitioned our chart examples to iframe. Maybe @Askill can shime in with something here.

We should be able to resolve your issue. If you set a specific height, we will adjust the iframe to use your height, thus obviating the scrollbar. Can you share an example with me?

Oh, and happy birthday!

1 Like

Thank you Martin!
Here’s an example of a chart being used live on a page. On the WordPress side, we’ve increased the height of the iframe as well as adjusting the height in everviz: What Saudi Arabians Want From Leisure, Entertainment Sectors

I don’t want to remove the height on the WordPress side just yet since the chart is live, but let me know when I can try it out.

Update to this: we learned recently that with the launch of our new content subscription platform, iframes will not be supported. So unfortunately, we won’t be able to use them as a workaround moving forward.

1 Like