Install the tracking script
Add one line of code to your website to turn on ProjectHQ Analytics, Live Chat and visitor identification — with steps for WordPress, Shopify, Wix, Squarespace, Webflow, Next.js and Tag Manager.
One line of code connects your website to ProjectHQ. The same line runs Analytics, puts the Live Chat widget with your AI assistant on your site, and identifies returning visitors for Contacts. You install it once; it takes about two minutes.
Before you start
You need to be able to edit your website's <head> — in your site builder's settings, your CMS, your theme files or your code. If someone else manages your site, send them the line from step 2 together with this page.
Open the installation
In the menu, click Integrations, then Website Script.
You can also get here from the setup guide: the step Add the assistant to your site → Add it to my site walks you to the same place.
Install the script
The Install step takes you through four short steps:
- Where is your site built? Pick your platform: HTML, WordPress, Shopify, Wix, Squarespace, Webflow, Next.js or Tag Manager. The instructions below change to match.
- Copy this line. Click Copy. The line looks like this, with your own site ID:
Always copy it from ProjectHQ — the site ID is what ties your visits to your project.<script src="https://projecthq.pro/tracker.js?site=YOUR-SITE-ID"></script> - Paste it into your site, following the instructions for your platform (also listed below).
- We'll spot it by ourselves. Once the line is live, ProjectHQ notices within a minute and moves on. Don't want to wait? Click Check my site now.
Where to paste it, platform by platform
The instructions in the app show the same steps for the platform you pick:
| Platform | Where the line goes |
|---|---|
| HTML | Paste it just before the closing </head> tag, on every page. |
| WordPress | Go to Plugins → Add New and install the free WPCode plugin. Open Code Snippets → Header & Footer, paste the line into Header and click Save. |
| Shopify | Go to Online Store → Themes, click ⋯ next to your theme and choose Edit code. Open layout/theme.liquid, paste the line just before </head> and click Save. |
| Wix | Go to Settings → Custom code and click + Add Custom Code. Paste the line, choose All pages, place it in Head and click Apply. |
| Squarespace | Go to Settings → Developer tools → Code injection. Paste the line into Header and click Save. |
| Webflow | Open Site settings → Custom code. Paste the line into Head code, click Save, then Publish. |
| Next.js | Add the script to your root app/layout.tsx (example below) and deploy. |
| Tag Manager | Add a new tag of type Custom HTML and paste the line. Set the trigger to All Pages and click Submit to publish the container. |
For Next.js, ProjectHQ gives you a ready-made layout with your site ID filled in:
// app/layout.tsx
import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html>
<head>
<Script
src="https://projecthq.pro/tracker.js?site=YOUR-SITE-ID"
strategy="afterInteractive"
/>
</head>
<body>{children}</body>
</html>
)
}
Check that it works
After you publish the change, ProjectHQ goes through Detect Script — it opens your site and looks for the line — and then Receive Events, where it waits for the first visit. When both are green, you're done:
Back in Integrations, the Website Script card now says Active on … with your domains, and your visitors start appearing in Analytics.
If the script isn't found
ProjectHQ says We couldn't detect the script on any of your domains and lists the pages it checked. The usual reasons:
- The change isn't published yet. The line must be live on your public site, not just saved in a draft or on your computer.
- It's not in the
<head>. Move it inside the<head>section. - Your site adds it with JavaScript. Some apps and tag managers add the line after the page loads, so it isn't in the page source. That's fine — click Continue anyway and ProjectHQ confirms the install as soon as the first visit arrives.
Fixed it? Click Check again.
Using Google Tag Manager? If ProjectHQ finds the tag but warns that Tag Manager changes it, click Copy fixed snippet and replace your Custom HTML tag with that version.
Track more than one domain
ProjectHQ counts visits on the domains listed under Tracked Domains at the bottom of the Website Script panel. Your main domain and its www version are always included. If the same line runs somewhere else too — a shop on a subdomain, a second domain — type it into Add another domain… and press Enter.
Leave out your own visits
So your own browsing doesn't inflate your numbers, turn on Exclude my visits in the Website Script panel. It stops counting visits from the browser you're using and deletes the visits it already recorded from it. Do this on each browser and device you use.
What's next
- Read your analytics — what the numbers mean.
- Goals and funnels — count sign-ups, purchases and other conversions.
- Track events and identify visitors — send your own events and tell ProjectHQ who a visitor is.
- See AI and search crawlers — find out which bots read your site.