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
- Create a Google Ads campaign with structured naming
- Pass deep link–related values through campaign or ad group names
- User clicks the Google Ad → installs the app
- App fetches Install Referrer from Play Store
- App passes referrer data to SDK for parsing
- SDK triggers deep link callback
- 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_id2→ quantity199→ price
You may also include additional metadata in the campaign name if required.
Step 2: Tracking / Deep Link URL Configuration
Example Tracking Link
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
Step 3: Deferred Deep Link Data Received on App Side
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
| Field | Description |
|---|---|
adg | Ad group name (URL encoded) |
camp | Campaign name |
pid | Attribution 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 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
}
})
}
Step 5: Receiving Deep Link Data via SDK Callback
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
- SDK parses install referrer data
- Extracts campaign / ad group parameters
- Triggers the deep link callback
- App receives decoded deep link URL
Step 6: App-Side Handling Logic
Once the deep link URL is received:
- Extract the
adgparameter - Split values using delimiter (
#) - Create an internal deep link
- 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