> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pockla.io/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript Snippet

> Add personalization to your website with a single script

The Pockla snippet enables personalized content on your website. When a visitor arrives via a Pockla link, the snippet detects it and loads their personalized experience.

## The Snippet

```html theme={null}
<script>var p=new URLSearchParams(location.search).get('pklid');if(p)document.write('<script src="https://embed.pockla.io/'+p+'.js"><\/script>');</script>
```

That's it. Just one line that should be added at the very top of the `<head>` section.

## How It Works

1. A visitor clicks a Pockla link (which includes a `pklid` parameter in the URL)
2. The snippet reads the `pklid` from the URL
3. It loads a personalized script from `embed.pockla.io` for that visitor
4. The page content is personalized before the visitor sees it

If no `pklid` parameter is present, the snippet does nothing — zero overhead for regular visitors.

## Platform-Specific Instructions

<CardGroup cols={2}>
  <Card title="Standard HTML" icon="code" href="/integrations/js-snippet/standard">
    Any website with HTML access
  </Card>

  <Card title="Shopify" icon="shopify" href="/integrations/js-snippet/shopify">
    Shopify stores
  </Card>

  <Card title="Webflow" icon="webflow" href="/integrations/js-snippet/webflow">
    Webflow sites
  </Card>

  <Card title="WordPress" icon="wordpress" href="/integrations/js-snippet/wordpress">
    WordPress sites
  </Card>
</CardGroup>

## Verifying Installation

After adding the snippet:

1. Open your website in a browser
2. Right-click the page and select **View Page Source**
3. 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.

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="Will this slow down my site?">
    No. The inline snippet is tiny and only loads an external script when a `pklid` parameter is present. Regular visitors without a Pockla link see zero additional network requests.
  </Accordion>

  <Accordion title="Is my data safe?">
    Yes. Pockla is designed with security and privacy in mind. The snippet only loads personalization for visitors who arrive via your Pockla links.
  </Accordion>

  <Accordion title="Can I use Google Tag Manager?">
    We don't recommend GTM for Pockla. GTM loads scripts with a delay, which can cause a flash of unpersonalized content. Install the snippet directly in your `<head>` for the best experience.
  </Accordion>

  <Accordion title="Can I remove the snippet later?">
    Yes. Simply delete the snippet from your site and personalization stops immediately.
  </Accordion>
</AccordionGroup>

## Need Help?

If you run into issues during installation, contact our support team.

<Card title="Contact Support" icon="headset" href="mailto:support@pockla.io">
  Get help with installation
</Card>
