Script impact on your website
Adding any third-party script will impact your website’s performance to some extent. The Lyftio script is no exception—it needs to load, execute, and apply changes to your page.
However, with the right implementation, this impact can be minimized while still ensuring a smooth user experience.
Why script loading matters
The Lyftio script is responsible for:
- Assigning visitors to experiments
- Applying variation changes
- Tracking user behavior
To avoid visual inconsistencies (such as flickering), the script should execute as early as possible in the page lifecycle.
Synchronous vs Asynchronous loading
Synchronous loading (default)
By default, the Lyftio script loads synchronously.
This means:
- The browser pauses HTML parsing while the script loads
- The script is prioritized early in the page load
- Variations are applied before content is rendered
✅ Benefit: Minimizes flickering (flash of original content)
⚠️ Tradeoff: Can block other resources temporarily
Asynchronous loading
You can load the script asynchronously by adding the async attribute:
<script type="text/javascript" async src="https://cdn.lyftio.com/XXXXXX/dist/bundle.js"></script>
This means:
The script loads in the background The page continues rendering without waiting
✅ Benefit: Improves overall page loading performance
⚠️ Tradeoff: Increased risk of flickering, since the script is not as prioritized
Content Delivery Network (CDN)
The Lyftio script is delivered via a global CDN (AWS CloudFront).
This ensures:
- Faster loading times worldwide
- Reduced latency based on user location
- Reliable and scalable delivery
By serving the script from geographically distributed servers, users receive it from the nearest available location.
Script execution
Once the script has loaded, it executes the following steps:
- Retrieves all active experiments
- Evaluates each experiment’s audience conditions
- Determines if the visitor qualifies
- Assigns the visitor to a variation
- Applies the corresponding changes to the page
Performance impact of variations
The performance impact after execution depends on how your variations are built.
Low impact:
- Visual Editor changes (text, styles, layout)
Higher impact:
- Custom JavaScript
- Complex DOM manipulations
In general, lightweight visual changes have minimal impact, while advanced scripting increases execution time.
Perceived vs measured performance
In most cases, visitors will not notice any performance difference.
However, performance tools may report:
- Slightly increased load times
- Additional script execution time
This is expected, as the script both loads and modifies the page dynamically.
Best practices
To balance performance and user experience:
- Place the script as early as possible (preferably in
<head>) - Use synchronous loading if minimizing flicker is critical
- Use asynchronous loading if performance is prioritized
- Keep variation logic lightweight when possible
Summary
The Lyftio script introduces a small performance overhead, but:
- Early loading minimizes visual flicker
- CDN delivery ensures fast global access
- Efficient implementation keeps impact low
With proper setup, you can run experiments without negatively affecting the user experience.