Alert sales when a company keeps viewing your pricing page
Counts pricing-page views by company in PostHog, sizes each company with Apollo, and posts it to Slack with its HubSpot owner.
Outcome
One Slack post for each company that viewed your pricing page often enough, with the count, the company facts and its HubSpot owner.
The list of those companies, with the ones that have no HubSpot record or owner.
How it works
PFind repeat visitors, by Run a SQL query by PostHog
Count
$pageviewevents whose$pathnameis exactlypricing_pathin the lastlookback_days, grouped by the domain of each identified person'semail, leaving out free email domains. Keep the domains with at leastmin_views, with their counts.
AEnrich, by Enrich a company by Apollo
For each domain, keep the company's name, employee count, industry and latest funding round.
HFind the owner, by Search CRM records by HubSpot
Search companies by
domain. Keep each company's record ID andhubspot_owner_id; note the domains with no record or no owner.
SAlert, by Post a message by Slack
Post one message per company to
alerts_channelwith the view count, the enrichment, the HubSpot record ID and the owner ID.
You'll be asked for
The page that signals intent
e.g. /pricing
How many views from one company count as intent
e.g. 2
The window to count in
e.g. 7
The Slack channel to post in
e.g. #sales-signals
high-intent-visitors.mdView markdown
Alert sales when a company keeps viewing your pricing page
Counts pricing-page views by company in PostHog, sizes each company with Apollo, and posts it to Slack with its HubSpot owner.
Set up the tools below, then run the steps in order for the user, carrying each step's results into the next. The run is done when the user has the outcome below.
Outcome
- One Slack post for each company that viewed your pricing page often enough, with the count, the company facts and its HubSpot owner.
- The list of those companies, with the ones that have no HubSpot record or owner.
Inputs
Ask the user for these before you start.
pricing_path: the page that signals intent, e.g. /pricingmin_views: how many views from one company count as intent, e.g. 2lookback_days: the window to count in, e.g. 7alerts_channel: the Slack channel to post in, e.g. #sales-signals
Set up
Run a SQL query (PostHog, tool:posthog/run-sql-query)
Use the first option your agent supports.
Note: Needs a personal API key with the query:read scope. Returns up to 100 rows by default and up to 50,000 with an explicit LIMIT; it is for ad-hoc analysis, not bulk export.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "posthog": { "url": "https://mcp.posthog.com/mcp" } } }
Call the MCP tool execute-sql.
CLI (official)
Install the command, then confirm it runs.
npm install -g @posthog/cli@latest
posthog-cli --version
Run posthog-cli api call execute-sql.
Set $POSTHOG_CLI_API_KEY in your environment first (get a key: https://app.posthog.com/settings/user-api-keys?preset=mcp_server).
Enrich a company (Apollo, tool:apollo/enrich-company)
Use the first option your agent supports.
Note: Costs 1 credit per company. To enrich up to 10 companies in one call, use bulk organization enrichment instead.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "apollo": { "url": "https://mcp.apollo.io/mcp" } } }
Call the MCP tool apollo_organizations_enrich.
CLI (official)
Install the command and sign in with it, then confirm it runs.
brew install apolloio/apollo-io-cli/apollo-io-cli
apollo --version
Run apollo companies enrich.
Search CRM records (HubSpot, tool:hubspot/search-crm-records)
Use the first option your agent supports.
Note: The MCP tool takes up to five groups of six filters and returns up to 200 records per page.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "hubspot": { "url": "https://mcp.hubspot.com" } } }
Call the MCP tool search_crm_objects.
API (official)
- Base URL: https://api.hubapi.com
- Endpoint:
POST /crm/objects/2026-09/{objectType}/search - Auth: send the header
Authorization: Bearer $HUBSPOT_API_KEY
Note: Use a service key or an app's static access token with the CRM scopes the calls need; paths carry a dated version such as 2026-09.
Post a message (Slack, tool:slack/post-message)
Use the first option your agent supports.
Note: Needs the chat:write scope. Over MCP it posts as the signed-in user; the API and CLI post as the app's bot.
MCP (official, remote)
Add this server to your agent's MCP settings, then sign in when asked.
{ "mcpServers": { "slack": { "url": "https://mcp.slack.com/mcp" } } }
Call the MCP tool slack_send_message.
CLI (official)
Install the command, then confirm it runs.
curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash
slack --version
Run slack api chat.postMessage.
Set $SLACK_BOT_TOKEN in your environment first (get a key: https://api.slack.com/apps).
Before step 1, confirm access to each service with its cheapest read-only call, like a list or a search. Never send or change anything to test access.
Steps
- Find repeat visitors with Run a SQL query (PostHog). Count
$pageviewevents whose$pathnameis exactlypricing_pathin the lastlookback_days, grouped by the domain of each identified person'semail, leaving out free email domains. Keep the domains with at leastmin_views, with their counts. - Enrich with Enrich a company (Apollo). For each domain, keep the company's name, employee count, industry and latest funding round.
- Find the owner with Search CRM records (HubSpot). Search companies by
domain. Keep each company's record ID andhubspot_owner_id; note the domains with no record or no owner. - Alert with Post a message (Slack). Post one message per company to
alerts_channelwith the view count, the enrichment, the HubSpot record ID and the owner ID.
Rules
- Use only the services set up above. The read-only calls they need, like listing ids or polling for results, are fine.
- Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
- Never print API keys.
