Site builders

Where to paste the script on Shopify, WordPress, Wix, Webflow, Squarespace, Framer and others.

Every site builder has a box for code that goes in the page’s head. Paste the script from Web pages there, with your public key and project slug, and page views arrive. Clicks and forms follow from data-event attributes, as on any page.

<script async src="https://api.snekot.co/snekot.js"></script>
<script>
  window.snekotq = window.snekotq || [];
  window.snekot = window.snekot || ((...args) => window.snekotq.push(args));
  window.snekot('setConfig', 'YOUR_PUBLIC_KEY', 'your-project');
</script>

Where it goes

Builder Where to paste Needs
Shopify Online Store, the ”…” beside your theme, Edit code, then theme.liquid, before </head> Any plan. Covers the storefront, not the checkout: see below
WordPress A header-snippet plugin, or your theme’s header Self-hosted: nothing. WordPress.com: a plan that allows plugins
Wix Settings, Custom Code, Add Custom Code, place in Head, on all pages A connected domain
Webflow Site settings, Custom code, Head code, then publish A paid Workspace or Site plan
Squarespace Settings, Website Tools, Code Injection, Header Core plan or higher
Framer Site Settings, Code, start of head A paid plan
Ghost Settings, Advanced, Code Injection, Site Header
Carrd Add an Embed element, type Code, style Hidden, location Head Pro Standard or higher
Bubble Settings, SEO / metatags, Script in header
Kajabi Settings, Site Details, Page Scripts, Header Checkout pages have their own field
Podia Settings, Analytics, Third-party code

After pasting, open your site in a private window and watch the visit arrive under Views.

If the builder shows a preview of your site on an address of its own, those visits count too. To leave them out, list your real domain under Setup, Allowed senders.

Shopify: the checkout and orders

Shopify runs its checkout apart from your theme, so the script above does not see it. A custom pixel does. In your Shopify admin open Settings, Customer events, Add custom pixel, paste this with your public key and slug, save, and press Connect:

const KEY = 'YOUR_PUBLIC_KEY';
const PROJECT = 'your-project';
const post = (path, body) =>
  fetch('https://api.snekot.co' + path, {
    method: 'POST',
    keepalive: true,
    headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + KEY },
    body: JSON.stringify({ ...body, project: PROJECT }),
  }).catch(() => {});

analytics.subscribe('checkout_started', () => {
  post('/v1/log', { channel: 'orders', event: 'Checkout started', icon: '🛒' });
});

analytics.subscribe('checkout_completed', (event) => {
  const checkout = event.data.checkout;
  post('/v1/log', {
    channel: 'orders',
    event: 'Order placed',
    icon: '📦',
    notify: true,
    tags: { total: Number(checkout.totalPrice?.amount) || 0, currency: checkout.currencyCode || '' },
  });
});

Two things to know:

  • A pixel runs only for visitors who have allowed what the pixel is set to need, under its Customer privacy setting. That is Shopify’s rule and yours to set.
  • Keep the script tag in the theme for page views and this pixel for the checkout. The pixel sends no page views, so nothing is counted twice.

Orders from other shops

WooCommerce can call Snekot itself when an order is paid, with no code: see Connections. On Squarespace, the Order confirmation page has its own Code Injection box, where the script tag counts the page as a view of a finished order.