Question

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.

Was it helpful?

Solution

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 :)

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top