Joffre Ordinola Shopify Developer & E-commerce Specialist
|

PostHog · A/B Testing · Metafields

PostHog-powered A/B framework that tests prices via metafields and injects the matching discount code at checkout automatically.

Price Testing

Problem:

The brand needed to find the optimal price point for a hero product without confusing returning customers or manually changing global store settings mid-test.

Solution:

A PostHog-powered A/B framework that reads test prices from product metafields, persists variant assignments via localStorage and cookies, and injects the matching discount code at checkout to honor the tested price end-to-end.

How it works:

PostHog manages variant assignment and feature flags. On page load, JavaScript reads test prices from product metafields and updates the displayed price. A cookie and localStorage store the assigned variant so returning visitors always see the same price. When the customer reaches checkout, a listener automatically injects the matching discount code into the checkout URL, with no manual intervention needed.

Tools:

  • PostHog
  • Metafields
  • JavaScript
  • localStorage / Cookies

More projects

See all projects
Made-to-Order Configurator

Made-to-Order Configurator

A custom product configurator and Shopify app that recalculates prices on the server and creates a real checkout. No Shopify Plus required.

Geo-Aware Store Pickup

Geo-Aware Store Pickup

Store pickup sorted by distance and availability, directly in the collection filter. No browser permission prompt and no app.