Skip to main content

Deferred Deep Linking via Google Ads

Overview

Deferred deep linking through Google Ads requires configuration on both the App side and the Google Ads (AdWords) panel. This setup ensures that when a user clicks on an ad and installs the app, the app can correctly receive campaign data and navigate the user to the intended screen with required parameters.

This document explains the end-to-end flow, configuration steps, and how to handle deferred deep link data on the app side.

Prerequisites

  • Google Ads account
  • App integrated with Trackier / Apptrove SDK
  • Deferred deep linking enabled in the SDK
  • Google Play Install Referrer dependency added
  • App-side logic to parse and handle deep link parameters

High-Level Flow

  1. Create a Google Ads campaign with structured naming
  2. Pass deep link–related values through campaign or ad group names
  3. User clicks the Google Ad → installs the app
  4. App fetches Install Referrer from Play Store
  5. App passes referrer data to SDK for parsing
  6. SDK triggers deep link callback
  7. App navigates user to the target screen

Step 1: Campaign Creation in Google Ads

Campaign & Ad Group Naming Strategy

To pass custom values (e.g., product details) via Google Ads, encode them in the campaign name or ad group name.

Example Ad Group Name:

chocochip#2#199

Where:

  • chocochip → product_id
  • 2 → quantity
  • 199 → price

You may also include additional metadata in the campaign name if required.

https://trackier58.u9ilnk.me/d/ps1bzhyeII
?pid=kFyW2bEizc
&cost_value=20
&cost_currency=INR
&lbw=1h
&camp=CampaignAbhay
&dlv=CakeActivity
&product_id=chocochip
&quantity=2
&package=199

After installation and first launch, the app receives attribution data similar to:

adg=chocochip%2%199
&camp=studyiqcampaign
&clicked_apptrove_link=false
&gad_source=3
&gbraid=0AAAAABexcYdG1mnRPeMCFnFKs_VprROgS
&gclid=Cj0KCQjwuvrBBhDcARIsAKRrkjfIJIOFVL-CIyps4y1gImEGO3utUftF7gAsMbqDRjrY5c2wDehCJmgaAkLWEALw_wcB
&non_apptrove_link=true
&pid=googleads

Important Fields

FieldDescription
adgAd group name (URL encoded)
campCampaign name
pidAttribution source

After decoding:

  • adg = chocochip#2#199

Step 4: Passing Install Referrer to SDK (Android)

After completing campaign setup, you must pass the Google Play Install Referrer to the SDK so that deferred deep link values can be parsed correctly.

important

Important Notes:

  • Install Referrer must be fetched after SDK initialization
  • Wait 200–300 ms after SDK initialization before calling parseDeeplink
  • This step is mandatory for Google Ads deferred deep linking

Android Implementation Example

private lateinit var referrerClient: InstallReferrerClient

// Call this method in onCreate()
private fun initReferralTracking() {
referrerClient = InstallReferrerClient.newBuilder(this).build()
referrerClient.startConnection(object : InstallReferrerStateListener {

override fun onInstallReferrerSetupFinished(responseCode: Int) {
when (responseCode) {

InstallReferrerClient.InstallReferrerResponse.OK -> {
// Connection established successfully
// Pass install referrer to SDK for deep link parsing
TrackierSDK.parseDeeplink(
referrerClient.installReferrer.installReferrer
)
}

InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE -> {
// Service unavailable
}

InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED -> {
// Feature not supported on the device
}
}
}

override fun onInstallReferrerServiceDisconnected() {
// Retry connection if required
}
})
}

After passing the install referrer to the SDK, the parsed deep link data will be delivered through the DeepLinkListener callback.

Callback Implementation Example

object deepLinkListener : DeepLinkListener {
override fun onDeepLinking(result: DeepLink) {
Log.d("trackiersdk", "deeplink getUrl: " + result.getUrl())
}
}

Expected Output

adg=chocochip%2%199
&camp=studyiqcampaign
&clicked_apptrove_link=false
&gad_source=3
&gbraid=0AAAAABexcYdG1mnRPeMCFnFKs_VprROgS
&gclid=Cj0KCQjwuvrBBhDcARIsAKRrkjfIJIOFVL-CIyps4y1gImEGO3utUftF7gAsMbqDRjrY5c2wDehCJmgaAkLWEALw_wcB
&non_apptrove_link=true
&pid=googleads

Expected Behavior

  1. SDK parses install referrer data
  2. Extracts campaign / ad group parameters
  3. Triggers the deep link callback
  4. App receives decoded deep link URL

Step 6: App-Side Handling Logic

Once the deep link URL is received:

  1. Extract the adg parameter
  2. Split values using delimiter (#)
  3. Create an internal deep link
  4. Navigate to the relevant screen

Example Parsed Values

product_id = chocochip
quantity = 2
price = 199

Navigate user to: CakeActivity → Product Detail Screen

Key Notes

  • Always maintain consistent naming conventions in Google Ads
  • Install Referrer parsing is mandatory for Google Ads
  • App-side handling is required to convert campaign data into navigation logic
  • This approach supports deferred deep linking even if the app was not previously installed