Troubleshooting SPA Edge Cases with Convert Tracking Script: Performance Tips for Seamless Experiment Execution
THIS ARTICLE WILL HELP YOU:
- Get an overview of the edge cases in SPA
- Understand common SPA issues and solutions
- Know when to use these configs
- Get the implementation location
Purpose of This Guide
This document provides advanced configuration tips for handling edge cases in Single Page Applications (SPAs) when using the Convert tracking script. These solutions are only needed if you encounter specific performance issues with SPAs. The tracking script works seamlessly in most scenarios without these adjustments.
Common SPA Issues and Solutions
-
SPA Mutating Navigation Links on Click
- Issue: When navigation links are modified by a variation and subsequently trigger DOM mutations upon clicking, the navigation may appear broken or unresponsive.
- Solution: Introduce a delay in continuous activation to allow the navigation changes to stabilize before applying further updates.
_conv_q.push({
what: 'setParameters',
params: {
delayContinuousActivation: 100 // milliseconds
}
});
-
SPA Constantly Mutating the DOM
- Issue: In cases where the SPA produces constant, unnecessary DOM mutations, the tracking script may react too frequently. This could degrade performance, clutter the page, or even cause the page to freeze.
- Solution: Throttle the frequency of continuous activation to prevent excessive updates.
_conv_q.push({
what: 'setParameters',
params: {
throttleChanges: 100 // milliseconds
}
});
When to Use These Configurations
These solutions are meant for troubleshooting SPA-specific performance issues such as:
- Broken navigation links.
- Poor page performance, clutter, or freezing due to excessive DOM mutations.
Avoid applying these configurations unless you are encountering these specific problems. The Convert tracking script is optimized for SPAs and generally does not require additional setup.
Implementation Location
If needed, add the configurations to the Global JavaScript section of your Convert Project Configuration. Ensure they are tested thoroughly in a staging environment before deploying to production.