When to execute your Core Web Vitals tracker?

Summary: When should a third party actually execute their JavaScript? Right away or later in time? We leave that up to you!

When to execute your Core Web Vitals tracker?

You might wonder why we aren't deciding this for you. Here are two main reasons:

  • no website is the same. Even some of your own sites might be faster than your other sites. Throw in the impact of your audience and their conditions, and it will become unpredictable;
  • our user base varies quite a bit. Some will embed our pagespeed monitoring snippet using GTM, others might want to have more control.

Inline JavaScript snippet

And although our monitoring helps picking up issues and showing them to website owners, we're actually a third party as well. Adding yet another JavaScript file to the mix.

Most third parties offer an inline snippet to load their JavaScript. Just like RUMvision. But we then also allow users to change the loading behaviour on the fly. Without ever needing to change the inline snippet. How convenient is that?

However, this still means that the code has to be:

  • downloaded
    But being an inline snippet, the JavaScript is embedded in an asynchronous way by default.
    So it's not render blocking (unless a site would have a lot of other JavaScript going on in the head as well, but that's quite a detailed nuance);
  • compiled and parsed
    Truth to be told, this is main thread blocking already.
  • and then executed
    This part can be mitigated from the outside using our snippet configurator.

When to execute

Let me explain the last part: at RUMvision, we allow website owners to select when the RUMvision JavaScript should start tracking. Or in other words: when the JavaScript should actually be executed. And I think that's a good, transparent and performant method of keeping website owners in control.

Want to see the source code? Go check it out on my personal website:

When to download and parse

If you want to change the first two phases, you actually have to make adjustments for yourselves. In practice, people rarily ever change a third party snippet after installing it (which is another reason we added an extra layer of control via our snippet configuration).

Your options are to:

  • inline the snippet manually;
  • implement it using a plugin (which might do the inlining for you);
  • use a (Adobe or Google) Tag Manager.

The latter will give you options as well as to when to execute it. Read our knowledge base to get implementation best practices.

Share blog post