<head> section takes just a few minutes.
Step 1: Open Your HTML
Locate the HTML file that contains your site’s<head> section. This is typically:
index.htmlfor static sites- A layout or template file for frameworks
- Your theme’s header file for CMS platforms
Step 2: Add the Script
Copy the Pockla script:<head> tag:
Step 3: Save and Deploy
Save your changes and deploy to your live site.Verify Installation
Open your site in a browser and check that it’s working:- Open Developer Tools (F12 or right-click → Inspect)
- Go to the Network tab
- Reload the page
- Filter by “pockla”
- You should see
pockla.min.jsloading successfully
Framework-Specific Notes
Next.js / React
Next.js / React
For Next.js, add the script to your root layout:Or use
next/script with beforeInteractive strategy:Vue / Nuxt
Vue / Nuxt
For Nuxt 3, add to
nuxt.config.ts:Astro
Astro
Add to your layout’s
<head>:Static HTML
Static HTML
Simply add the script to every page’s
<head>, or to a shared header include file.Troubleshooting
Script not loading
Script not loading
- Check for typos in the script URL
- Ensure there are no JavaScript errors blocking execution
- Verify the script tag is inside
<head>, not<body>
Personalization not appearing
Personalization not appearing
- Confirm you’ve published personalization rules in Pockla
- Check that the visitor matches your targeting criteria
- Clear your browser cache and reload
Flash of unpersonalized content
Flash of unpersonalized content
- Move the script earlier in the
<head>(right after the opening tag) - Remove any
asyncordeferattributes - Ensure no other scripts are blocking Pockla from loading
Need Help?
Contact Support
Get help with installation