Shopify integration
Connect Shopify with Skro to track store events, attribute purchases and subscription renewals, and report campaign revenue.
Use this guide to connect your Shopify store with Skro and attribute store events to your advertising campaigns.
- See the true ROI of every ad
- Track every PageView, ViewContent, AddToCart, InitiateCheckout and Purchase event
- Report subscription renewals separately from initial purchases
- Compare advertising costs with attributed revenue
- Send supported conversion events to Facebook and TikTok
- Track even Organic traffic
This guide will teach you how to set up Custom Conversions, integrate Shopify, and track campaigns for both paid ads and organic traffic. Please note: this guide does not cover every option available in Skro or your traffic source. You should already have basic knowledge of creating campaigns in both Skro and your traffic source.
Step 1. Set up custom conversion events
Skro supports two types of conversion events:
- Standard Event – Tracks a single event only.
- Custom Conversion Events – Tracks multiple events. (Note: Skro’s custom conversions are not the same as Facebook’s Custom Conversions. You can use standard events as custom conversions in Skro.)
Set up the five events below. If your store sells subscriptions, also add the Renew event. Reporting title controls the name shown in your reports. Event names contains the exact values sent in the ce parameter by the tracking scripts and webhooks in this guide. Type each event name and press Enter to add it.
- In Skro, go to Custom conversions and select Create Conversion.

- Set Reporting title to Add To Cart and add
AddToCartunder Event names. Enable Send postback to traffic source, then select Save & Close.

- Create another conversion with Reporting title set to Initiate Checkout and Event names set to
InitiateCheckout. Enable Send postback to traffic source and select Save & Close.

- Create a conversion with Reporting title set to Purchase and Event names set to
Purchase. Enable Use as Approved conversion, Include in Conversions (All) column, and Include in Revenue column. Under Traffic source postback, enable Send postback to traffic source and Include payout in postback, then select Save & Close.

- Create a conversion with Reporting title set to Page Views and Event names set to
PageView. Enable Send postback to traffic source and select Save & Close.

- Create a conversion with Reporting title set to View Contents and Event names set to
ViewContent. Enable Send postback to traffic source and select Save & Close.

For the four events before purchase, leave the Reporting checkboxes and Include payout in postback unchecked, as shown in the screenshots. This configuration counts purchases in your conversion and revenue totals while keeping the earlier actions available in their own event columns. Enable Count toward the daily cap or Include in Cost only if you want an event to affect those calculations.
Keep the event names used in your Shopify scripts and webhook URLs matched to Event names in Skro, including capitalization. If your ad platform expects a different event name, configure the mapping on the Skro traffic source. Custom conversion mappings
Track subscription renewals with Renew
If your store sells subscriptions, go to Custom conversions → Create Conversion. Set Reporting title to Renews, enter Renew under Event names, and press Enter.
- Enable Use as Approved conversion, Include in Conversions (All) column, and Include in Revenue column. Renewals will have their own Renews reporting column and contribute to your conversion and revenue totals.
- Leave Count toward the daily cap and Include in Cost unchecked to keep renewals out of those calculations.
- Leave Send postback to traffic source and Include payout in postback unchecked to record renewals in Skro without forwarding them to your ad platform.
Select Save & Close.

Step 2. Add Shopify integration
-
In Skro, open Integrations and select the E-Commerce tab.
-
In Revenue sync · E-Commerce, select Add Integration.

- In Choose your store, select Shopify to open the integration form.

-
Enter a recognizable Integration Name for your Shopify store.
-
Enter your Shop ID. You can find it in your Shopify admin → Settings. It looks like this: xxxxx.myshopify.com.

- Fill in Webhook ID. In your Shopify admin, go to Settings → Notifications → Webhooks, copy your webhook token, and paste it into this field in Skro.

- When finished, click Save & Close.

Your Shopify integration is now successfully connected.
Step 3. Set up Shopify Webhooks
Choose a supported webhook API version. Shopify versions webhook payloads along with its APIs; see Shopify API versioning when reviewing your configuration.
-
Go to your Shopify admin → Settings → Notifications → Webhooks and click Create Webhook.
-
Create a webhook for Checkout creation:
- Event: Checkout creation
- Format: JSON
- URL: https://skrotrack.com/webhook/shopify?ce=InitiateCheckout
- Webhook API version: select a supported version in Shopify

- Create another webhook for Order creation:
- Event: Order creation
- Format: JSON
- URL: https://skrotrack.com/webhook/shopify?ce=Purchase
- Webhook API version: select a supported version in Shopify

- (Optional) If you use standard purchase tracking instead of a Skro Custom Conversion, select Purchase as the Conversion Event Name and choose your Conversion Pixel in Campaign setup (Step 5). Use the standard webhook URL below, without a
ceparameter.

