Revshare integrates seamlessly with Shopify to track affiliate sales. When a customer visits your store through an affiliate link and makes a purchase, the affiliate automatically earns their commission.
The integration uses Shopify webhooks to receive order notifications in real-time, ensuring accurate and instant tracking.
- Real-time order tracking via webhooks
- Automatic commission calculation based on order value
- Works with custom domains and Shopify subdomains
- Supports all Shopify plans
Overview
The Shopify integration consists of three main components:
- Store Connection — Authorize Revshare to access your Shopify store
- Webhook Setup — Create a webhook in Shopify to notify us of new orders
- Tracking Script — Add a script to your theme to capture affiliate referrals
Prerequisites
Before starting, make sure you have:
- A Shopify store with admin access
- A Revshare account with a program created
- Access to edit your Shopify theme code
Step 1: Connect Your Shopify Store
Start by connecting your Shopify store to Revshare:
- Go to your program's Setup page in the Revshare dashboard
- Select Shopify as your integration
- Enter your Shopify shop domain (e.g.,
mystorefor mystore.myshopify.com) - Click Connect Shopify to authorize the connection
Not sure what your Shopify shop domain is? See our guide on What is a Shopify Domain?
You'll be redirected to Shopify to approve the connection, then back to Revshare.
Step 2: Create the Webhook
Create a webhook in Shopify to notify Revshare when orders are paid:
- In Shopify Admin, go to Settings → Notifications
- Scroll to the bottom and click Create webhook
- Set Event to:
Order payment - Set Format to:
JSON - Set URL to:
https://www.revshare.so/api/shopify/webhook - Click Save
Important: After creating the webhook, copy the Signing secret shown at the top of the webhooks section. You'll need to paste this in Revshare to verify webhook authenticity.
For detailed webhook instructions, see our Shopify Webhook Setup Guide.
Step 3: Add the Tracking Script
For detailed step-by-step instructions on adding the tracking script, see our Shopify Tracking Script Setup Guide.
Add the Revshare tracking script to your Shopify theme to capture affiliate clicks:
- In Shopify Admin, go to Online Store → Themes
- Click ... → Edit code on your active theme
- Open
theme.liquidin the Layout folder - Paste the tracking script just before the closing
</head>tag - Click Save
<script async src="https://www.revshare.so/shopify-tracking.js" data-program-id="YOUR_PROGRAM_ID" data-domain=".yourdomain.com" data-cookie-duration="30" ></script>
Replace the values with your actual program settings:
data-program-id— Your Revshare program IDdata-domain— Your cookie domain (e.g.,.mystore.com)data-cookie-duration— Days the affiliate cookie should last
Tip: If your store uses a password page, also add the script to password.liquid to track visitors even before your store launches publicly.
Testing Your Setup
To verify everything is working:
- Create a test affiliate in your Revshare dashboard
- Visit your store using the affiliate's tracking link (e.g.,
yourstore.com?ref=test) - Check that the
refcookie is set in your browser - Place a test order (you can cancel it after)
- Check Revshare to see if the sale was tracked
Troubleshooting
Orders not appearing in Revshare
- Verify the webhook URL is correct:
https://www.revshare.so/api/shopify/webhook - Check that the webhook event is set to
Order payment - Ensure you've saved the webhook signing secret in Revshare
Affiliate not getting credited
- Confirm the tracking script is installed correctly
- Check the browser for the
refcookie - Verify the cookie domain matches your store domain
Webhook verification failing
- Double-check the signing secret is correctly copied
- Make sure there are no extra spaces in the secret
Need more help? Check out our webhook setup guide or contact support.
