The snippet is a line of code that you implement on your site to run Convert Experiences. It contains information about your experiments and various account settings.
However, sometimes, after Convert has been used for a long time, the Convert snippet size might become big and this might have an impact on the page load as it is downloaded, and it is time to do some house cleaning.
Here are our recommendations on how to improve the script load times.
Size of the Snippet
If you think about what the snippet loads, is the experience conditions (Site Area, Audiences, Goals), and experiment code (Variation Code, Custom CSS, Custom JS). So every time you create one and activate, it loads more overhead to the snippet.
If you want to see the size of the snippet, you could open Chrome Developer tools on the needed page, switch to the Network tab and reload page. In the Size column you will see the size of everything loaded (Documents, Stylesheets, Images, Scripts, ...). You can enable filter to help you find out only needed stuff at the bottom-center of Developer tools frame.
Search for the tracking code script in the Network tab:
Convert's tracking script will add approximately 450ms extra loading time to the webpages where it is installed on first load. Subsequent loads should be cached either at browser level or at CDN edge level.
Archive all experiments that are not in use. All the experiments that are on the following statuses, are downloaded with the snippet:
Move the unused ones to "Archived" status.
FYI, the execution of the variation code included in an experiment will only affect the pages included in the Site Area conditions.
Reduce the number of goals being used to the minimum needed. Even if goals are not attached to an experiment will still be downloaded with the snippet.
Clean Variation Code
Clean and maintain your variation code in the "Code Editor" area to the minimum. Remove duplicate lines if present. This is a very common issue when using the visual editor. And this can really bloat the snippet.
Don't include jQuery in project code
By default, Convert Experiences includes a trimmed version of jQuery in the snippet. If your site already loads jQuery, remove this from the snippet to reduce its size. If your site doesn't load jQuery, however, this option won't work.
Match the order of your variation code and your site code
In Convert Experiences, if the first line of variation code modifies an element at the bottom of the page, the code won't begin to execute until that element loads. So, know what each change is; don't change the footer first, then the header. To make changes as quickly as possible, reorder your variation code such that the elements highest in the HTML structure are changed first, and elements lowest in the HTML structure are changed last.
In addition, if you have many visual changes in your variation code, consider moving them to Experiment Custom CSS area.