domInteractive vs Time to Interactive - whats the difference?
Asked Answered
D

3

7

Google offers a number of polyfill libraries for measuring and tracking First Input Delay(FID) and Time to Interactive (TTI) on analytics platforms. However this metric does not come standard with GA.

domInteractive however is a metric you can track out of the box with GA.

What's the difference? The only explanation I've found for the competing interactive metrics is a vague forum post explaining that TTI may offer a more complex look at interactive delays, but without much in the way of details.

Am I better off tracking TTI on my users if I'm concerned about input delays affecting conversion, or am I fine to stick with domInteractive?

Duppy answered 21/1, 2019 at 19:38 Comment(2)
GA being google analyticsDuppy
Had to dig into the Spec but I think I found what I was looking for: The DOMContentLoaded event fires after the transition to "interactive" but before the transition to "complete", at the point where all subresources apart from async script elements have loaded. Basically domInteractive will not reflect async scripts that are still loading in, which is why your TTI metric can vary so widely.Duppy
C
3

My understanding is the following:

Time to Interactive (TTI) is when the website is visually usable and engaging. For example, when a user can click around on the UI and the website is functional. Ideally, we want all experiences to get interactive as soon as possible. Examples of websites with poor TTI are websites where a user can be actively engaged with the UI for a good amount of time before anything actually happens. Poor TTI is caused by too much (main thread) JavaScript which adversely causes delays for interactivity for visible UI elements. An example, of this is here. This is an especially important metric to consider for the mobile space since everyone doesn't have a nice phone (so it will take longer to parse the JavaScript needed to load a site) as well as the variance that occurs due to different network speeds: i.e. WI-FI, 3G, 4G

domInteractive however is when a page's primary content is visible and meaningful paints have occurred. At this stage a user can visually see the webpage and the corresponding UI elements that represent the site's DOM.

First Input Delay (FID) is the measurement of how long it took to respond to a user event. For example, how long did it take for a button's event handler to take over and respond once the user clicked the button.

As far as I know FID and TTI are experimental metrics right now so they probably wouldn't be baked into Google Analytics by default. As for your question: "Am I better off tracking TTI on my users if I'm concerned about input delays affecting conversion, or am I fine to stick with domInteractive?" You actually want to track FID if you're concerned with input delays affecting conversion. TTI is still a very useful metric to track since it measures when your site as a whole is interactive and both TTI and FID will provide more value than domInteractive.

If you're still interested check out this explanation on the Cost of JavaScript by Addy Osmani. He does a beautiful job explaining the performance issues we are facing with JavaScript as well as talking about TTI and FID.

Cheers

Caiman answered 31/1, 2019 at 15:4 Comment(0)
G
1

According to this link, domInteractive is "when the parser finished its work on the main document". Time to interactive - is time when all page scripts (including library e.g. Angular and yours) finished initialization, page is not freezen and user can start interacting with it.

Geese answered 31/1, 2019 at 14:55 Comment(1)
Thanks, that made me take another look at the spec to finally find my answer. domInteractive does not fully track loading async scripts, so if you have a lot of marketing tech, expect that metric to be off.Duppy
D
0

Had to dig into the Spec but I think I found what I was looking for:

The DOMContentLoaded event fires after the transition to "interactive" but before the transition to "complete", at the point where all subresources apart from async script elements have loaded.

Basically domInteractive will not reflect async scripts that are still loading in, which is why your TTI metric can vary so widely.

Duppy answered 1/2, 2019 at 20:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.