Installation FAQ
Frequently asked questions about installing Spara
Given this script is synchronous (no async
, defer
, etc), it can potentially slow down the rest of the site if it's moved to the head afaik? Our own Next.js renderer afaik doesn't put its JS scripts on our HTML head, other than preloads.
Why is the Spara Javascript snippet inserted into the <head>
tag?
Spara's JS snippet can be inserted anywhere in your HTML. There's no hard requirement for it to be in the <head>
tag. But <head>
is common place for adding 3rd party scripts and it generally makes instructions simpler for our customers to follow.
Why doesn't the Spara Javscript snippet come with async
, defer
, etc?
Spara's Javascript snippet actually just a bootloader script. It is extremely small (less than 1KB) and its main job is to append a larger script to the site after the page fully loads. Spara's embed system forces an async
tag on the larger script, removing the possibility for the implementer to potentially make a mistake and hurt your site's performance. You can absolutely async/defer
the embed script, but since Spara's subsequently loaded larger script already has async
, you will see minimal performance impact.
Last updated