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
  • Get started
  • Track Clicks
  • Track Impressions
  • Track Conversions
  • Debug Mode

Was this helpful?

  1. Network
  2. SDK

Web SDK

Get started

To start tracking with Offer18's web SDK, one needs to add a script tag in the website.

Placement : Header (All Pages)

<script src="https://web-resources.offer18.net/sdk/web/WebSDK.js"></script>


Track Clicks

To track clicks using the SDK, add the following code to your script.

Placement : Header (All Pages)

<script>
    window.Offer18WebSDK.trackClick({
        trackingURL: '<YOUR-TRACKING-LINK>',
        keymapping: ['<OFFER18-PARAMETER>:<YOUR-PARAMETER>', '<OFFER18-PARAMETER>:<YOUR-PARAMETER>',...]
    });
</script>
  1. trackingURL (Mandatory) : Tracking URL which can be extracted from Offer18 dashboard.

  2. keymapping : is an array of Offer18 parameters and Native parameters in a format of <OFFER18-PARAMETER>:<YOUR-PARAMETER>. User can replace <OFFER18-PARAMETER> with Offer18 Parameters like aff_sub1, aff_sub2 and <YOUR-PARAMETER> with their parameters in which user is getting values from their network.

Example code

<script>
    window.Offer18WebSDK.trackClick({
        trackingURL: 'https://example.o18.click/c?o=0000000&m=0000',
        keymapping: ['a:<YOUR-PARAMETER>']
    });
</script>

In above example a is Affiliate ID in Key Mapping


Track Impressions

To track impressions using the SDK, add the following code to your script

Placement : Header (All Pages)

<script>
    window.Offer18WebSDK.trackImpression({
        impressionURL: '<YOUR-IMPRESSION-URL>',
        keymapping: ['<OFFER18-PARAMETER>:<YOUR-PARAMETER>', '<OFFER18-PARAMETER>:<YOUR-PARAMETER>',...]
    });
</script>
  1. impressionURL (Mandatory) : Impression URL which can be extracted from Offer18 dashboard.

  2. keymapping : is an array of Offer18 parameters and Native parameters in a format of <OFFER18-PARAMETER>:<YOUR-PARAMETER>. User can replace <OFFER18-PARAMETER> with Offer18 Parameters like aff_sub1, aff_sub2 and <YOUR-PARAMETER> with their parameters in which user is getting values from their network.

Example code

<script>
    window.Offer18WebSDK.trackImpression({
        impressionURL: 'https://example.o18.click/i?o=0000000&m=0000',
        keymapping: ['a:<YOUR-PARAMETER>']
    });
</script>

In above example a is Affiliate ID in Key Mapping


Track Conversions

Users must add the following code snippet into all landing pages except Order confirmation / Order Success (Thank you) page.

Placement : Header (All Pages)

<script>
    window.Offer18WebSDK.initializeConversion('<YOUR-CLICK-ID-PARAMETER>');
</script>

After adding the script one needs to add the following script in thankyou/order-confirmation page

Placement : Thank you Page/Order Success Page (One Page)

<script>
    window.Offer18WebSDK.trackConversion({
        domain: '',
        accountId: '',
        offerId: '',
        coupon:'',
        postbackType: '', // 'iframe' or 'pixel'
        isGlobalPixel: false, // true or false
        allowMultiConversion: false, // true or false
        conversionData: {
            event: '', // Event Name (Please specify the event)
            payout: '', // Payout Amount (Please specify the payout amount)
            sale: '', // Sale Amount (Please specify the sale amount)
            currency: '',
            adv_sub1: '',
            adv_sub2: '',
            adv_sub3: '',
            adv_sub4: '',
            adv_sub5: '',
        }
    })
</script>
  1. domain (Mandatory) : Postback domain of the user.

  2. accountId (Mandatory) : Offer18 account id of the user.

  3. offerId (Mandatory) : Id of the campaign.

  4. coupon : Coupon code can be used here

  5. postbackType : It can be either 'iframe' or 'pixel', default value is 'iframe'.

  6. isGlobalPixel : User can configure global pixel by setting this true , default value is false.

  7. allowMultiConversion : User can allow MultiConversion by setting this true , default value is false.

  8. conversionData : This object contains the parameters which can be used to get values from network.

Example code

<script>
    window.Offer18WebSDK.trackConversion({
        domain: 'example.o18.link',
        accountId: '0000',
        offerId: '00000000',
    });
</script>


Debug Mode

To enable debug mode in an SDK, one can add the following code inside your script:

<script>
    window.Offer18WebSDK.activateDebugMode();
</script>

Enabling debug mode allows user to get more detailed information about the working of the SDK, including any errors or debugging messages.

PreviousSDKNextCookieless Tracking

Last updated 1 year ago

Was this helpful?