async, defer or type="module": pagent needs to load before your page shows, so visitors never see the original flash.
Add the snippet as custom code
1
Open the code settings
Open Site Settings → Code. On older projects, it’s under Site Settings → General → Custom Code.
2
Add your snippet
Add a new code entry and paste your snippet.
3
Place it at the start of the head
Set the placement to Start of
<head>, run it on all pages, and once per page.4
Publish
Save and publish your site. Framer doesn’t run custom code on the canvas or in the preview, only on the published site.
Check it worked
- Open your site in a private browser window, so no cached version shows.
- Back in pagent, click Check connection in the install step. If you’ve finished setup already, open Settings → Setup: it shows You are ready once pagent has received visits from your site.
- pagent loads your live site and looks for the snippet. When it finds it, you can start your first test.