Skip to main content
Adding the Pockla snippet to your website’s <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.html for static sites
  • A layout or template file for frameworks
  • Your theme’s header file for CMS platforms

Step 2: Add the Snippet

Copy the Pockla snippet:
Paste it at the very top of your <head> section:
The snippet must be the very first thing in your <head> to prevent a flash of unpersonalized content.

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 the snippet is present:
  1. Right-click the page and select View Page Source
  2. Search for pklid — you should see the Pockla snippet in the <head> section
The snippet only activates when a visitor arrives via a Pockla link, so it won’t make any network requests on a normal page load. To see it in action, send yourself a Pockla link and click through to your site.

Framework-Specific Notes

For Next.js, add the snippet to your root layout using dangerouslySetInnerHTML:
Or use next/script with beforeInteractive strategy:
For Nuxt 3, add to nuxt.config.ts:
Add to your layout’s <head>:
Simply add the snippet to every page’s <head>, or to a shared header include file.

Troubleshooting

  • Check for typos in the snippet
  • Ensure there are no JavaScript errors blocking execution
  • Verify the snippet is inside <head>, not <body>
  • Confirm the URL includes a valid pklid parameter
  • Confirm you’ve published personalization rules in Pockla
  • Check that the visitor matches your targeting criteria
  • Clear your browser cache and reload
  • Make sure the snippet is the very first thing in your <head>
  • Ensure no other scripts are blocking Pockla from loading

Need Help?

Contact Support

Get help with installation