Skip to content

About

Affiliate Marketing for Android Apps.

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Repository files navigation

GoMarketMe

GoMarketMe Affiliate Marketing SDK for Kotlin

Affiliate attribution, referral codes, and in-app purchase reporting for Android apps.

GitHub release

GoMarketMe is an affiliate marketing platform for mobile apps, with affiliate attribution, referral codes, and purchase reporting for Android.

Installation

Add JitPack and Maven Central to your project repositories:

repositories {
    mavenCentral()
    maven(url = "https://jitpack.io")
}

Add GoMarketMe to your app dependencies:

dependencies {
    implementation("com.github.GoMarketMe:gomarketme-kotlin:6.0.2")
}

Usage

GoMarketMe takes only a few lines to set up.

Step 1: Initialize

Import GoMarketMe and initialize the SDK with your GoMarketMe API key:

import co.gomarketme.kotlin.GoMarketMe

private val goMarketMeSDK = GoMarketMe

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        goMarketMeSDK.initialize(this, "API_KEY")
    }
}

Replace API_KEY with your actual GoMarketMe API key. You can find it during onboarding or in Profile > API Key.

Step 2: Sync Purchases (optional but recommended)

GoMarketMe automatically detects and reports purchases. We also recommend manually syncing after Google Play Billing, RevenueCat, Adapty, or another provider confirms a successful purchase. Call it before acknowledging or consuming the purchase if your purchase library controls that step:

lifecycleScope.launch {
    goMarketMeSDK.syncAllTransactions()
}

That's it! GoMarketMe will automatically attribute and report affiliate sales in real time to your dashboard and your affiliates' dashboards.

Optional features

Step 3: Referral Codes

Referral codes work alongside affiliate links when a link isn't practical, such as in conversations, podcasts, videos, events, or print.

GoMarketMe UI: Add the remotely configured referral-code trigger to your Compose UI:

import co.gomarketme.kotlin.GoMarketMeReferralCodeTrigger

GoMarketMeReferralCodeTrigger()

Enable and customize its text, colors, typography, and layout in GoMarketMe Referral Code settings.

Custom UI: If your app provides its own code-entry interface, redeem the code from a coroutine. Redemption waits for initialization when it is already in progress:

val data = GoMarketMe.redeemReferralCode("ASHLEY10")

Redemption throws GoMarketMeReferralCodeException. Use code for messages or UI behavior; the enum distinguishes invalid, expired, inactive, malformed-response, request, network, timeout, initialization, and unknown errors. rawCode, statusCode, and isRetryable are available for logging and retry decisions.

import co.gomarketme.kotlin.GoMarketMeReferralCodeErrorCode
import co.gomarketme.kotlin.GoMarketMeReferralCodeException

try {
    GoMarketMe.redeemReferralCode(code)
} catch (error: GoMarketMeReferralCodeException) {
    if (error.code == GoMarketMeReferralCodeErrorCode.InvalidCode) {
        showError("That referral code is not valid.")
    }
}

Placement: Put the referral-code entry point on the first screen users see after installing the app, ideally during onboarding or immediately afterward.

Learn more about Referral Codes.

Step 4: Programmatic Affiliate Marketing

Programmatic Affiliate Marketing lets your app personalize the user experience based on the affiliate and campaign that referred the user. For example, you can customize onboarding, paywalls, offers, or in-app content.

When attribution exists—after initialization detects an affiliate link or after a referral code is successfully redeemed, either programmatically or through GoMarketMe's UI—GoMarketMe.affiliateMarketingData is populated.

Initialization is non-blocking. Read the property after initialization has completed:

val data = GoMarketMe.affiliateMarketingData

Wait for initialization to complete before checking attribution. redeemReferralCode(...) returns the same attribution-data type directly after a successful redemption.

The returned data includes:

{
  "campaign": {
    "id": "campaign-id",
    "name": "Creator campaign",
    "status": "active",
    "type": "affiliate",
    "publicLinkUrl": null, // null unless this is a public campaign
    "metadata": {
      // Optional campaign-level properties configured in GoMarketMe
    }
  },
  "affiliate": {
    "id": "affiliate-id",
    "firstName": "Ashley",
    "lastName": "Creator",
    "countryCode": "US",
    "instagramAccount": "",
    "tiktokAccount": "",
    "xAccount": ""
  },
  "affiliateCampaign": {
    "metadata": {
      // Optional affiliate-level properties for this campaign configured in GoMarketMe
    }
  },
  "saleDistribution": {
    "platformPercentage": "10",
    "affiliatePercentage": "20"
  },
  "affiliateCampaignCode": "affiliate-campaign-code",
  "appInstallRef": "installation-uuid",
  "deviceId": "", // deprecated in 6.0.2 - use appInstallRef instead
  "offerCode": null, // null unless this is an offer-code campaign
  "referralCode": "ASHLEY10" // null unless attribution used a referral code
}
  • campaign.metadata is configured under Campaign detail > Advanced > Campaign-level metadata.
  • affiliateCampaign.metadata is configured under Campaign detail > Affiliates > Invite or edit affiliate > Advanced > Affiliate-level metadata for this campaign.

Every property shown above is present when attribution exists. Nullable values are null when they do not apply. Metadata maps are empty when no metadata is configured; GoMarketMe returns their contents without interpreting them. If affiliateMarketingData.affiliateCampaignCode is populated, the app install is attributed to an affiliate.

Learn more about Programmatic Affiliate Marketing.

Platform requirements

Platform Support Notes
Android ✅ Requires Android API 24+
Kotlin ✅ Native Android apps

IAP provider compatibility

GoMarketMe works with any in-app purchase provider that ultimately completes purchases through Google Play Billing, including:

  • Google Play Billing
  • RevenueCat
  • Adapty
  • Qonversion
  • Superwall
  • Glassfy
  • Custom purchase flows built on Google Play Billing

Resources

Support

For integration support, contact integrations@gomarketme.co or visit https://gomarketme.co.

About

Affiliate Marketing for Android Apps.

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Contributors

Languages