-1

I want to integrate third party iframes into my site without affecting the PageSpeed score. Initially, they were being called with the initial call to the server. I moved them to load with the load event in js. But still the PageSpeed score is not improving. I tried async and defer as well but nothing seems to work. The site is created in WordPress.

I scanned through Google but most of the ideas seem to revolve around loading it later with the load event after everything has loaded. That I tried already. What else can I do to reduce the load of iframes? They are two widgets and both use Google Tag Manager tracking. So, in total 3 Google Analytics scripts are loading. That is increasing server response time multifold.

The site URL is https://iifd.in

If you run through PageSpeed Insights, the mobile score is suffering badly despite me loading the heavy scripts later with the load event in js.

Any help is appreciated, thanks!

1 Answers1

0

I checked your site with google page speed insight, few errors can be fixed easily.

Specifically

1.Does not use passive listeners to improve scrolling performance.

2.Image elements do not have explicit width and height.

Ray
  • 124
  • 7
  • Yes, I am in the process of code splitting at the moment as well. What I am concerned with is the Google Tag Manage blocking response time. It is being loaded from an iframe. Any solution for that? – Divjot Singh Aug 06 '21 at 18:30
  • Are you using any script to load google tag manager? If you are then try to use async for javascript. It can help you. I would suggest you read about it more before using it. – Ray Aug 19 '21 at 21:11
  • Google Tag Manager scripts are loading via third party in an iframe, that makes them impossible to optimize. I am loading iframe after the DOMContentLoaded event. Can't load them at 'load' event as the iframe loads a form in the header and needs to be loaded early. Turns out the TTFB is the main culprit. Server is taking too long to respond. I've recommended an upgrade to the owners of the website. – Divjot Singh Aug 20 '21 at 06:01