- Standard postback webhook setup:
- Event: Order creation
- Format: JSON
- URL: https://skrotrack.com/webhook/shopify
- Webhook API version: select a supported version in Shopify

How the order webhook handles renewals
Use the same Order creation webhook for purchases and subscription renewals. When an order's source_name contains subscription_contract, Skro automatically uses ce=Renew, even if the webhook URL contains ce=Purchase. Other orders follow the purchase setup you chose above. A separate renewal webhook or pixel is unnecessary.
To attribute a renewal, the order webhook must include a valid Skro click ID in the skrocid order note attribute. Check that your subscription app carries that attribute into renewal orders. Skro uses the renewal order's total and currency for its revenue.
You can replace skrotrack.com with your own custom tracking domain.
Step 4. Add custom pixels for other events
AddToCart Event
You can't track AddToCart events with Webhook, that is why it is needed to install custom tracking pixel.
- Go to your Shopify admin → Settings → Customer Events and click Add custom pixel.

-
Add your pixel name: Add To Cart Pixel
-
Analytics and Marketing needs to be selected.

- Place the custom tracking pixel code to track Add To Cart events.

- Copy the pixel code. You can use your own custom tracking domain and if your event name is different, then change it.
analytics.subscribe('product_added_to_cart', (event) => {
const trackingDomain = "skrotrack.com"
const eventName = "AddToCart"
const cartLine = event.data.cartLine;
const cartLineCost = cartLine.cost.totalAmount.amount;
const cartLineCostCurrency = cartLine.cost.totalAmount.currencyCode;
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) {
return parts.pop().split(';').shift();
}
return null;
}
let clickId = getCookie("skro-click-id") || sessionStorage.getItem("skro-click-id");
if (!clickId) {
return;
}
const url = `https://${trackingDomain}/postback?clickId=${encodeURIComponent(clickId)}&payout=${encodeURIComponent(cartLineCost)}&payoutCurrencyCode=${encodeURIComponent(cartLineCostCurrency)}&ce=${eventName}`;
fetch(url, {method: 'GET', keepalive: true}).catch(err => console.error("Skro tracking pixel error:", err));
});- Click Save and Connect this pixel with your store.
PageView event
-
Add new pixel with name: Page View Pixel
-
Copy the pixel code. You can use your own custom tracking domain and if your event name is different, then change it.
analytics.subscribe('page_viewed', (event) => {
const urlParams = new URLSearchParams(window.location.search);
const clickId = urlParams.get('skrocid');
const trackingDomain = "skrotrack.com"
const eventName = "PageView"
if (!clickId) {
return;
}
const url = `https://${trackingDomain}/postback?clickId=${encodeURIComponent(clickId)}&ce=${eventName}`;
fetch(url, {method: 'GET',keepalive: true}).catch(err => console.error("Skro tracking pixel error:", err));
});- Click Save and Connect this pixel with your store.
ViewContent event
-
Add new pixel with name: View Content Pixel
-
Copy the pixel code. You can use your own custom tracking domain and if your event name is different, then change it.
analytics.subscribe('product_viewed', (event) => {
const urlParams = new URLSearchParams(window.location.search);
let clickId = urlParams.get('skrocid');
const productTitle = event?.data?.productVariant?.product?.title || "Unknown product name";
const trackingDomain = "skrotrack.com"
const eventName = "ViewContent"
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) {
return parts.pop().split(';').shift();
}
return null;
}
if (!clickId) {
clickId = getCookie("skro-click-id") || sessionStorage.getItem("skro-click-id");
}
if (!clickId){
return;
}
const url = `https://${trackingDomain}/postback?clickId=${encodeURIComponent(clickId)}&ce=${eventName}&p1=${encodeURIComponent(productTitle)}`;
fetch(url, {method: 'GET',keepalive: true}).catch(err => console.error("Skro tracking pixel error:", err));
});- Click Save and Connect this pixel with your store.
Step 5. Create a Campaign in Skro
- In Skro, open Affiliate networks, click Create, and select Shopify. In New affiliate network, choose a Workspace and enter a recognizable Name. Under Conversion settings, enable Allow double conversions if you use standard conversions and want to accept more than one purchase from the same click ID. Custom conversion reporting is configured separately in Step 1. Click Create network.

The network screenshot uses a local test domain in its generic Postback URL. For Shopify, configure the Shopify webhook URLs from Step 3 with your production tracking domain.
-
Add your store as an offer. Go to the Offers view, click Create, and enter your Shopify store details.
-
Select a workspace.
-
Enter a name for your store.
-
In Offer URL, enter your store URL with the Skro Click ID parameter:
?skrocid={clickId}. If the URL already has query parameters, append&skrocid={clickId}instead.
https://skro.myshopify.com/?skrocid={clickId}
-
Select Shopify as the affiliate network.
-
Click Create offer.

