Expand my Community achievements bar.

SOLVED

iFrame elements load-time

Avatar

Level 1

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

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.