Get early access

Docs / Platforms / Shopify

All docs

Start here

  • Quick startKeys, install, items, events and your first lists, in every library

Platforms

  • ShopifyInstall on Shopify with the default settings, and the three usual problems
  • WooCommerceInstall the WooCommerce plugin, what you see after ten minutes, the usual problems
  • MagentoInstall the Magento 2 module, what you see after ten minutes, the usual problems
  • Any websiteAny other website: one script tag, what recapi reads from your product pages, the usual problems

Reference

  • LibrariesInstall the library for your language, the three calls, and what all eight do for you
  • Public API reference (v1)Every call, field and error of the HTTP API
  • Accessibility statementWhat the row meets for screen readers, keyboards and narrow screens, how it is checked, and what it leaves to your site
  • Limits and errorsEach error code, what caused it and what to do, and the limits behind them

Understand and fix

  • FAQWhat people ask before they sign up: price, platforms, first lists, data, consent, stopping
  • Concepts in plain wordsPlacements, list kinds, visitors, the lift test, variety, Settings, consent and cookie banners in plain words
  • GlossaryEvery word the docs and dashboard use, in two lines each
  • TroubleshootingWhat you see after installing; row missing, empty lists, only popular items, orders or clicks not counted, CORS or key errors: the check and the fix

Shopify

Last changed

Installing recapi on a Shopify shop: the two snippets, what differs on Shopify once it runs, and Shopify's three usual problems.

In short

  • You paste two snippets, both shown with your key already in them on your dashboard's quick start (/app/quickstart, choose Shopify): one in the theme, one as a custom pixel.
  • The theme snippet counts product views and fills recapi's row. The pixel counts add-to-carts and purchases, since Shopify's checkout runs none of your theme's code.
  • recapi's row takes the place of your theme's own "Related products" or "You may also like" section: hide that one. "Often bought together" shows under it on product pages, Recently viewed at the end of the home page, with no box to add: hide your theme's own recently viewed section too.
  • Each product's handle (the end of its address) is its id in recapi.
  • What every shop sees after installing, and the problems all platforms share: troubleshooting.
  • For an accessibility audit: the statement.

What the snippets hold

You paste them once: each holds only your keys and what Shopify tells the page, and loads recapi's code from recapi, so every fix reaches your shop within a day. Pasted a longer snippet before 18 November 2026? It holds its own copy of recapi's code, which no fix reaches: paste the two short ones once in its place. The quick start says so while your shop still runs it.

What recapi learns about your products

  • The snippet tells recapi each product's name, type and tags as visitors open it, and reads your shop's own product list from its pages, 250 products per product view, until recapi has them all. Similar products by name need no upload, from your own first click-through.
  • Upload your products and orders exports so the row shows at once and learns from your past sales.
  • Each purchase carries its line's paid amount after discounts, in the order's currency, for your test's sales per visitor; the orders export carries it too. With tax when your prices include it: Shopify gives a line's price with its tax.

Install

Do everything in your Shopify admin and the theme editor. The quick start (/app/quickstart, Shopify) shows both snippets with your address and public key filled in.

  1. The theme snippet. In Online Store → Themes → Customize, under Footer in the sidebar, choose Add section → Custom Liquid. Paste the theme snippet, set its top and bottom padding to 0 and Save. The footer is on every page, and a theme update keeps sections you add in the editor.
  2. The row. Open the product template (the page menu at the top → Products → Default product). Hide the section showing other products ("Related products", "You may also like" or "Product recommendations") with its eye icon. Add a Custom Liquid section containing <div id="recapi-recommendations"><style>#recapi-recommendations{container-type:inline-size}#recapi-recommendations:not(:is(.page-width,.section--page-width) *){box-sizing:border-box;max-width:var(--page-width,1200px);margin-inline:auto;padding-inline:clamp(1.5rem,(100vw - 749px)*999,5rem)}#recapi-recommendations::before{content:"";display:block;--c:4;--l:2;height:calc(var(--l)*((100cqw + 1rem)/var(--c) + .5rem + 3lh) + .4rem + 2lh);animation:recapi-gone 0s 4s forwards}@container (width<630px){#recapi-recommendations::before{--c:3;--l:4}}@container (width<470px){#recapi-recommendations::before{--c:2}}@keyframes recapi-gone{to{height:0}}</style></div> and drag it to the same spot. Paste it whole: its style keeps the page still while the rows load, holding their blank place at the page's width. It closes after 4 seconds without recapi, and beats themes hiding empty boxes.
  3. The pixel. In Settings → Customer events, choose Add custom pixel, name it recapi, paste the pixel snippet. Under Customer privacy, leave Permission on Required, untick Marketing, keep Analytics ticked, then Save and Connect.
  4. Your products and past orders. In Products → Export and Orders → Export, choose "Plain CSV file"; upload both on the dashboard's Set up → Your data (/app/import).
  5. Keep products current (recommended). In Settings → Notifications → Webhooks, create three webhooks: Product creation, Product update and Product deletion, each in JSON, the latest API version, and the URL the quick start shows. Copy the secret Shopify shows under the list ("Your webhooks will be signed with …") and save it in the quick start.

