---
ref: workflow:high-intent-visitors
title: Alert sales when a company keeps viewing your pricing page
author: thedogwiththedataonit
tools: [tool:posthog/run-sql-query, tool:apollo/enrich-company, tool:hubspot/search-crm-records, tool:slack/post-message]
tags: [capability:analyze-product-usage, capability:enrich-companies, capability:manage-crm, capability:route-alerts, channel:chat, channel:website, has:api, has:mcp, motion:inbound]
updated: 2026-09-29
---

# 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. /pricing
- `min_views`: how many views from one company count as intent, e.g. 2
- `lookback_days`: the window to count in, e.g. 7
- `alerts_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.

```json
{ "mcpServers": { "posthog": { "url": "https://mcp.posthog.com/mcp" } } }
```

Call the MCP tool `execute-sql`.

#### CLI (official)

Install the command, then confirm it runs.

```sh
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.

```json
{ "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.

```sh
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.

```json
{ "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.

```json
{ "mcpServers": { "slack": { "url": "https://mcp.slack.com/mcp" } } }
```

Call the MCP tool `slack_send_message`.

#### CLI (official)

Install the command, then confirm it runs.

```sh
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

1. **Find repeat visitors** with Run a SQL query (PostHog). Count `$pageview` events whose `$pathname` is exactly `pricing_path` in the last `lookback_days`, grouped by the domain of each identified person's `email`, leaving out free email domains. Keep the domains with at least `min_views`, with their counts.
2. **Enrich** with Enrich a company (Apollo). For each domain, keep the company's name, employee count, industry and latest funding round.
3. **Find the owner** with Search CRM records (HubSpot). Search companies by `domain`. Keep each company's record ID and `hubspot_owner_id`; note the domains with no record or no owner.
4. **Alert** with Post a message (Slack). Post one message per company to `alerts_channel` with 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.
