Skip to content
IntegrateShopify

Integrate

Shopify

Connect your Shopify store to your program. Flow Affiliate reads the publisher’s click from each order and reports the sale for you, with no code in your store.

How it works

  1. A publisher's link sends the visitor to your store with fg_click (the click) and fg_ref (the publisher's code) in the address.
  2. The Flow Affiliate tracking app embed keeps them for 30 days in a first-party cookie, and adds them to the visitor's cart. Shopify carries cart attributes onto the order.
  3. When the order is paid, Shopify tells Flow Affiliate. The order becomes events in your program, attributed to the publisher whose click it carries.

Connect your store

In your program, open the Shopify section, enter your store's .myshopify.com address and choose Connect store. Shopify shows what the app may do (read orders and products, manage discounts) and asks you to install it. After that you're back in the program, connected.

  • Owners, admins and developers can connect a store. Approve it in Shopify within 10 minutes, in the same browser.
  • One store per program, and a store belongs to one program. To move it, disconnect it first.
  • The program's app must convert on the web: a store is a website.

Turn on the app embed

The connection alone doesn't put anything in your storefront. In Shopify, open Online Store → Themes → Customize → App embeds, switch on Flow Affiliate tracking and save. Without it, orders carry no click and nothing is attributed.

What is sent, and when

In your storeSent to Flow Affiliate
A paid order that carries a click, from a customer no publisher brought yetuser.registered with the click and code, then purchase.completed
A paid order from a customer a publisher already brought, with or without a clickpurchase.completed
A paid order without a click, from anyone elseNothing
A refundpurchase.refunded, see refunds

A customer belongs to the publisher whose click brought their first attributed order, the same as a sign-up in an app. Their later orders count for that publisher too.

appUserIdstring

shopify:<customer id>. A guest checkout has no customer, so each guest order is its own user: shopify-guest:<order id>.

eventIdstring

shopify-order:<order id> for the purchase and shopify-refund:<refund id> for a refund. The sign-up is registered:<appUserId>:<click id>.

amountinteger

The order's subtotal after discounts, before shipping, tax, duties and tips, in your store's currency, in minor units. When your prices include tax, the tax on the items is taken out. Goods for $150.00 with a 10% discount, $8.00 shipping and $10.80 tax: 13500.

metadataobject

source: "shopify", shop, orderId, orderName (such as #1042), quantity (items ordered) and discountCodes when the order used any. The sign-up also has country when the order has an address.

Flow Affiliate stores no names, email addresses, phone numbers or street addresses. Payout rules work as for any app: a percentage line on purchase.completed pays a share of amount.

Refunds

Flow Affiliate reverses a purchase as a whole. When every item of an order has been refunded, in one refund or several, the last refund is sent with reversesEventId: "shopify-order:<order id>". That takes back what the purchase earned while it is still pending or approved; money already paid out is flagged for review instead, as described under reversals.

A partial refund is recorded as purchase.refunded without reversesEventId, so the commission stays. So does a refund of money without items, such as a goodwill refund. A cancelled order that Shopify refunds counts as a refund.

Discount codes

A discount code never attributes an order on its own. Publishers choose their own codes, so a store-wide code such as SUMMER10 could match one of them, and that publisher would be credited for every order that used it. The codes an order used are in metadata.discountCodes, so you can see them, and only the click decides who brought the customer.

Disconnecting

Disconnect in Flow Affiliate removes the app from your store. Uninstalling the app in Shopify disconnects it in Flow Affiliate too. Either way, what was already reported stays, with its earnings.

When a customer asks Shopify to erase their data, or 48 hours after you uninstall the app, Flow Affiliate replaces the Shopify ids in your program's records with a pseudonym that can't be traced back. Amounts and dates stay, for the books.

Testing

  1. Use a development store with test payments switched on (Shopify's Bogus Gateway).
  2. Connect it to the program and turn on the app embed.
  3. Open a publisher's link, or one of your own test links, and buy something with the test gateway.
  4. Open the program's event list: the order arrives in the sandbox as a sign-up and a purchase, with its amount. Refund it in Shopify and a refunded purchase follows.