All Posts
Headless Commerce June 16, 2026

PostHog vs Amplitude for Shopify Hydrogen: Headless Analytics Compared (2026)

Most Shopify Hydrogen storefronts ship analytics late and ship it wrong. Pixel based tracking breaks under server side rendering, GA4 misses half the conversion events, and the team ends up rebuilding the funnel after launch. PostHog and Amplitude are the two product analytics platforms most enterprise headless teams pick between in 2026.

Most Shopify Hydrogen storefronts ship analytics late and ship it wrong. Pixel based tracking breaks under server side rendering, GA4 misses half the conversion events because the cart and checkout live on different domains, and the analytics team ends up rebuilding the funnel after launch. The two product analytics platforms most enterprise headless commerce teams pick between in 2026 are PostHog and Amplitude. They solve overlapping problems with very different commercial and technical models, and the right choice is workload dependent.

This is a head to head on the dimensions that matter for a Shopify Hydrogen deployment: event ingest pricing, identity resolution across the storefront-to-checkout domain split, server side tracking quality, retention analysis depth, and integration cost with the broader headless stack.

Headline Comparison

Dimension PostHog Amplitude
Pricing model $0 up to 1M events/month, $0.000248 per event after $61K/year base for Growth, custom for Enterprise
Self host option Yes (PostHog Cloud or self hosted) No
Identity resolution Anonymous + identified merge, automatic Identity resolution with user properties
Server side SDK Strong (Node, Python, Go, Ruby) Strong (Node, Python, Java)
Session replay Included Add on cost
Feature flags Included Separate product (Amplitude Experiment)
Funnel analysis Strong Strongest in category
Retention analysis Strong Strongest in category
Cohort builder Strong Strongest
Time to first dashboard Hours Days
Shopify native integration Community plugin Official integration

At a high level: PostHog is the developer first option with a generous free tier, source available code, and a unified product (analytics, session replay, feature flags, surveys, A/B testing). Amplitude is the enterprise product analytics standard with deeper analysis tooling, more polished UI, and a price tag that reflects both.

Pricing: PostHog Wins at Mid Volume, Amplitude Wins on Predictability

PostHog Cloud charges per event. The first 1 million events per month are free, then $0.000248 per event after. Session replay is $0.005 per recording with 5K free. For a typical Shopify Hydrogen storefront that fires 10 to 20 events per session and gets 500K sessions per month, you are looking at:

  • 7.5M events/month = $1,612 PostHog Cloud
  • 10M events/month = $2,232 PostHog Cloud
  • 50M events/month = $12,152 PostHog Cloud

Amplitude pricing is opaque and quote based above the Starter tier ($61K/year, capped at 10M events/month). Negotiated Enterprise contracts for storefronts in the 50M to 100M event range typically land between $80K and $180K per year. The price per event is harder to compute because it bundles seats, support, and SLAs.

The crossover point where Amplitude starts looking competitive is around 50M+ events per month and only if you value the deeper analysis tooling. Below 25M events per month PostHog Cloud is meaningfully cheaper and the gap is largest at the small to mid scale where most Hydrogen storefronts live.

The other lever is self hosting. PostHog is one of the few production grade product analytics platforms with a real self hosted option. For brands with strict data residency requirements or who want predictable infrastructure cost (rather than per event metered cost), the self hosted route is viable. We have seen self hosted PostHog deployments at 100M events/month run for $1,500 to $3,000/month in GCP infrastructure. Amplitude has no equivalent.

Identity Resolution: The Headless Commerce Killer Problem

The single hardest analytics problem on a Shopify Hydrogen storefront is identity resolution across the cart-to-checkout transition. The Hydrogen storefront runs on your domain (shop.brand.com). Shopify checkout runs on checkout.shopify.com or pay.shopify.com. Cookies set on the storefront do not follow the user to checkout. Without explicit work, the analytics platform sees two different users for what is one conversion.

PostHog handles this with the identify method called server side when an order is created via the Shopify webhook. The pattern looks like:

// Server side, Cloudflare Worker handling Shopify order webhook
import { PostHog } from 'posthog-node'

const posthog = new PostHog(POSTHOG_API_KEY)

export async function handleOrderCreated(order: ShopifyOrder) {
  posthog.identify({
    distinctId: order.customer.id,
    properties: {
      email: order.customer.email,
      first_purchase_date: order.customer.created_at,
      ltv: order.customer.total_spent
    }
  })

  posthog.capture({
    distinctId: order.customer.id,
    event: 'order_completed',
    properties: {
      order_id: order.id,
      revenue: order.total_price,
      items: order.line_items.length
    }
  })

  // Critical: merge the anonymous storefront session into the identified user
  posthog.alias({
    distinctId: order.customer.id,
    alias: order.note_attributes?.find(a => a.name === 'storefront_session_id')?.value
  })
}