-
(Optional) If you use a pre-lander, go to the Landings view, click Create, and add your landing page.
-
Select New Campaign. In Campaign setup, enter a Campaign name, choose a Workspace, and set the country if needed.
-
Select your integrated Traffic Source, such as Facebook. To send conversions through its Conversion API, choose the Conversion Event Name and Conversion Pixel configured for that ad account. For purchases, select
Purchasewhen that is the event configured in your integration.

- Choose your Tracking domain and Cost model. Select Automatic to import costs through your connected traffic source or supported URL parameters. Use Do not track when you do not want automatic cost tracking for this campaign.

These setup screenshots use a local test domain and Do not track. For a live paid campaign, select your configured production tracking domain and use Automatic if you want to import ad spend. Copy the event and pixel settings from your own integration.
-
Click Continue to open Destination, then select Build flow.
-
If visitors should see a landing page before reaching your store, leave Use only offers off. Select your landing under Landings and your Shopify store under Offers. Configure the landing page's offer links so its buttons send visitors to the store through Skro.

- To send visitors straight to your store, enable Use only offers and select your Shopify store under Offers. You do not need to add a landing page for this route.

-
Click Create campaign. If you are updating an existing campaign, the button is Save changes, as shown in these screenshots.
-
Open Campaign links and select Shopify. Choose Shopify Redirect to send visitors through a Skro campaign link, or Shopify Direct to use your store URL directly in ads. Shopify Direct is available for a store-only route using Use only offers.
-
For Shopify Redirect, copy the Campaign tracking URL. For Shopify Direct, open Choose your Shopify store, select the store offer, and copy the generated Offer URL. Use the URL for your chosen tracking method in your ads.
-
Expand Install the Shopify tracking pixel and copy the script for your campaign.
-
In Shopify admin, open the theme's code editor.

-
Open the theme.liquid file.
-
Paste the Skro tracking pixel inside the
<head></head>section and save the file.

Use the generated URL for your selected tracking method in your ads. Redirect tracking records the visit through the Skro campaign link. Direct tracking uses your store URL with its campaign parameters and the installed Shopify tracking pixel. Keep the Shopify webhooks from Step 3 enabled so orders and checkout events can be matched to visits.
Get started with Facebook integration
Step 6. Track Shopify Organic Traffic
-
In Ads manager, select your existing Shopify campaign and choose Duplicate.
-
In Campaign setup, give the copy a recognizable name, such as My first Shopify campaign - ORGANIC, and choose its workspace. Create or select a separate Organic traffic source and set Cost model to Do not track.

The screenshot shows the campaign immediately after duplication, with its copied Facebook traffic source still selected. Change Traffic Source to Organic before saving. Adding “ORGANIC” to the campaign name alone does not change its traffic source.
- Click Continue. Under Destination, select Build flow, enable Use only offers, and select your Shopify store. Click Create copy to save the separate campaign.

- Open Campaign links for the saved organic campaign. Select Shopify → Shopify Direct, choose your store, and copy its generated Offer URL. You need the value of the
trckparameter from this URL.

The screenshot shows the Direct → Choose your offer panel, which also exposes the offer URL and its trck value. Use the Shopify panel for the Shopify-specific pixel and webhook instructions. Check that the saved campaign uses your Organic source before copying its token.
For example, a generated URL contains this parameter:
https://your-store.myshopify.com/?trck=YOUR_ORGANIC_CAMPAIGN_TOKENYOUR_ORGANIC_CAMPAIGN_TOKEN is a placeholder. Copy the actual trck value from your own generated URL, without trck= or any following & parameters. Preserve the complete value, including any trailing = characters.
-
In the Shopify theme's code editor, open theme.liquid and find the Skro tracking pixel installed in Step 5.
-
In its configuration, replace the organicCampaignToken value with your copied token and save. Update the existing pixel rather than installing a second copy.
Visits without a campaign token in the URL can now use this organic campaign as the pixel's fallback. To verify it, open your store without ad parameters in a private browser window with no existing Skro tracking cookie, then check the organic campaign's visits in Skro.

Get started with Facebook integration
Verify the setup
Follow a campaign link and complete a test conversion using your provider’s test workflow. Confirm that the original click ID reaches the provider and is returned to Skro, then check the event and revenue in your campaign report.
For subscriptions, test an initial purchase and a renewal from a tracked visit. In Skro, check that the initial order appears as a purchase and the renewal appears under Renews with the expected revenue. If the renewal is missing, check that its order webhook includes skrocid and that the custom conversion accepts Renew.
Troubleshooting
If data is missing, check the selected workspace, integration, campaign, and reporting date range. Compare parameter names and macro values with the examples in this guide before repeating the test.
Related guides
Need help with this guide? Contact Skro support.