Offer18 Knowledge Base
  • Welcome!
  • Network
    • Offers
      • Create New Offer
      • Advertiser URL Builder
      • Tracking URL Macros
      • Offer - General
      • Offer - Targeting
      • Offer - Targeting Rules
      • Offer - Creatives
      • Offer - Assign Affiliates
      • Offer - Capping Rules
      • Offer - Events
      • Offer - Payout Rules
      • Offer - Anti-Fraud
      • Offer - Fallback / JS Integration
      • Create CPS offer
      • Revenue Share Offer
      • Smart Offer
      • Deep Link
      • Pre-landing Page
      • Offer Categories
      • Coupons
      • Suppression List
      • Retargeting Tag
    • Affiliates
      • Create Affiliate
      • Affiliate Profile
      • Affiliate Employee
      • Manage Affiliates
      • Manage Offers
      • Generate Tracking URL
      • Affiliate Global Postback
      • Affiliate Postback Test
      • API Access Manage
      • Log in Affiliate Account
      • Reset Password
      • Affiliate Referrals
    • Advertisers
      • Create Advertiser
      • Advertiser Profile
      • Advertiser's Offers
      • Advertiser Test Link
      • Login as Advertiser
      • Password Reset
    • Postback Integration
    • Integration
      • Shopify
      • Cookieless integration with Shopify
      • WooCommerce
      • Cookieless integration with WooCommerce
    • Mobile Attribution Integration
      • AppsFlyer
        • Global Attribution URL
        • AppsFlyer Normal Postback
        • Advanced Privacy Postback
        • AppsFlyer - Click Signing
      • Adjust
      • Branch
      • Singular
      • Kochava
    • Reports
      • Reports
      • Reports - KPI
      • Reports - Templates
      • Conversion Logs
      • Affiliate Postback Logs
      • Advertiser Postback Logs
      • Capping Logs
    • Account Configuration
      • General Settings
      • Tracking Settings
      • Custom Appearance
      • SMTP Settings
      • Affiliate Settings
      • Advertiser Settings
    • Employees
      • Create Employee Account
      • Custom - Permissions
      • Clone Permissions
      • Additional Access
    • Tools
      • Mailer
      • Import Data
        • Import Affiliates
        • Import Affiliate Postback
        • Import Advertisers
        • Import Offers
        • Import Conversions
      • Offer Sync
        • Offer Sync Guide
        • Sync Logs
      • Product Feed
      • Automation
      • Link Tester
      • Fraud Detection
        • Fraud Fender
        • Conversion Risk Monitor
        • 3rd Party Integrations
    • Network API
      • Offers API
      • Offer Create API
      • Conversion API
      • Reports API
      • Affiliate & Advertiser Login API
      • Affiliate & Advertiser Create API
      • Affiliate & Advertiser Password Reset
    • FAQ's
      • How to define event price in Payout Rule?
      • How to define affiliate specific payout in Payout Rules?
      • How to view Click logs?
      • What are different status in Advertiser Postback logs?
      • Why Domain have been flagged for SPAM?
      • What are different Affiliate Tracking URL Parameters?
    • SDK
      • Web SDK
      • Cookieless Tracking
      • Android SDK
      • Node SDK
    • Probabilistic Attribution
  • Universal
    • IPs Whitelist
    • Common Values
  • Affiliate
    • Affiliate API's
      • Offers API
      • Request Offer API
      • Reports API
      • Coupon API
      • OTP API
      • SDK - Affiliate Offer Table
    • Integration
      • Google Ads Integration
      • Google Ads Integration - Web SDK
      • Offer18 - Zapier - Google Ads
      • Facebook Ads Integration
      • Facebook Conversion API
      • TikTok Event API
      • Snapchat Conversion API
    • Deep Link
    • Referral Program
  • iGaming
    • iGaming - Create Offer
    • iGaming - Events
    • iGaming - Reports
    • iGaming - Postback
    • iGaming - API
      • User API
      • Activity API
    • iGaming - SDK
      • WebSDK
