Page Speed Best Practice Guide
This guide explains best practices for making the Referral SaaSquatch widget load quickly without affecting other items on your page.
Keep it in the body. Place the
<script> tag examples that we provide right before the
</body> tag, or at the very least, keep
it out of the
<head> tag. This will make sure that the
squatch.js is the last script to execute, and won't delay other scripts on your page.
Dissecting our onload function
Let's tidy that up and give you some comments. Here's a line-by-line breakdown of what's going on: