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
  • Permissions
  • SDK Initialization
  • Track Conversions
  • Track Conversion (Automatic)

Was this helpful?

  1. Network
  2. SDK

Android SDK

PreviousCookieless TrackingNextNode SDK

Last updated 12 months ago

Was this helpful?

Get started

To start tracking using Offer18's Android SDK, you'll need to integrate the SDK into your application as a dependency.

For Gradle in Kotlin, Add dependencies in the build.gradle.kts file

implementation("com.offer18:android-sdk:{VERSION}")

For Gradle in Groovy, Add dependencies in the build.gradle file

implementation 'com.offer18:android-sdk:{VERSION}'

You must replace {VERSION} with latest stable version of Offer18's Android SDK

Find out latest stable version of Android SDK


Permissions

Make sure your app has permissions given below

<uses-permission android:name="android.permission.INTERNET"/>


SDK Initialization

Import Offer18 Class from com.offer18.sdk package

import com.offer18.sdk.Offer18;

To initialize the Software Development Kit (SDK) insert the provided code snippet in your application code.

Offer18.init(getApplicationBaseContext(), "{DOMAIN}", "{ACCOUNT_ID}","tid_key_in_referrer_url");
  • Replace {DOMAIN} with your tracking domain.

  • Replace {ACCOUNT_ID} with your Account ID.

  • Replace tid_key_in_referrer_url With your own parameter key for tid


Track Conversions

Import Offer18 Class from com.offer18.sdk package

import com.offer18.sdk.Offer18;

To activate conversion tracking with Offer18's Android SDK, you'll need to insert a specific code snippet onto the order success page (Thank You Page) of your app.

Map<String, String> args = new HashMap<>();  
args.put("o", ""); // 0000000 (Offer ID)
args.put("tid", "");  // x-xxxx-xxxxxx-xxxxxx (Click ID)
args.put("event", ""); // install
args.put("adv_sub1", ""); 
args.put("adv_sub2", "");
args.put("adv_sub3", "");
args.put("adv_sub4", "");
args.put("adv_sub5", "");
args.put("coupon", "");
args.put("sale", "");
args.put("payout", "");
Offer18.trackConversion(args);


Track Conversion (Automatic)

Import Offer18 Class from com.offer18.sdk package

import com.offer18.sdk.Offer18;

If you prefer not to fetch Referrer details to obtain the click ID, you can utilize Offer18's Click ID key in the configuration.

Initialize SDK

To initialize the Software Development Kit (SDK) insert the provided code snippet in your application code.

Offer18.init(getApplicationBaseContext(), "{DOMAIN}", "{ACCOUNT_ID}","tid_key_in_referrer_url");

Complete Conversion

Map<String, String> args = new HashMap<>();  
args.put("o", ""); // Offer ID  
args.put("tid", "{REFERRER_TID}"); // Auto fill TID
args.put("event", ""); // install
args.put("adv_sub1", "");
args.put("adv_sub2", "");
args.put("adv_sub3", "");
args.put("adv_sub4", "");
args.put("adv_sub5", "");
args.put("coupon", "");
args.put("sale", "");
args.put("payout", "");
Offer18.trackConversion(args);

The "{REFERRER_TID}" will automatically retrieve the click ID from the Referrer URL and include it in the trackConversion.

  • TID will be detected automatically based on key value provided during SDK initialization

  • Replacement will occur when micro {REFERRER_TID} is detected

  • trackConversion will be fail if

    • No manual tid provided,

    • No tid detected using referral url

    • tid detected but no macro provided

    • Macro provided but no tid or empty tid detected from referrer url

Maven Central: com.offer18:android-sdkMaven Central
Logo