Aident AI

Measure Blog-to-Product Attribution With PostHog and Codex
Measure blog-to-product attribution as three separate views: first touch, assisted progression, and last touch. Do not collapse them into one “the blog caused this conversion” number. PostHog can connect pageviews and downstream events for the same identified visitor, while Codex can discover the live query Action, inspect its schema, preflight the exact request, and run a reproducible read-only analysis.
The result is evidence about sequence and association. It is not proof that the article caused the later action.
The Three Views Answer Different Questions
View | Question it answers | What you can claim |
|---|---|---|
First touch | Was this article the visitor's earliest known source or content interaction? | The article introduced the identified visitor within the observed history. |
Assisted progression | Did the visitor read this article before a named product event within a fixed window? | The article appeared earlier in the visitor's measured journey. |
Last touch | Was this article the visitor's final qualifying pageview before the product event? | The article was the most recent measured content interaction under your rule. |
None of these views proves incremental lift. A returning visitor may have seen an untracked recommendation, used another device, cleared cookies, or already intended to try the product. If you need causality, use a controlled experiment or a credible holdout design.
Define the Event Contract Before You Query
Write down the contract first. Otherwise, a precise query can still produce a misleading answer.
Canonical blog scope: use exact canonical paths or one explicit path prefix. Decide whether translated pages, query strings, and trailing slashes map to the same article.
Downstream event: name one observable step, such as a visit to
/SETUP.md,setup_started,integration_connected, oractivation_completed. Do not substitute a product-page visit for an activation.Identity: choose the PostHog
distinct_idor person identity available in both event sets. Document what happens before and after login or identity merging.Window: declare the attribution window and timezone. Seven days is useful for a quick progression check, but it is a policy choice rather than a universal default.
Exclusions: remove internal traffic, known bots, synthetic checks, preview domains, and test accounts with explicit filters.
Campaign metadata: tag the article CTA with stable
utm_source,utm_medium, andutm_campaignvalues so the link itself remains auditable.
Keep those definitions next to the query and result. A result without its event contract cannot be reproduced or compared safely.
Connect PostHog Without Copying Credentials Into a Prompt
Install Aident Loadout by giving Codex this exact instruction:
Then verify the signed-in account and Vault connection before discovery:
Search by the job rather than guessing an Action identifier:
Use the exact public Action name returned by search. Inspect its current input schema, preflight the full input, and execute only after the project, time bounds, and SQL match the reviewed contract. An HTTP POST can still be read-only when it submits a query body, but verify the operation description instead of inferring safety from the verb.
Start With an Exact-Page Baseline
Count pageviews and unique visitors for one canonical article over complete days. Parameterize the dates and path rather than letting an agent silently choose them.
Read back the SQL, project ID, timezone, inclusive start, exclusive end, and returned counts. This is the denominator for later progression rates, not an attribution result by itself.
Measure Assisted Product Progression
The following HogQL pattern asks whether a visitor to a canonical blog page later reached a named product path within seven days. Replace both URLs, dates, and the window with your reviewed contract.
Call the output assisted product progression, not conversions, unless the downstream event is an actual verified conversion. A page path is navigation evidence. It does not establish a signup, payment, activation, or causal lift.
Add First Touch and Last Touch Without Mixing Them
PostHog captures referrer and UTM properties and documents first- and last-touch patterns. Keep each model in a separate query or output column.
For first touch, find the earliest known pageview or acquisition event for each person and test whether the canonical article was that event. State how much history the query can see. “First touch in the last 90 days” is not the same as the person's first touch ever.
For last touch, locate the final qualifying pageview before the downstream event. Decide whether only blog pages qualify or whether pricing, documentation, and the homepage can receive last-touch credit. If the rule changes, start a new comparable series rather than rewriting old results.
Assisted progression is intentionally broader. It asks whether the article appeared anywhere before the event within the declared window. One journey can therefore count as assisted by multiple pages, but it should have only one first touch and one last touch under a deterministic rule.
Aident's Current Baseline Shows Why the Distinction Matters
In a read-only PostHog query covering July 14 through August 10, 2026, Aident's blog portfolio recorded 1,724 pageviews from 1,562 unique distinct_id values. Of those visitors, 21 later reached a declared product path within seven days, an assisted navigation rate of about 1.34%.
That result does not say 21 people signed up, paid, or would have failed to progress without a blog visit. It establishes a reproducible navigation baseline and exposes the next instrumentation question: which downstream event represents a meaningful product outcome?
Search Console told a separate, complementary story over the same latest complete 28-day window. Nonbranded blog clicks were 185 from 8,026 impressions, compared with 7 clicks from 4,842 impressions in the preceding equal period. Search discovery improved sharply, but search acquisition and product progression remain different measurements. Reporting one as proof of the other would erase the most important part of the funnel.
Make the Result Auditable
Have Codex return a compact evidence packet with every run:
the PostHog project name and numeric ID;
the exact query text and Action version;
the timezone and complete date bounds;
the article path, downstream event, and attribution window;
the exclusion and identity rules;
the preflight price or credit quote;
the raw counts before any percentage calculation; and
a read-only confirmation that no insight, dashboard, cohort, or flag was changed.
Store the result as a dated snapshot. Do not overwrite a prior number when the query contract changes. Comparing two different event definitions as if they were a trend is worse than having no trend at all.
Common Attribution Failures
Calling every downstream pageview a conversion
A product-page visit is a useful consideration metric. It is not an account creation, connected integration, activation, qualified opportunity, or payment. Name the metric after the event you actually measured.
Losing identity at login or across devices
Anonymous and identified events may use different IDs until they are merged. Cross-device journeys may remain separate. Report the measured identity boundary instead of assuming every person is unified.
Letting an agent choose an open-ended query
Require one project, bounded dates, exact paths, and a read-only operation. Preflight the complete input. Large scans are slower, harder to review, and easier to misinterpret.
Mixing first, assisted, and last touch in one headline
These models allocate evidence differently. Publish them side by side with their definitions. Do not select whichever number makes the article look best.
Treating association as causation
Attribution organizes observed journeys. It cannot recover unobserved exposures or the counterfactual outcome. Use experiments for causal claims.
Run One Bounded Attribution Query
Follow https://aident.ai/SETUP.md
Set up Aident Loadout and run the attribution query
For the general discovery, schema, preflight, and execution loop, read How to Use Aident Loadout. To connect search demand with product evidence, continue with How AI Agents Turn SEO Research Into Product Growth.
Sources
PostHog first- and last-touch attribution tutorial, reviewed August 12, 2026.
PostHog web analytics, reviewed August 12, 2026.
PostHog HogQL documentation, reviewed August 12, 2026.
Aident PostHog and Search Console read-only measurements, captured August 12, 2026.
Aident Loadout live staging catalog, schemas, preflights, and read-only PostHog query, inspected August 12, 2026.
Refresh this guide when the PostHog event contract, identity policy, product-path definition, attribution window, Loadout Action schema, or preflight pricing changes.



The one tool
for every tool
your agent needs.
Give any AI agent real capabilities in seconds. Connect 1,000+ tools once, skip the setup headache, and let your agents execute.
