Guides
Ecommerce

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.

  1. In Skro, go to Custom conversions and select Create Conversion.

Skro Custom Conversions page with the Create Conversion button highlighted

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

Add To Cart custom conversion with the AddToCart event name and traffic source postback enabled

  1. 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.

Initiate Checkout custom conversion with the InitiateCheckout event name

  1. 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.

Purchase custom conversion with approved conversions, total conversions, revenue, and payout forwarding enabled

  1. 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.

Page Views custom conversion with the PageView event name

  1. 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.

View Contents custom conversion with the ViewContent event name

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.

Renews custom conversion with the Renew event name, approved conversions and revenue enabled, and traffic source postbacks disabled

Step 2. Add Shopify integration

  1. In Skro, open Integrations and select the E-Commerce tab.

  2. In Revenue sync · E-Commerce, select Add Integration.

Skro Integrations page with the E-Commerce tab and Add Integration button highlighted

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

Shopify selected in the Choose your store dialog

  1. Enter a recognizable Integration Name for your Shopify store.

  2. Enter your Shop ID. You can find it in your Shopify admin → Settings. It looks like this: xxxxx.myshopify.com.

Shopify Integration step 3.1

  1. 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.

Shopify Integration step 3.2

  1. When finished, click Save & Close.

Shopify integration form with Integration Name, Shop ID, Webhook ID, and 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.

  1. Go to your Shopify admin → Settings → Notifications → Webhooks and click Create Webhook.

  2. Create a webhook for Checkout creation:

Shopify webhook 1

  1. Create another webhook for Order creation:

Shopify webhook 2

  1. (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 ce parameter.

Skro campaign setup with Purchase and the conversion pixel highlighted

  1. Standard postback webhook setup:

Shopify webhook 4

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.

  1. Go to your Shopify admin → Settings → Customer Events and click Add custom pixel.

Custom pixel setup 1

  1. Add your pixel name: Add To Cart Pixel

  2. Analytics and Marketing needs to be selected.

Custom pixel setup 2

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

Custom pixel setup 3

  1. 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));
});
  1. Click Save and Connect this pixel with your store.

PageView event

  1. Add new pixel with name: Page View Pixel

  2. 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));
});
  1. Click Save and Connect this pixel with your store.

ViewContent event

  1. Add new pixel with name: View Content Pixel

  2. 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));
});
  1. Click Save and Connect this pixel with your store.

Step 5. Create a Campaign in Skro

  1. 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.

New Shopify affiliate network with Allow double conversions enabled and Create network button

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.

  1. Add your store as an offer. Go to the Offers view, click Create, and enter your Shopify store details.

  2. Select a workspace.

  3. Enter a name for your store.

  4. 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}

  1. Select Shopify as the affiliate network.

  2. Click Create offer.

New Shopify store offer with skrocid=clickId in the Offer URL and Shopify as the affiliate network

  1. (Optional) If you use a pre-lander, go to the Landings view, click Create, and add your landing page.

  2. Select New Campaign. In Campaign setup, enter a Campaign name, choose a Workspace, and set the country if needed.

  3. 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 Purchase when that is the event configured in your integration.

Skro campaign setup with Purchase and the conversion pixel highlighted

  1. 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.

Skro campaign setup showing campaign details, traffic source, tracking domain, and cost model

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.

  1. Click Continue to open Destination, then select Build flow.

  2. 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.

Skro campaign destination with a landing page and Shopify store offer

  1. 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.

Skro campaign destination with Use only offers enabled and the Shopify store selected

  1. Click Create campaign. If you are updating an existing campaign, the button is Save changes, as shown in these screenshots.

  2. 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.

  3. 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.

  4. Expand Install the Shopify tracking pixel and copy the script for your campaign.

  5. In Shopify admin, open the theme's code editor.

Setup Skro Campaign step 5

  1. Open the theme.liquid file.

  2. Paste the Skro tracking pixel inside the <head></head> section and save the file.

Setup Skro Campaign step 6

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

  1. In Ads manager, select your existing Shopify campaign and choose Duplicate.

  2. 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.

Duplicate campaign setup with an organic campaign name and Do not track cost model

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.

  1. Click Continue. Under Destination, select Build flow, enable Use only offers, and select your Shopify store. Click Create copy to save the separate campaign.

Duplicate campaign destination with the Shopify store offer and Create copy button

  1. 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 trck parameter from this URL.

Campaign links Direct panel showing the Shopify offer URL and trck campaign token

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_TOKEN

YOUR_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.

  1. In the Shopify theme's code editor, open theme.liquid and find the Skro tracking pixel installed in Step 5.

  2. 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.

Setup Skro Organic Campaign step 4

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.

Need help with this guide? Contact Skro support.

On this page

Need help? Contact support ↗