PostHog MCP for marketers: funnels, UTMs and campaign questions
PostHog’s Model Context Protocol (MCP) server lets a marketer ask an AI assistant to inspect traffic, investigate a funnel and connect campaign activity to product behaviour. The value comes from asking a question with a defined outcome and checking the data behind the answer. A connection cannot recover campaign information you never collected or turn attributed conversions into proof that an ad caused a sale.
On this page
Which marketing question should you start with?
Start with a marketing decision whose inputs and outcome you can verify. Which landing pages lose visitors before signup? Are campaign parameters surviving the redirect to the product? Which acquisition cohort reaches the first meaningful product outcome?
Write the question in terms of a decision. A growth manager deciding whether to increase a campaign budget needs acquisition cost and customer quality. A product marketer reviewing a new page needs to know whether eligible visitors understand the offer and complete the intended next step. Compare official MCP servers for ad and CRM tools when that decision requires evidence beyond PostHog.
Agree on the unit before asking the assistant. Sessions, people, workspaces and purchases describe different things. If several people can join one paying workspace, counting successful people as new customers can overstate acquisition.
Use the customer journey guide when the team cannot agree which progression matters. Once the journey is clear, MCP can make investigating it easier.
If campaign context disappears between the website, signup and product, our product analytics implementation work can help map and verify that journey. You can also use the tracking-plan guide to define the events and fields with your own team before changing tools.
How do you connect PostHog MCP?
Use PostHog's hosted endpoint and authenticate with the account that can access the intended project.
The endpoint is https://mcp.posthog.com/mcp. Authentication routes the connection to the account's US or EU region. The MCP overview provides the supported client options and the installer:
npx @posthog/wizard mcp addChoose the intended client in the wizard and follow authentication. This installs the MCP connection. Check your existing analytics collection separately; a connector setup is not evidence that the site's events are arriving.
For a manual Claude Code connection, PostHog documents:
claude mcp add --transport http posthog https://mcp.posthog.com/mcp -s userThen open /mcp in Claude Code and complete the browser sign-in. See the Claude Code setup page.
Start by asking the assistant to identify the active organisation and project. Select a known insight, retrieve its definition and compare its result with the PostHog interface. This gives you a baseline before introducing new event mappings or attribution rules.
If the baseline differs, resolve the project, time range, timezone, filters and data freshness first. Rephrasing the business question will not repair a query pointed at the wrong project.
Use PostHog MCP for product behaviour, feature flags and experiments. Vercel MCP connects at https://mcp.vercel.com using OAuth for projects, deployments and logs; it also exposes Web Analytics. Its deployment tools can create or cancel deployments when the connection has the required access. A team hosting on Vercel can use both to relate an observed funnel change to a release. Scope each connection separately and inspect its available operations before granting writes.
How do you restrict the project and available actions?
Pin the intended project and expose only the operations needed for the job. The advanced setup guide defines these independent controls.
| Control | What it changes | Check after connecting |
|---|---|---|
readonly=true | Excludes create, update and delete tools | The available operations suit an analysis-only job |
project_id=12345 | Pins context and removes project/organisation switching tools | A known insight belongs to the intended project |
mode=cli or mode=tools | Uses exec discovery or individually registered tools | A short initial catalog is expected in command-line interface (CLI) mode |
features and tools | Combined filters form a union: either match exposes a tool | Inspect the final list; a named-tool filter does not narrow a feature group |
Replace the example project ID before adding this URL to your client's settings:
https://mcp.posthog.com/mcp?readonly=true&project_id=12345Most clients default to CLI mode, including Claude Code and Codex; Cursor defaults to tools mode. One connection has one active account, organisation and project. Use distinct, pinned connections for regular work across projects.
The MCP limits are 480 requests/minute and 4,800/hour per credential, including session setup and discovery. A 429 response supplies Retry-After; underlying application programming interface (API) limits can also apply. Reuse the connection and respect that delay rather than repeatedly reconnecting.
Keep the underlying account permissions appropriate. Check the actual project and available operations before returning individual profiles or requesting any saved-content change. A configuration string is useful only when the resulting access matches the intended job.
Which tools do you need for a campaign investigation?
Use schema discovery and a known saved insight before writing a new query. The current tool reference includes read-data-schema for discovery, insight-query for a saved insight, query-funnel for funnel analysis, query-web-stats for web breakdowns and execute-sql for Structured Query Language (SQL) queries. Ask the client to inspect the current schema before it builds a request.
A useful opening prompt is:
Confirm the project and inspect the schema relevant to acquisition and signup. Identify the events and properties available for the proposed journey. Show the mapping, missing fields and a known saved insight we can compare against. Keep the investigation read only and do not retrieve individual profiles unless a specific diagnostic needs them.
Prefer a saved definition when it already answers the question. If the assistant creates a new query, preserve its settings or SQL with the answer. Another person should be able to reproduce the calculation without relying on the assistant's explanation.
Why do campaign fields disagree across events, sessions and people?
PostHog records UTM campaign parameters, the source labels attached to a URL, at event, person and session-entry scope. Those scopes are not interchangeable. Under the default identified-profile behaviour, initial person properties can be backfilled when the person identifies; latest campaign person properties are not backfilled from earlier anonymous arrivals. The UTM documentation describes these conditions.
That distinction explains a common investigation. A tagged landing page can have the expected event properties while a later profile's latest source is empty. An assistant querying only the profile may conclude that the campaign was untracked, even though the landing event contains the evidence.
Ask for a field inventory with scope, example values, coverage and capture timing. State whether you want the source of the current session, the first known acquisition source or a campaign association captured at the business conversion. A field called utm_source does not answer all three questions.
Use a controlled journey to inspect collection:
- Open a tagged campaign URL with an approved test browser and identity.
- Follow the real redirect and landing-page path.
- Complete signup or the relevant business action.
- Inspect landing, session and conversion data separately.
- Return through another source and check which fields change.
For each step, record the expected value and observed value. Include the selected consent state and whether identification has happened. Do not fill missing values with “Direct” simply to make the chart look complete.
Normalise inconsistent source names through a documented rule. Preserve enough raw evidence to distinguish an alias such as google_ads from a collection defect. A prettier report that hides missing campaign data makes the next diagnosis harder.
How do you build a funnel that represents the journey?
Use events for completed actions, not vague page names or button intentions. For a trial product, the progression might be eligible landing visit, account creation and first successful integration. Confirm that each event exists and that identities connect the stages appropriately.
PostHog supports sequential, strict and any-order funnels. Inserting an extra event as a step requires another action; it is not equivalent to adding a filter to an existing step. Funnel breakdown attribution also matters: choosing a later specific step can exclude people who never reach it. See the funnel documentation.
Ask for the proposed definition before running the analysis:
Analyse eligible visitors entering the campaign landing page during the agreed period, then signup and first successful integration within seven days. Confirm whether the data supports person-level or workspace-level measurement. Show event mappings, exclusions, ordering, timezone and the breakdown's property scope. Include entry counts, counts at each step and unknown campaign values. Preserve people who drop off before later steps when calculating the original entry-cohort rate.
If you want to compare mature cohorts, allow everyone the full observation period. If you want an early signal during a launch, label it as progress at a fixed cohort age. Do not compare a campaign's first two days with a competitor cohort that has had a month to convert.
Use replay or event-level inspection to investigate a specific drop-off. Check a relevant sample for a hypothesised problem, such as an error after Connect. A recording can show that an issue occurred; a handful of recordings cannot establish its prevalence across the entire campaign.
How do you join campaign cost to the right business outcome?
Compare campaign spend with a defined, fully observed business outcome and show unmatched records. PostHog's Marketing Analytics remains an opt-in beta. It combines configured marketing sources with conversion goals and supports campaign-name or campaign-ID matching, manual campaign mappings and source mappings. Its setup guide explains the required configuration.
Check which identifier your campaign URLs carry. If utm_campaign contains a stable campaign ID but the report matches against a display name, fix the mapping before explaining a low conversion count. Check currencies and source-sync coverage too; missing cost data can make a campaign look artificially efficient.
Column definitions distinguish ad-platform reported conversions from conversion goals defined in PostHog. Reported return on ad spend (ROAS) uses the ad platform's reported conversion value divided by cost. Keep the origin of those values visible in every answer.
Consider this fictional, fully observed acquisition cohort in USD:
campaign_id,spend_usd,new_trial_workspaces,activated_workspaces
campaign_alpha,3200,80,24
campaign_beta,2400,40,20Assume the spend is assigned to these acquisition cohorts using the same documented rule, the workspace identifiers are deduplicated and every workspace has the full activation window. This is an illustrative cohort calculation, not a claim that the native dashboard automatically creates this exact report.
Calculated results for this hypothetical cohort. Costs are USD per workspace; activation rate uses new trial workspaces as its denominator.
| Campaign | Cost per trial | Trial activation rate | Cost per activated workspace |
|---|---|---|---|
| Alpha | 40.00 | 30% | 133.33 |
| Beta | 60.00 | 50% | 120.00 |
Alpha's trial cost is 3,200 ÷ 80 = USD 40; its activated-workspace cost is 3,200 ÷ 24 ≈ USD 133.33. Beta is 2,400 ÷ 40 = USD 60 per trial and 2,400 ÷ 20 = USD 120 per activation. Alpha looks better at trial acquisition; Beta looks better on the selected activation outcome.
Neither result tells you which campaign creates more profitable customers. The next evidence might be paid conversion, gross margin, retention or whether the observed difference persists with more data. Choose the next measurement according to the budget decision, rather than adding every available metric to the report.
Keep unattributed outcomes visible. If 18 of 100 new workspaces lack a usable campaign mapping, your campaign comparison covers 82% of the cohort. Do not distribute the missing 18 proportionally and present the result as observed truth.
Attribution assigns credit under a rule. It does not measure the extra purchases caused by spending. The attribution and incrementality guide explains which evidence you need for that causal question.
Start from a reproducible saved insight, then define the campaign and funnel scopes. A missing field needs a collection or mapping investigation; incomplete cost needs a provisional result rather than an efficiency ranking.
Read diagram as text
- Confirm the project allowed actions and known insight to Access and the saved insight reproduce correctly?.
- Access and the saved insight reproduce correctly? to Resolve connection scope or report-setting differences: No.
- Resolve connection scope or report-setting differences to Confirm the project allowed actions and known insight.
- Access and the saved insight reproduce correctly? to Define UTM scope identity outcome and cohort window: Yes.
- Define UTM scope identity outcome and cohort window to The collected journey and mappings support the question?.
- The collected journey and mappings support the question? to Repair collection or mapping and repeat the controlled journey: No.
- Repair collection or mapping and repeat the controlled journey to Define UTM scope identity outcome and cohort window.
- The collected journey and mappings support the question? to Query outcome counts costs and unknown coverage: Yes.
- Query outcome counts costs and unknown coverage to Cost and cohort maturity support the comparison?.
- Cost and cohort maturity support the comparison? to Keep a provisional view and hold efficiency rankings: No.
- Cost and cohort maturity support the comparison? to Reproduce the definition and review the decision: Yes
Which MCP workflows can create AI charges?
Connecting and calling MCP tools is free, but some tools invoke large language models (LLMs) inside PostHog and may incur PostHog AI spend. Underlying product usage and your external assistant's costs remain separate. The MCP overview makes that distinction.
PostHog AI pricing provides 500 credits per organisation per month free, then charges USD 0.01 per credit. AI SQL assistance and survey-response summaries are among the documented credit-consuming features. Usage varies with the work; there is no reliable fixed “one marketing question” price.
For example, surveys-summarize-responses-create is a current summary operation in the tool catalog. Treat a request to summarise responses differently from merely retrieving an existing result. Check the actual feature's charging rules before running a large batch.
PostHog requires organisation-admin approval for AI data processing; disabling it removes tools that use internal LLM processing. That control is described in AI access settings. It does not mean an external AI client stops processing the ordinary query results you return to it.
Do not infer billing solely from a tool's name. For example, AI evaluations have their own rules: LLM judges use your provider key, while local sentiment and code evaluations have no LLM cost; evaluation runs still count toward AI Observability usage. Those are different charges from a blanket PostHog AI-credit assumption.
An illustrative workflow using 1,200 credits in a month would leave 700 paid credits if the full 500-credit allowance is still available, costing USD 7 for that AI-credit usage. If other work already consumed the allowance, the calculation changes. It excludes analytics usage and external-model charges.
Set the actual billing limit and inspect usage after a bounded pilot. PostHog warns that credit usage can take up to 24 hours to appear on billing pages, so an immediate zero is not proof that a batch cost nothing.
When should you use PostHog AI instead of MCP?
Use PostHog AI when the investigation belongs inside PostHog and the team reviews its insights there. It can use project data, attached context and memory to investigate and create content.
Use MCP when your investigation belongs in another approved assistant or needs context from related work there. The important choice is where the team can inspect and maintain the answer. Keep the metric definition consistent across both interfaces.
Review how PostHog's MCP server compares with Mixpanel and Amplitude when the deciding requirement is the external assistant’s access and allowed actions.
Before saving a dashboard, changing an attribution mapping or updating a campaign-facing object, review the proposed change and its effect on existing reports. Preserve the old definition and the reason for the new one. A rate that changes because the query changed is different from a rate that changes because customers behaved differently.
What should pass before you expand the workflow?
Expand after one decision can be reproduced from its definitions, source counts and cost coverage. Keep a named owner for the query and any saved output.
Checklist
- One campaign or funnel decision is written down.
- The account, region and project are confirmed.
- Analysis access is scoped and the resulting tool list is checked.
- One existing insight reproduces correctly.
- UTM fields are identified by event, person or session scope.
- A controlled tagged journey has been inspected end to end.
- The funnel has an explicit counting unit and observation window.
- Campaign mappings, cost coverage and currency are checked.
- Unknown attribution remains visible in the result.
- The team checks AI usage and review effort before expanding the workflow.
Want a second pair of eyes on your stack? Get the $99 martech audit, or scope the analytics implementation around the missing events, identity rules and acceptance checks.
Keep reading
Product AnalyticsPostHog Implementation Mistakes: Capture, Identity and Replay
Diagnose duplicate pageviews, identity mistakes, replay privacy gaps and missing recordings with an explicit export journey and synthetic QA probes.
Jafrin Akter AloLast updated 13 min read
Product AnalyticsPostHog vs Fullstory: Replay, Product Analytics and the Cost of Useful Evidence
Compare PostHog and Fullstory for replay, product analytics and experiments. Includes usage costs, retention, privacy controls and a practical evaluation checklist.
Jafrin Akter AloLast updated 11 min read
Product AnalyticsPostHog vs Heap: Autocapture, Event History and Product Costs
Compare PostHog and Heap by autocapture, historical properties, identity and product costs. Review free limits, replay scope and a practical validation method.
Jafrin Akter AloLast updated 11 min read
AI readiness score
Check your tracking, data, context and access before connecting an agent.
Questions people ask
How should a renamed campaign be handled in an existing comparison?
Preserve the stable campaign identifier and the name history rather than silently joining old spend to whichever name exists today. Check the identifier carried in the original arrival, the ad-source record and any manual mapping. Document the date a mapping changed, then rerun the affected period under one consistent rule. A label change should not be interpreted as a newly acquired audience.
What should an assistant do when campaign cost is still arriving?
Hold the efficiency ranking until the cost period is sufficiently complete for the decision. Show the latest available source cutoff alongside conversion coverage and identify the unfinished campaigns. A provisional count can still help monitor a launch, but a cheap-looking cost per activation based on partial spend should not drive a budget increase. Recalculate the same saved definition after the source catches up.
How should an offer change during a campaign affect the comparison?
Separate the periods or cohorts exposed to each offer before interpreting the combined result. Record when eligibility, price or included benefits changed, and keep acquisition cost attached to the corresponding audience. A lower cost per activation after a discount may come with different revenue or retention. Compare the outcome the budget decision actually depends on instead of treating both offers as an unchanged experiment.
What if two campaigns contribute to the same workspace?
Choose a credit rule that fits the business question and keep the workspace deduplicated in the total population. A workspace can have several campaign interactions without becoming several customers. Record whether the comparison uses one acquisition assignment, fractional credit or separate assisted-touch reporting. Show unassigned cases and keep the rule stable across campaigns; the attribution choice remains separate from proving incremental lift.
How can a useful diagnosis become a misleading recurring report?
A one-off investigation can rely on a temporary filter or exception that later becomes inappropriate. Before scheduling the report elsewhere, give its definition an owner, an expiry or review date, and a response for missing data. Record the assumptions that were specific to the incident. A recurring output should fail visibly when those assumptions stop holding rather than keep sending a confident explanation.
Sources
- PostHog MCP overview.
- PostHog MCP for Claude Code.
- PostHog MCP advanced setup.
- PostHog MCP tool catalog.
- PostHog UTM segmentation.
- PostHog funnels.
- PostHog Marketing Analytics.
- PostHog: Marketing Analytics column definitions.
- PostHog AI pricing.
- PostHog AI access settings.
- PostHog AI evaluations.
- PostHog AI.
- Vercel MCP setup and OAuth.
- Vercel MCP tool availability and access.
- Vercel MCP deployment tools.

Written by
Jafrin Akter AloData Engineer and Co-founder at Martechdevs and Growth and Analytics Partners
Jafrin writes practical guides to marketing technology, customer data, analytics and AI workflows. Martechdevs is a Growth and Analytics Partners company.