Wix only runs custom code on a published site with a connected domain, which needs a Wix Premium plan. If you change your domain later, Wix removes your custom code, so add the snippet again.
async, defer or type="module": pagent needs to load before your page shows, so visitors never see the original flash.
Add the snippet with Custom Code
1
Open Custom Code
In your site dashboard, go to Settings. Under Development & integrations, click Custom Code. On some sites this section is called Advanced.
2
Add your snippet
Click + Add Custom Code and paste your snippet. Give it a name, for example
pagent.3
Choose where it runs
Under Add Code to Pages, choose All pages and let it load on each new page.
4
Place it in the head
Under Place Code in, choose Head.
5
Apply
Click Apply. Custom code runs on your live site, not in the Wix editor or preview.
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.