Shopify sales, joined to the visits behind them.
Virling ties each Shopify order to the visit that came before it, so your store sees which channel, campaign and landing page bring buyers, not just traffic. Open source, one Rust binary, or hosted.
Virling reads Shopify orders and their refunds with the Admin API token of a custom app that can only read orders.
Create a token
- In your Shopify admin, open Settings, Apps and sales channels, Develop apps, and create an app. Shopify's guide: custom apps.
- Under Admin API integration, give it only the
read_ordersscope, then install the app. - In Virling, paste the Admin API access token, which starts with
shpat_, and your store'shttps://your-store.myshopify.comaddress. A custom domain does not work here; the Admin API only answers on the myshopify.com address.
What is imported
- Orders from the last 60 days on the first run, the most Shopify gives without the extra
read_all_orderspermission, then new ones every minute. Paid, partially refunded and refunded orders count; voided ones count as failed; pending and authorized orders wait until they are paid. - Refunds. Every round also reads the orders updated since the last one, so refunds show up within a minute or two.
- Renewals. An order from a Shopify Subscriptions renewal (source
subscription_contract) is marked as a renewal and keeps the channel of the first payment. See Renewals. - Subscription status is not read, so Retention uses payment recency for Shopify customers.
How a payment finds its visitor
Virling reads virling_vid from the order's note attributes. Add this to your theme's theme.liquid, after the Virling script, so the visitor ID is stored on the cart, which Shopify copies onto the order:
<script>
// Shopify: in your theme's theme.liquid, after the Virling script.
// It stores the visitor ID on the cart, and Shopify copies cart
// attributes onto the order as note attributes.
addEventListener("load", function () {
var vid = window.virling && virling.vid && virling.vid();
if (vid) fetch("/cart/update.js", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ attributes: { virling_vid: vid } })
});
});
</script>Frequently asked questions
How do I see Shopify sales by traffic source?
Connect your store to Virling with a custom app token that can only read orders, and add a short snippet to theme.liquid that stores the visitor ID on the cart. Shopify copies it onto the order, and Virling ties the order to the visit before it.
Which Shopify scope does Virling need?
Only read_orders. Virling cannot change products, customers or orders.
How far back does Virling import Shopify orders?
60 days on the first run, the most Shopify allows without the read_all_orders permission, then new orders every minute.
Full reference: Shopify in the docs.