Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android referrer parameters are not getting captured

I have an custom INSTALL_REFERRER, a custom class that extends the BroadcastReceiver class, and a link that goes to my app

https://play.google.com/store/apps/details?id=com.myapp.android&referrer=ai%3Dai_value%26gclid%3Dgclid_test

This link has the obvious referrer params and values: ai=ai_value&gclid=gclid_test.

When I run my app in my development adb shell, I am able to capture both of these parameters and values on the BroadcastReceiver and send it back to my server. Here's the adb command that I'm running:

am broadcast -a com.android.vending.INSTALL_REFERRER -n com.myapp.android/.CustomInstallReceiver --es "referrer" "ai%3Dai_value%26gclid%3Dgclid_test"

However, when it's live in the app store, I'm only able to capture the first param and value. Any idea what's going on or what I can check?

like image 460
locoboy Avatar asked Sep 06 '25 22:09

locoboy


1 Answers

Accoring to this post, you cannot use custom query-string parameters (only referrer is accepted).

The good thing is that you can easly trick the problem: just "inject" the second key/value pair in the first parameter using a custom separator which is standard-complaint (so don't use the &) and treat it accordingly server side by splitting your values using the custom separator. In this way, the whole information will be transported using the working key "referrer".

like image 122
bonnyz Avatar answered Sep 08 '25 11:09

bonnyz