Connect PostHog to see website visitors and leads
Connect your own PostHog project and see, on each website's Traffic tab, how many people visit, where they come from, and which of them become leads.
If your website runs PostHog, TrustPager can show you its visitor numbers right next to your leads. You see who visited, where they came from, and which visitors turned into leads and opportunities. Access is read-only, so TrustPager never changes anything in your PostHog project.
Connect PostHog
Open https://app.trustpager.com/auto/integrations, find PostHog under Available and click Connect. PostHog asks you to pick the project your website uses and approve read-only access. Once it is connected, PostHog moves to the Connected tab and every website in your workspace can show a PostHog card.
If neither Google nor PostHog is connected, the Traffic tab shows one line with Connect Google, and a link to connect PostHog in Integrations instead.
Visitor tracking costs extra, PostHog does not
Visitor tracking is TrustPager's own counting of visits and page views, and it also finds broken links. It is a paid extra: $5 a month in credits per website (5,000 credits; 1,000 credits = $1). Open your website from https://app.trustpager.com/growth/websites?tab=live, go to the Traffic tab and find the Website health card. Click Turn on next to Visitor tracking. Turning it on takes the rest of the current month (pro-rated) straight away, then 5,000 credits on the 1st of each month. If a month cannot be paid, tracking switches off, and turning it back on needs the credits first. Your own tracking (Google Analytics, PostHog and so on) is unaffected and free.
After turning it on, TrustPager shows a code step. Click Copy code, add the code to your website, then click Check again. Websites TrustPager builds and hosts can have it added for you. Click Turn off any time to stop it.
Website health on the Traffic tab
The Website health card sits at the bottom of the Traffic tab. Its corner says "N to fix" when something needs attention, or "Healthy". It covers three things:
- Bot Protection. Click Set up, or Manage if it is already set up. See https://trustpager.com/help-center/website-bot-protection.
- Visitor tracking. Turn on or Turn off, as above.
- Broken links. Found only while visitor tracking is on, because they are spotted when real visitors hit them.
Broken links come in two kinds:
- Pages that are gone. The page does not exist (a 404). Fix the link that points to it, or add a redirect so people land on the right page.
- Pages that did not answer. The page exists but your website or hosting failed to respond. Check the page, and talk to your host if it keeps failing. A redirect will not help here.
Redirects and pages missing from your sitemap are listed under Other findings. These are not problems, just things worth knowing.
Where to find it
- Open your website from https://app.trustpager.com/growth/websites?tab=live.
- Go to the Traffic tab.
- Look at the Website performance card. With PostHog connected it shows your PostHog numbers.
If Google Analytics or TrustPager's visitor tracking is connected too, they share the same card, with a switch in its top right corner to pick which one to read. For Google Analytics, see https://trustpager.com/help-center/connect-google-analytics-website-traffic.
The bar at the top of the tab shows the dates being read with Last 30 days under them. Click it to choose Last 7 days, Last 30 days, Last 90 days or Last 6 months. It applies to the whole tab and is remembered on that device.
What the card shows
Headline numbers. Visitors, Visits, Page views, Average visit and Bounce rate. Each one shows the change compared with the period before. Green means better and red means worse. For bounce rate, going up is worse, so a rise shows in red.
Visitors per day. A chart with one point for each day. Hover over it to see that day.
Top pages. The five most visited pages, each with a bar showing its share. Click View all to see the rest.
Visitors to leads. How many visitors became leads, and the rate. You can switch the view:
- By source: for example Google ad, Meta ad, Google search, Referral (site.com) or Direct.
- By campaign: the utm_campaign tag on your ad links.
Each lead is counted under the source of their first visit in the period, the same way visitors are counted. That keeps the rate fair.
Other views. Under Top pages, click Channel, Campaign, Entry page, Referrer, Country or Device to break your visitors down that way. Page and Entry page rows also show a bounce rate and two small icons. They open that page's recordings and heatmap in PostHog.
Open in PostHog. A link to jump into PostHog for the full detail.
Domains counted
"Domains counted" says which domains count as this website. By default that is the website's own domain (with and without www) and its deployed address.
Change it when the site is served on other domains, or when one PostHog project covers several sites. Type the domains separated by commas. It saves when you click away. Clear the box to go back to the default.
How leads are counted
A lead counts when the visitor came through a TrustPager form, booking page or live chat on your site, and the site runs PostHog. Archived opportunities are not counted.
Use the website embed code
Forms and booking pages need the website embed code so TrustPager knows which visitor sent them. Copy it from any of these places:
- The form builder, under "Embed on your website".
- A booking page's settings, under "Embed on your website".
- The "Customize embed" window, under "Embed code".
It looks like this:
<div data-trustpager-embed="form/<company>/<form-slug>"></div> <script src="https://app.trustpager.com/embed.js" async></script>
Paste it where the form or calendar should appear. It sizes itself to fit, and it passes on the ad the visitor came from, the page they are on and their PostHog visitor id. If your site still uses the older iframe code, it keeps working, but swap it for the new code to see sources and website journeys.
Live chat leads
The live chat widget does this by itself, with no code change. When a visitor arrives from an ad, the chat remembers the ad tags for that browser tab, even if they open the chat a few pages later. The lead it creates carries the source and campaign, and counts in "Visitors to leads".
Website journey on each opportunity
On an opportunity, look for the small i icon next to Lead Source. Hover over it (or tap it on a phone) to open the website journey:
- Where the lead came from: the source (such as Meta ad or Google search), the campaign, the page they landed on and the site that referred them.
- With PostHog connected: every page they viewed before they enquired, in order and grouped by visit, with links to their recordings in PostHog.
The source shows even without PostHog, from what was saved with the enquiry. With PostHog, the visitor's first visit sets the source, because that is where the ad click lands. The icon only appears when there is something to show.
Good to know
The numbers are PostHog's own web analytics numbers, read live each time you open the card. TrustPager does not store them.
If something looks wrong
- No visitors at all: check "Domains counted" matches the domains your site is actually served on.
- Visitors but no leads: check your forms and booking pages use the website embed code above, and that the site runs PostHog.
- A lead with no website journey: it came in another way (a phone call, an email, or the older iframe code).
- No PostHog numbers: connect PostHog at https://app.trustpager.com/auto/integrations.
Using it from your AI agent
Your AI agent can read the same numbers through the API and MCP:
- get_opportunity_website_journey: one lead's source and the pages they viewed.
- get_website_posthog_traffic: the headline numbers, a daily list of visitors and page views, plus one breakdown.
- get_website_lead_conversion: visitors to leads by source and campaign, plus the leads themselves.
- update_website_posthog_link: set the domains counted. Send none to go back to the default.
Each one answers with a status: ok, no_data, not_linked or not_connected. Exact field names are at https://docs.trustpager.com/reference#websites.