The trick is passing the anonymous session ID from the Hydrogen storefront into the Shopify cart as a note_attribute, then reading it back on the order webhook. PostHog's alias call then merges the two profiles. Amplitude has the same pattern with setUserId plus setDeviceId, but the identity merge behavior is less aggressive: if a user has already been identified with a different userId, the previous events stay split.

Both platforms work for this pattern. PostHog's automatic anonymous-to-identified merge is cleaner. Amplitude requires more manual identity management but gives you more control over edge cases.

Server Side Tracking: Why Pixel Tracking Is Dead on Hydrogen

Shopify Hydrogen ships server side rendering by default. Client side pixel tracking misses every event that happens during SSR (initial product views, server rendered category pages, server rendered search results). This is not a small leak. On a typical Hydrogen storefront, server side events are 30 to 50 percent of total events.

PostHog's Node SDK is the right answer here. Fire events from the Hydrogen loader functions:

// app/routes/products.$handle.tsx
import { PostHog } from 'posthog-node'

export async function loader({ request, params }: LoaderArgs) {
  const product = await loadProduct(params.handle)
  const sessionId = await getOrCreateSessionId(request)

  const posthog = new PostHog(POSTHOG_API_KEY)
  posthog.capture({
    distinctId: sessionId,
    event: 'product_viewed',
    properties: {
      product_id: product.id,
      product_handle: product.handle,
      price: product.price,
      collection: product.collection?.handle
    }
  })

  await posthog.shutdown() // important in serverless to flush before response

  return json({ product })
}

Amplitude's Node SDK has the same shape. Both work. The operational gotcha is the shutdown() call in serverless environments (Cloudflare Workers, Vercel Edge, Netlify Functions). Forgetting it drops events on the floor when the worker terminates before the HTTP batch flushes. PostHog has better defaults here with shorter batch timeouts. Amplitude requires more careful configuration.

Analysis Depth: Where Amplitude Earns Its Price

Where Amplitude leads is the depth of the analysis tooling. Funnel analysis with arbitrary cohort splits, retention curves with multiple comparison dimensions, behavioral cohort builders that compile to efficient SQL, predictive churn models. PostHog has all of these in some form but the polish is a year or two behind.

Specifically, Amplitude's Pathfinder and Compass features have no real PostHog equivalent for exploratory funnel analysis. If your product team lives in funnel analysis and wants to ask questions like "show me users who viewed product A, then viewed product B within 7 days, but did not purchase, segmented by acquisition channel," Amplitude answers that question with a few clicks. PostHog gets to the same answer through HogQL (a SQL like query language) which requires the analyst to understand the underlying event schema.

For commerce specifically, Amplitude's funnel analysis on the standard ecommerce funnel (product view → add to cart → checkout start → checkout complete) is the most polished tooling in the category. If your business depends on extracting insight from that funnel and your analytics team is non technical, Amplitude pays for itself.

Session Replay and Feature Flags

PostHog includes session replay and feature flags in the base product. Amplitude charges separately for session replay (no public pricing, Enterprise quote only) and ships feature flags as a separate product called Amplitude Experiment.

The bundling matters for total cost. A PostHog deployment at 10M events/month plus 100K session replays is roughly $2,732/month. An Amplitude deployment with comparable session replay coverage plus Amplitude Experiment lands closer to $9,000 to $12,000/month at the same scale.

If you only want analytics, the bundling savings do not apply. If you want analytics + session replay + feature flags + product surveys in one tool, PostHog's all in one model is a meaningful cost advantage.

Shopify Hydrogen Integration: The Implementation Detail

Both platforms work with Hydrogen. The implementation patterns are similar:

  1. Server side tracking from Hydrogen loaders using the Node SDK
  2. Client side enhancement using the browser SDK for interactions (scroll depth, button clicks, hover events)
  3. Server to server event forwarding from Shopify order webhooks for purchase events
  4. Identity resolution via a custom session ID passed through note_attributes

PostHog has a community Shopify Hydrogen template and a number of public implementations. Amplitude has an official Shopify integration that handles the order webhook side but does not cover the Hydrogen storefront layer (that is still custom). Practically, both require 2 to 5 days of integration work for a clean deployment.

For deeper context on the broader analytics ecosystem see our Amplitude vs Mixpanel comparison and our Segment vs RudderStack CDP analysis which covers the event routing layer that feeds either platform.

