SDKs
Shopify
The theme embed and checkout pixel: tests on your store and purchases as goals, without theme code.
The LiftCanary app for Shopify puts the website snippet on your storefront without editing theme code, and reports cart, checkout and purchase events, which theme code can't see, as goals. Everything else works as on any website: no-code and redirect tests, the visual editor, personalizations, flags and audiences.
Install the app and connect your project
Install LiftCanary from the Shopify App Store and open it from your admin. Paste the SDK key of the environment to use (LiftCanary → Install, the key starting with
pk_) and save. This installs the checkout pixel.Switch on the snippet in your theme
Open the theme editor from the app. Under App embeds, turn on LiftCanary, paste the same SDK key and save the theme.
Add the goals
In LiftCanary, add goals for the events below (Goals → New goal, “From your code”, with the event key), then use them in experiments.
Events from the checkout#
| Event key | When | Value |
|---|---|---|
purchase | An order is placed (checkout completed) | Order total, in the order's currency |
begin_checkout | Checkout starts | Checkout total |
add_payment_info | Payment details are submitted | Checkout total |
add_to_cart | A product is added to the cart | Line total |
product_view | A product page is viewed | Variant price |
Use purchase as a conversion goal for conversion rate, and as an average-per-visitor goal for revenue per visitor. Events carry currency, order_id and product_id properties. A store selling in several currencies should compare revenue within one market, using an audience on shopify_market.
Theme embed settings#
| Setting | What it does |
|---|---|
| Hide the page until tests are applied | The anti-flicker style: no flash of the original page in no-code tests. On by default; the page always shows within 1.5 s. |
| Recognize logged-in customers | Logged-in customers are identified as shopify:<customer id>, so they keep their variation on every device. On by default. |
| Wait for cookie consent | Nothing is stored or sent until the visitor allows analytics in Shopify's cookie banner (Customer Privacy API). |
| Snippet URL, Events URL | Only for self-hosted LiftCanary or a first-party proxy. |
The embed also sets these attributes for audiences: shopify_customer (logged in or not), shopify_customer_tags, shopify_template (product, collection, cart…), shopify_currency and shopify_market.
One person from product page to order#
The pixel sends events under the snippet's anonymous id. When the buyer is a known customer, it sends them as shopify:<customer id> and links the anonymous id to it, so the visitor who saw a test and the customer who paid are counted as one person, also when they log in only at checkout.
Privacy#
The pixel only runs for visitors who allow analytics. It sends order totals, currency and product and order ids, never names, addresses, emails or payment details. The app itself stores nothing about your shop or customers. Delete a visitor's data in LiftCanary under Project settings → A visitor's data.