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
- Open the template or layout that renders the <head> of every page.
- Paste the snippet directly after the opening <head> tag, before any other scripts.
- Deploy, then open any page. Install & data in your dashboard turns green within a few seconds.
Shopify
- In Shopify admin, go to Online Store → Themes, then … → Edit code on your live theme.
- Open
layout/theme.liquid. - 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
- Install a header-scripts plugin such as WPCode, or edit your theme's
header.php. - Add the snippet to the header section, as early as possible.
- 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.
- Create a Custom HTML tag containing the snippet.
- 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=1logs every decision in the browser console.?peekbird_qa=1runs experiments that are still in QA.?peekbird_force=experiment:variationforces a variation.?peekbird_record=1records your visit, whatever the sample rate.
Set any of them to 0 to turn it off. QA visits never count in results.