When to Pick Which

Pick PostHog if: cost matters at the 10M to 50M events/month scale, you want bundled session replay and feature flags, you want a self hosted option for data residency, or your analytics consumers are technical and comfortable with HogQL.

Pick Amplitude if: you are operating above 50M events/month, your product team relies heavily on funnel and retention analysis with non technical analysts, or your organization already standardizes on Amplitude across other product lines.

Pick neither: if your storefront only needs purchase attribution and conversion tracking, Shopify's built in analytics plus GA4 plus a CDP like Segment may be cheaper and sufficient. Product analytics platforms earn their cost when the product team is actively running experiments and exploring user behavior.

What This Means for Your Headless Stack

Analytics decisions on a Hydrogen storefront have downstream consequences for personalization, recommendation engines, and ML driven merchandising. The event schema you commit to early shapes what is possible later. If you are planning RAG over user behavior or sending events into a customer data platform that feeds ML models, the analytics platform choice is the foundation.

We have shipped both PostHog and Amplitude on Shopify Hydrogen storefronts for enterprise clients and the implementation patterns are convergent: server side first, identity resolution via session ID handoff, order webhook for purchase events. The technology choice is mostly about cost shape and analysis depth, not capability. For headless commerce migrations or analytics infrastructure design, that is the kind of architecture work Contra Collective does.

FAQ

Can I use both PostHog and Amplitude in parallel? Yes. Some teams send the same event stream to both during evaluation or migration. The event volume doubles, so the cost doubles. Useful for short term parallel runs, not for permanent dual deployment.

Does PostHog handle PII for Shopify customers correctly? PostHog has PII redaction at the SDK level and at ingest. Self hosted PostHog gives you full control over what is stored. Amplitude has similar capabilities. Both are GDPR compliant when configured correctly.

What about Mixpanel for the same use case? Mixpanel is the third option in this category. Pricing sits between PostHog and Amplitude. Analysis tooling sits closer to Amplitude. See our Amplitude vs Mixpanel comparison for the head to head.

Can I move events from one platform to the other later? Yes, but it is a migration. Historical events can be replayed into the new platform with some loss of fidelity (timestamps stay correct, session boundaries may shift). Plan on a 4 to 8 week migration project for a mid sized storefront.

How does this interact with a customer data platform like Segment? A CDP sits upstream of both. Segment, RudderStack, or Customer.io ingest events once and fan out to PostHog, Amplitude, and any other destination. If you are running multiple analytics tools, a CDP is the right architecture. See our Segment vs RudderStack comparison for the CDP layer.

[ 02 ] — Keep Reading

More from the lab.

Oct 5, 2026 Headless Commerce

Adobe's 275 Billion Dollar 2026 Holiday Forecast: Is Your Commerce Stack Ready for Peak Season

Adobe's 2026 holiday forecast puts US online sales at 275.1 billion dollars between November 1 and December 31, up 6.7 percent year over year. The bigger number in the report is not the top line: AI referred traffic to retail sites is projected to grow 130 percent, with spikes to 159 percent on Thanksgiving alone. Most teams are reading this as a marketing story. It is an infrastructure story.

Oct 5, 2026 Headless Commerce

Shopify Lets Meta's Muse Check Out, Amazon Blocks It: The Platform Split Over AI Shopping Agents

On September 22, Shopify and Meta announced that Muse, Meta's AI shopping agent, can search Shopify merchant catalogs and complete purchases through Shop Pay. Within days, Amazon blocked the same agent from its marketplace, citing unauthorized agent access, identity concealment, and credential collection. Two platforms, the same AI agent, and two opposite bets on what agentic commerce should look like.

Oct 3, 2026 Headless Commerce

Mastercard Agent Pay, Visa TAP, and ACP: The Agentic Payments Protocol Map for Merchants (October 2026)

On October 1, 2026, Mastercard added a probability score and a set of trust and intelligence signals to Agent Pay, its framework for telling issuers whether a transaction was actually initiated by an AI agent, built in partnership with agent identity provider Skyfire and with Cloudflare on the data side. The same day, trade press mapped out eight separate protocols now live in agentic commerce: MCP, A2A, ACP, UCP, AP2, TAP, Agent Pay, and MPP, backed by Anthropic, Google, OpenAI, Stripe, Shopify, Visa, and Mastercard respectively or in combination. None of them has lost. They are stacking, not competing, which is both good news and a real integration problem for anyone who is not Shopify.

Ready when you are

Want to discuss this topic?

Start a Conversation