iFrame elements load-time

sarfarazk130377

05-02-2019

Hi all

I have an iframe on a page which have 4 different div elements. I have to integrate the DTM in the iframe to get it track . The content of each div element is populated by different sources and take different time to get load.

So, the business question that I have to solve is how much time each div element takes to load in the iframe? For example, if the 4 div elements took 1 sec, 2 secs, 5 secs, 9 secs respectively to load, I have to extract these load times of individual div elements. I can see the load time of these div elements in the browser (Chrome) Network tab but don't know how to grab it.

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

Gigazelle

Employee

15-02-2019

You would want to implement DTM on the parent page, and use custom JS logic to determine load time for each. This page has some helpful variables to aid you in creating that JS logic:

Calculating Page Load Time In JavaScript - Stack Overflow

The second answer on that page in particular can help establish timestamps for certain assets, which you can then perform math on and ultimately obtain the load time for each frame.