Cart transform price testing (Shopify Plus)
Cart transform is the strategy Personizely uses for price tests on Shopify Plus. A Shopify Function (Cart Transform API) sets each cart line to the visitor's variation price at checkout, so visitors buy your real products at the price they were shown. Your product catalog isn't duplicated or changed.
Available on: Shopify Plus, Shopify Plus trial and development stores. Other plans use duplicate products. See Price testing for how the strategy is picked.
How it works
- The strategy is set when you create the campaign. On a Plus, Plus trial or development store, new price campaigns use cart transform, unless Products with subscriptions or bundles is turned on.
- Prices are repainted on the storefront. The snippet rewrites prices on product pages, collection grids and other places your price selectors cover.
- The cart records the visitor's variation. The snippet writes the visitor's campaigns and variations to the cart attribute __campaignVariations, as JSON: [{"campaignId": 123, "variationId": 456}]. It works with standard theme cart forms, AJAX carts and headless storefronts.
- Checkout charges the variation price. At checkout, Personizely's Cart Transform function reads the attribute and the campaign's price rules, and sets each matching line's unit price. Lines for products outside the campaign are left alone.
- Orders are attributed server-side to the variation from Shopify order data. See Revenue attribution.
What Personizely changes in your store
Item | Details |
|---|---|
Cart Transform function | Activated when your first cart-transform price campaign starts, deactivated when none is running |
Product metafield | Each campaign product stores its campaign price rules in an app-owned metafield, which the function reads. Kept in sync within seconds of saving the campaign. |
Cart attribute | __campaignVariations on carts of visitors in a price campaign. |
Your products, variants and prices aren't edited, unless you deploy a winning variation.
Behavior details and limitations
- Only the price changes at checkout. Shopify Functions can't change compare-at prices, so a compare-at rule (for example a "was" price) shows on your storefront but not in checkout. If the compare-at price matters in checkout, consider that the duplicate products strategy writes it to the product.
- Currencies and markets. Increase and Decrease rules start from the line price in the visitor's currency, including any market-specific price. Fixed amounts and Set values are entered in your store's base currency and converted with Shopify's exchange rate for the checkout currency. A Set value therefore replaces a fixed market price from a price list.
- Discounts apply on top. The function sets the line price first; discount codes and automatic discounts are then calculated on the variation price.
- The attribute must reach checkout. If a cart is created in a way that bypasses the snippet, such as a custom cart app's own API, an external "buy" link, or an express checkout button on a product or collection page, the attribute may be missing and checkout shows your normal price. See QA checklist.
- Subscriptions and bundles. Subscription (selling plan) prices and bundle apps that build or reprice cart lines can conflict with the function. For subscription or bundle products, turn on Products with subscriptions or bundles, which uses duplicate products instead.
- Other cart transforms. If another app in your store also uses a cart transform, test carefully. Shopify may limit how many cart transform functions a store can run.
- Rounding is identical everywhere. The storefront, the function and deployed prices use the same rounding rules.
- Preview doesn't change checkout. In a preview (?ply_preview_campaign=) only the storefront is repainted. Checkout prices change only for a running campaign.
- Upgrading to Plus. Existing campaigns keep the strategy they were created with. Clone a campaign after upgrading to move it to cart transform.
Troubleshooting
- Checkout shows the original price → open /cart.js on your store and check that attributes.__campaignVariations contains the campaign. If it's missing, the cart was created outside the snippet's reach; contact support with the steps to reproduce.
- Compare-at price shows on the product page but not in checkout → expected; Shopify Functions can't set compare-at prices.