In this article, we will cover:
Overview
We offer two options for integrating Shopify with Tapfiliate:
The plug-in integration using the official Shopify app
The code-based integration using a custom pixel setup
Both methods allow you to track affiliate clicks, attribute conversions, reward affiliates, and monitor performance in real time from your Tapfiliate dashboard.
Pros and Cons of Each Integration Method
Shopify App (Plug-in Integration)
Pros:
Easy setup
No coding
Recommended for standard Shopify stores
Automatically tracks clicks and conversions
Ideal for using one Shopify store with one Tapfiliate account
Cons:
Supports one store per Tapfiliate account
Limited flexibility for custom tracking rules
Custom Pixel (Code-Based Integration)
Pros:
Allows multiple Shopify stores to be connected to one Tapfiliate account
Flexible for advanced tracking configurations
Supports custom commission logic and identifiers
Cons:
Requires adding code in Shopify settings
Incorrect placement can affect tracking
Off-site or subscription checkouts may require further customization
Prerequisites
To successfully integrate, ensure you have the following:
A live Tapfiliate account with access to your account ID
Access to your Shopify store’s admin dashboard
(For custom code setup) Admin permission to add Custom Pixels or code in Shopify settings
Any affiliate coupon codes pre-created in Shopify, if you wish to use them for tracking
Initial setup
You can choose either the plug-in setup or the custom pixel setup. Do not use both at the same time.
Option 1: Set up plug in Integration
Step 1: Install the Tapfiliate App
Go to Shopify admin > Apps > Visit Shopify App Store > search for Tapfiliate > Add app > Install.
Step 2: Connect Your Tapfiliate Account
Open the Tapfiliate app inside Shopify, log in, and paste your Tapfiliate Account ID.
Step 3: Enable Tracking
Turn on Auto-track orders and save your settings.
2. Log in and connect your Shopify store following the Tapfiliate onboarding steps.
Option 2: Set up Code-Based (Custom Pixel) Integration
Step 1: In Shopify admin, navigate to:
Settings > Customer events > Add custom pixel.
Step 2: Name your pixel and press “Add pixel.”
Set permissions to “Required”
Check “Marketing” and “Analytics”
For Data Sale, choose “Data collected does not qualify as data sale.”
Step 3: Paste the Tapfiliate tracking code in the “code” section:
window.self = window.top;
const script = document.createElement('script');
script.setAttribute('src', 'https://script.tapfiliate.com/tapfiliate.js');
script.setAttribute('async', '');
document.head.appendChild(script);
(function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
(t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');
tap('create', 'YOUR ACCOUNT ID', { integration: "shopify" });
tap('detect');
analytics.subscribe('checkout_completed', (event) => {
const checkout = event.data.checkout;
const order_currency = checkout.totalPrice.currencyCode;
const order_price = checkout.subtotalPrice.amount
const order_id = checkout.order.id;
const email = checkout.email;
const discount_codes = checkout.discountApplications.map((discount) => {
if (discount.type === 'DISCOUNT_CODE') {
return discount.title;
}
});
tap('conversion', order_id, order_price, {
coupons: discount_codes,
currency: order_currency,
customer_id: email,
});
});
Remember to replace 'YOUR_ACCOUNT_ID' with your unique Tapfiliate account ID and press ‘connect’. This code snippet is crucial for configuring Tapfiliate, enabling its smooth integration with Shopify.
Advanced or Optional Features
1. Set up Multiple Commission Types by Product/SKU
You can reward different commission amounts for specific product categories or SKUs. The commission type feature allows you to offer varying commission rates for different products, which can be useful for boosting sales of specific items. For instance, to expedite the sale of a product during a flash sale, you could set a higher commission for that item.
To do so, first, create commission type identifiers in your Tapfiliate account. Then, in your Shopify tracking code, add the identifier field to the conversion event, for example:
tap('conversion', order_id, order_price, COMMISSION-TYPE-IDENTIFIER, {
coupons: discount_codes,
currency: order_currency,
customer_id: email,
});
Replace COMMISSION_TYPE_IDENTIFIER with your designated commission type for the product or category. This enables advanced commission logic per order.
2. Set up Coupon Code Tracking
To track coupon code usage, assign unique coupon codes to affiliates within Tapfiliate and ensure they are mirrored in Shopify. When these codes are used during checkout, their usage will be automatically tracked and attributed for conversion credit.
In Tapfiliate, each affiliate can be exclusively assigned their own unique coupons. You can directly go to affiliates> click on your affiliate and assign a coupon to them.
In Shopify, navigate to the “Discounts” section and create a new discount code. This discount code should match the code assigned to the affiliate.
Testing and Verification
To verify your Shopify-Tapfiliate integration, follow these steps:
Create a Test Affiliate: Set up a test affiliate account in Tapfiliate.
Make a Test Purchase: Using the test affiliate's referral link, complete a purchase in your Shopify store. (Link with article: How to validate tracking)
Confirm Tracking: Check the Tapfiliate dashboard to ensure that the click and conversion are successfully tracked.
Troubleshoot (If Needed): If conversions aren't appearing, review the installation steps and consult and follow the troubleshooting guide.
Still need help?
If you have any questions or if something in this guide is unclear, please don't hesitate to contact us at support@tapfiliate.com. We're happy to assist!
