Skip to content

Agent-assisted setup

Install PageFox with your coding agent

Seven platforms · one verified script

Give your coding agent the complete instruction

Copy these instructions into the coding agent working on your website. Review the proposed change, replace the placeholder with your PageFox website ID, and deploy it through your normal workflow.

Install PageFox in this website's existing codebase.

Use this script, replacing your-website-id with the PageFox website ID I provide:
<script defer src="https://pagefox.co/widget.js" data-website-id="your-website-id"></script>

Choose the matching framework guidance below. Make the smallest safe change, keep the script site-wide, and do not expose secrets or invent a PageFox API key.

HTML / Custom: Your shared HTML template; Immediately before the closing body tag. Paste the PageFox script tag once in the shared template used by every page. Caveats: Publish the changed template before checking whether PageFox is detected.
Next.js: app/layout.tsx; Inside the root layout body. Import Script from next/script. Render the PageFox script in app/layout.tsx with strategy="afterInteractive" and preserve the data-website-id attribute. Caveats: Do not place it in a client component that can unmount during navigation.
WordPress: A child theme or header/footer injection plugin; Footer, immediately before the closing body tag. Add the PageFox script through a child theme or a reputable header/footer injection plugin. Caveats: Editing a parent theme functions.php or footer.php can be overwritten by a theme update.
Webflow: Project Settings → Custom Code; Footer Code. Paste the PageFox script in Footer Code. Caveats: Republish the Webflow site before checking installation.
Squarespace: Settings → Advanced → Code Injection; Footer. Paste the PageFox script into the Footer field and save. Caveats: Publish the site before checking installation. Code Injection availability depends on the Squarespace plan.
Shopify: Online Store → Themes → Edit code → layout/theme.liquid; Immediately before the closing body tag. Paste the PageFox script once in theme.liquid and save the theme. Caveats: Shopify checkout pages are not editable on plans below Shopify Plus.
Google Tag Manager: A Custom HTML tag; All Pages trigger. Paste the complete PageFox script tag verbatim into a Custom HTML tag and attach an All Pages trigger. Caveats: GTM injects the tag, so document.currentScript behaves differently from a normally parsed script; keep the data-website-id attribute on the script itself. Respect the site consent-mode policy and defer the tag when consent requires it.

After editing, tell me which file changed and what I must publish or deploy. For PageFox's public machine-readable install guide, see https://pagefox.co/llms.txt.

Supported placement guidance

HTML / Custom

Your shared HTML template

Immediately before the closing body tag

Next.js

app/layout.tsx

Inside the root layout body

WordPress

A child theme or header/footer injection plugin

Footer, immediately before the closing body tag

Webflow

Project Settings → Custom Code

Footer Code

Squarespace

Settings → Advanced → Code Injection

Footer

Shopify

Online Store → Themes → Edit code → layout/theme.liquid

Immediately before the closing body tag

Google Tag Manager

A Custom HTML tag

All Pages trigger

Create your PageFox website ID

Start with a free workspace, add your website, then replace the placeholder ID in the prompt.

Start Free