Skip to content

[$250] [Web] Convert script is loaded in sync #62324

Description

@kacper-mikolajczak

Source: https://expensify.slack.com/archives/C05LX9D6E07/p1747125118455899

Problem

The web application exhibits a delayed initial load time under Fast 4G network conditions. One contributing factor is the synchronous loading of the A/B testing script from Convert (cdn-4.convertexperiments.com/v1/js/10042537-100413459.js). Because this script is loaded synchronously in index.html, it blocks the browser from downloading other vital bundle scripts in parallel until the script is fully loaded and executed (source):

<% if (htmlWebpackPlugin.options.isWeb && (htmlWebpackPlugin.options.isStaging || htmlWebpackPlugin.options.isProduction)) { %>
    <!-- begin Convert Experiences code-->
    <script type="text/javascript" src="cdn-4.convertexperiments.com/v1/js/10042537-100413459.js"></script>
    <!-- end Convert Experiences code -->
<% } %>

This behavior negatively impacts metrics such as Largest Contentful Paint (LCP), which is critical for user-perceived performance.

Image

Proposed Solution

To mitigate this issue, we can add the async attribute to the script tag. This allows the script to be fetched in parallel without blocking the parser. Once the script is ready, it will pause parsing to execute. It will serve as a compromise in scenario of loading tools that need to be ready before page is fully loaded.

Expected Outcome

Applying async is expected to reduce the time spent waiting for the Convert script to load, which in turn should improve LCP and overall initial page load performance.
In our tests, the LCP was reduced by several hundred milliseconds under Fast 4G conditions after applying this change.

Image

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021924950238412860174
  • Upwork Job ID: 1924950238412860174
  • Last Price Increase: 2025-09-26
Issue OwnerCurrent Issue Owner: @kacper-mikolajczak

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2ReviewingHas a PR in review

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions