Skip to content
Peekbird

Install the snippet

Your snippet is one line. Find it in your dashboard under your site's Install & data, where it has your site's own key:

<script src="https://cdn.peekbird.com/s/YOUR_SITE_KEY.js"></script>

Paste it as high as possible in the page's <head>, before other scripts, on every page. It loads synchronously on purpose: that's what stops visitors from seeing the original page flash before a variation applies. It holds only what your site uses (2–10 KB) and is served from a CDN.

Custom website

  1. Open the template or layout that renders the <head> of every page.
  2. Paste the snippet directly after the opening <head> tag, before any other scripts.
  3. Deploy, then open any page. Install & data in your dashboard turns green within a few seconds.

Shopify

  1. In Shopify admin, go to Online Store → Themes, then … → Edit code on your live theme.
  2. Open layout/theme.liquid.
  3. Paste the snippet right after <head> and save.

Shopify runs no store scripts on its checkout, so orders need one more step: a checkout pixel, in Purchases.

WordPress

  1. Install a header-scripts plugin such as WPCode, or edit your theme's header.php.
  2. Add the snippet to the header section, as early as possible.
  3. If you use a caching plugin, clear its cache so pages include the snippet.

React, Next.js and other single-page apps

Add the snippet as a plain script tag in the document head, not a deferred or lazy-loaded one:

// Next.js (app/layout.tsx)
<html>
  <head>
    <script src="https://cdn.peekbird.com/s/YOUR_SITE_KEY.js"></script>
  </head>
  <body>{children}</body>
</html>

Experiments apply on full page loads. Re-running them on client-side route changes is coming.

Google Tag Manager

Tag Manager loads after the page starts rendering, so visitors can see the original page flash before a variation applies: fine for tracking and recordings, not recommended for experiments.

  1. Create a Custom HTML tag containing the snippet.
  2. Trigger it on Initialization – All Pages and set its tag firing priority high.

Checking and previewing

Add these to any page address on your site:

  • ?peekbird_debug=1 logs every decision in the browser console.
  • ?peekbird_qa=1 runs experiments that are still in QA.
  • ?peekbird_force=experiment:variation forces a variation.
  • ?peekbird_record=1 records your visit, whatever the sample rate.

Set any of them to 0 to turn it off. QA visits never count in results.

See what your visitors see.

Start free in a few minutes: one snippet, every feature. Move to a bigger plan when you need more sessions.