4

i wan't to track my app download source,apk will be available through several campaigns. Issue is app download link is direct url, It is not on Google Play Store so i can't receive INSTALL_REFERER broadcast.

I can track clicks easily by logging each click on my server, but how to track user installed and run app (and download source)

Approch 1:

  • Run one java script for each campaign URL, get some device specific info, send to server
  • Now when user installs and run that app, run same java script, capture and send info
  • if same info record matches with some previous record we know app download was successful

Problem in above approach is i am not able to narrow down what all info i should capture in javascript to identify the user, keeping in mind different android browsers available and android device fragmentation.

glennsl
  • 28,186
  • 12
  • 57
  • 75
Akhil
  • 6,667
  • 4
  • 31
  • 61

2 Answers2

4

got this one working, with the help of aapt.

Basic approach is to insert a file in assets in apk on the fly.

requires:

  • a web-server able to serve apk e.g. apache, add mime types for apk in web-server config files.
  • a server side script which can execute shell commands e.g. php, jsp
  • an unsigned-apk, unsigned coz aapt seems to have some problem with modification of signed apks and then again resigning them.
  • android and java sdk on serving machine

then:

As soon as user clicks on the download link hosted on your web-site, record an entry in a db, with some field describing the state as downloaded/downloading.

generate your text property file to be inserted inside assets folder in apk. use aapt to add it to apk.

aapt remove app.apk "assets/tracker.txt"

aapt add app.apk "assets/tracker.txt"

directory structure where source apk will be hosted like this : ROOT-> (assets ->(app_tracker.txt)) + app.apk

after this signing

jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -storepass STORE_PASSWORD -keystore KEYSOTRE_PATH alias_name

NOTE: you should not modify the source app.apk and tracker.txt, what you should is to copy it to some relative path and then do modification over it.

hope it helps, it helped me though :)

Community
  • 1
  • 1
dcool
  • 4,039
  • 3
  • 16
  • 14
0

I am not sure of better approach. But you could do something in the apk itself (Save information about the source). So when user opens the app for the first time, send that info to the server and delete it in the app if u want to.

Because AFAIK, Browser can never know if the user installed the app or not. User could download it and discard with out installing the app.

And if you want to track all the activities of the user in the app, you could use Flurry.com

Edit: Or you could actually check for the browser history when the user opens the app for the first time and check if one of your sources is there in it. But if the user manually clears the browser history, you are going to lose it.

Seshu Vinay
  • 13,560
  • 9
  • 60
  • 109
  • we are trying similar (having source info in app), but it has overhead of different apk for each camapaign.. – Akhil Oct 03 '13 at 06:17
  • You could ask user to give email and share apk via sending email. So you could actually save emails of all the users and sources. This should be the worst approach, but sloves your problem – Seshu Vinay Oct 03 '13 at 06:23
  • Here is another one. Use only one apk. Upload it to Google Play. And give link to google play everywhere. So users can download your app only from Google Play. And in each campaign, give an activation code to the user, User can unlock your app with the code. In this way, you can find from which source, the app is activated. Make sure activation code is valid only for one device. – Seshu Vinay Oct 03 '13 at 06:38
  • its not on Google play, its a direct download – Akhil Oct 03 '13 at 07:03
  • Ok, Let it not be on Google Play. Still give an activation code to the user, using which you can identify the source. – Seshu Vinay Oct 03 '13 at 07:07
  • don't want to change my app UX for solving this, i have mentioned one approach above.. – Akhil Oct 03 '13 at 07:22
  • m looking for this too..anybody? – dcool Oct 03 '13 at 07:30