Powered by GitBook
On this page
  • Step 1 : Create Offer
  • Step 2 : Code Placement
  • Collect Data
  • Debug Mode

Was this helpful?

  1. Network
  2. Integration

Cookieless integration with Shopify

PreviousShopifyNextWooCommerce

Last updated 10 months ago

Was this helpful?

Step 1 : Create Offer

For Cookie less tracking, it is mandatory to include click ID parameter and token in the Offer URL and also for all the landing pages while creating an offer in Offer18 dashboard.

Example
https://shopurl.com/?<YOUR-CLICK-ID-PARAMETER>={tid}


Step 2 : Code Placement

  1. From your Shopify admin, go to "Settings"

  2. Navigate to "Customer events" » "Add Custom Pixel"

  3. Enter the "Pixel name" and then click "Add pixel"

  4. Remove the existing content from the "Code" section

  5. Now, place the script given below in the "Code" section

analytics.subscribe("page_viewed", (event) => {
  const sdkScript = document.createElement('script');
  sdkScript.setAttribute('src', 'https://web-resources.offer18.net/sdk/web/WebSDK.js');
  sdkScript.setAttribute('async', '');
  document.head.appendChild(sdkScript);
  sdkScript.onload = function () {
    // window.Offer18WebSDK.activateDebugMode(); 
    window.Offer18WebSDK.initializeConversion('<YOUR-CLICK-ID-PARAMETER>');
  };
  sdkScript.onerror = function () {
    console.error('Failed to load the Offer18 Web SDK.');
  };
});

analytics.subscribe('checkout_completed', (event) => {
  var discountString;
  var totalAmount = event.data.checkout.totalPrice.amount;
  var orderID = event.data.checkout.order.id;
  var currency = event.data.checkout.currencyCode;
  var allDiscountCodes = event.data.checkout.discountApplications.map((discount) => { if (discount.type === 'DISCOUNT_CODE') { return discount; } });
  if (allDiscountCodes.length > 10) { discountString = ''; } else { discountString = allDiscountCodes.map((item) => item.title).join(','); }
  const sdkScript = document.createElement('script');
  sdkScript.setAttribute('src', 'https://web-resources.offer18.net/sdk/web/WebSDK.js');
  sdkScript.setAttribute('async', '');
  document.head.appendChild(sdkScript);
  sdkScript.onload = function () {
    // window.Offer18WebSDK.activateDebugMode();
    window.Offer18WebSDK.trackConversion({
      domain: '<YOUR-POSTBACK-DOMAIN>',
      accountId: '<YOUR-ACCOUNT-ID>',
      offerId: '<CAMPAIGN-ID>',
      postbackType: 'ajax',
      coupon: `${discountString}`,
      conversionData: {
        sale: `${totalAmount}`,
        currency: `${currency}`,
        adv_sub5: `${orderID}`,
      }
    });
  };
  sdkScript.onerror = function () {
    console.error('Failed to load the Offer18 Web SDK.');
  };
});

Ensure that the placeholders in the script are replaced with the actual information for the campaign. The placeholders are explained in the table provided below.

Placeholder

Explanation

<YOUR-CLICK-ID-PARAMETER>

This is the clickid parameter used while creating the offer.

<YOUR-POSTBACK-DOMAIN>

Postback domain of the user. (domain)

<YOUR-ACCOUNT-ID>

Offer18 account id of the user. (accountId)

<CAMPAIGN-ID>

Id of the offer. (offerId)

In case of shopify 'postbackType' must be 'ajax'

  1. Go to Save


Collect Data

You can collect conversion data using various Offer18 Postback Parameters

Conversion Data

Offer18 Postback Parameter

Variable to use

Currency

currency

Total Amount of the Order

sale

Order ID of the Order

adv_sub5

Discount Coupons

coupon


Debug Mode

The user can enable debug mode by uncommenting 'window.Offer18WebSDK.activateDebugMode();'

`${currency}`
`${totalAmount}`
`${orderID}`
`${discountString}`