Why these steps

  • Step 3: Shopify ticks both Marketing and Analytics for a new pixel, and the pixel then waits for both: a shopper who accepts Analytics only is seen on your product pages, and their order never reaches recapi.
  • Step 4: the products export gives recapi each product's name, link, picture and price, and marks draft and archived products inactive. The orders export trains recommendations on your past sales from day one. Add the customers export to the first upload of those orders: each buyer's past orders then follow their account. Emails are never stored.

Other themes and the cart

  • If your theme's footer offers no Add section, paste the theme snippet in Edit code → layout/theme.liquid, just before </body>. A theme update drops code edits, so paste it again after each update.
  • If your cart page or cart drawer shows Shopify's complementary products and you add recapi's row there too, hide Shopify's there the same way.

After ten minutes

Your shop shows what every platform shows after installing, and on Shopify:

  • Prices show in the visitor's currency. Both rows keep to your theme's page width: 4 cards across on a computer, 2 on a phone.
  • Recently viewed shows above the home page's footer once the shopper has opened a product. A box of yours on the home page shows it under recapi's row instead.
  • Your own "Often bought together" title from the boughtTogether line follows the same title rule. The long snippet pasted before version 0.10.0 draws no second row.
  • A sold-out product's row keeps the place you gave it, titled "Other products in stock" (a heading of yours right above it stays), with no second row. A snippet pasted before version 0.19.3 needs pasting again for this.
  • The theme editor shows the row where it sits and sends nothing about you: your time in the editor never counts as a visit. Its rows still count as shown on the dashboard, a few each time you open the editor.
  • An order's details may show a hidden _recapi attribute: the theme keeps the visitor and the clicked list in the cart, in case the checkout can't read them.
  • A product a row showed counts as viewed after shown when the shopper opens it within 30 minutes, by the card or any other way (attribution).

The three usual problems

"I don't see recapi's row on my product pages"

Cause. Most often, your theme hides the box: Dawn and the many themes built on it hide every empty div, and the box from step 2 was empty until November 2026. Otherwise the Custom Liquid section from step 2 is missing, or the theme you edited is not the published one: recapi's sections are saved in one theme only, so publishing another theme or starting a Shopify Rollout shows pages without them.

Fix. Replace the box with the one step 2 gives today; pasting the quick start's current theme snippet in place of yours also fixes it, since it fills an empty box at once. If the box is there, add the section to the product template of your live theme (duplicating a theme in Online Store → Themes keeps both sections). Keep Shopify's own row hidden.

Check. On a product page, the browser's console says recapi: the page hides #recapi-recommendations when something else in the theme hides the box. While views arrive and no row asked for a list, the quick start's Request recommendations line warns "… events from your shop, but no page asked for recapi's row" and names this fix.

"recapi counts add-to-carts but never an order"

Cause. The pixel isn't connected, or isn't allowed to run under Customer privacy: without it no purchase is counted. With Marketing ticked there, it runs only for shoppers who accept marketing too.

Fix. In Settings → Customer events, open the recapi pixel and set Customer privacy as in step 3, then Save and Connect. Place a test order from a browser marked by the quick start's link: it is then left out of your numbers.

Check. As in orders are not counted. When your views carry a visitor id, the Purchases line may instead warn "purchases arrive without a visitor id".

Cause. recapi keeps a visitor id only for visitors Shopify reports as accepting Analytics. If your cookie banner offers no Analytics choice, events arrive without an id and every visitor sees popular items.

Fix. In Settings → Customer privacy, check that your cookie banner offers Analytics, and that the pixel is connected with Analytics. Then accept the banner on your shop and view a product.

Check. Send your first events shows the visitor id warning. See also the quick start's privacy notes.

Settings

The snippets have no settings of their own. What you can change:

  • Heading. Put one, such as "You may also like", in the same Custom Liquid section, right above the div: screen readers announce the row by it. None by default.
  • Look. Rules of yours in the theme's CSS for #recapi-recommendations (a, img, .recapi-price) win over the default look.
  • Sales. A product whose every variant has a compare-at price above its price shows it struck through (.recapi-was), your own figure: recapi computes no reduction.
  • "Often bought together". The theme snippet's boughtTogether line sets its title; false turns it off.
  • Placements and lift test. Set them on your dashboard; the row's placement names are in concepts. An older snippet (one with count: 6 in it) names every row default and asks for 6 products to show 4, so 2 count as shown unseen: paste the new one from your quick start. Your settings and a running lift test carry over.