23

Recently Google released Google Play Install Referrer API (announcement).

Comparing to the INSTALL_REFERRER broadcast from Google Play, it provides extra information like click and installs time in addition to referrer itself.

First question: is it a complete replacement for INSTALL_REFERRER broadcast? Should we just drop the broadcast receiver and start using a new API?

Second: is there any information in what particular cases new API is more reliable then INSTALL_REFERRER broadcast?

Ramesh R
  • 7,009
  • 4
  • 25
  • 38
zasadnyy
  • 2,107
  • 2
  • 19
  • 26
  • were you able to find any info at all? I'm looking for a deferred deeplinking, and INSTALL_REFERRER will come-in handy. Not sure how the new API can support that scenario. – Vik Jan 26 '18 at 21:56
  • 1
    I'd recommend you to use an existing solution for the deferred deep linking. The thing is that INSTALL_REFERRER is not reliable and may not arrive. Check sth like https://getsocial.im, or Branch they both have deferred deep linking solutions. – zasadnyy Feb 26 '18 at 13:16
  • Have you resolved your issue? do you have some working code for this? from what place have you start tracking your first installation? Have you added a broadcast receiver for listening to Intent.ACTION_PACKAGE_FIRST_LAUNCH or just wrote code in mainActivity? – yozhik Aug 10 '18 at 08:09

1 Answers1

4

It's all about SECURITY and SIMPLICITY. As the doc implies, you can use the Google Play Store's Install Referrer API to securely retrieve more accurate and reliable referral content from Google Play and also you can consider switch to Install Referrer API Client Library to simplify your development process. and as u mentioned in the query it returns ReferrerDetails object that hold extra info related to the install with the below three methods.

ReferrerDetails response = mReferrerClient.getInstallReferrer();
response.getInstallReferrer();
response.getReferrerClickTimestampSeconds();
response.getInstallBeginTimestampSeconds();

The API works only from Play Store version 8.3.73 onwards. Any developers that would like to begin using it can start right away, but a connection must be established between their app and the Play Store.

Also, check an article from Adjust that explains how new API can prevent click injection fraud for mobile ads.

P.S. You need to keep track with the latest API levels to be able to deliver the best solutions to the problems you face in your projects.

zasadnyy
  • 2,107
  • 2
  • 19
  • 26
Anoop M Maddasseri
  • 10,213
  • 3
  • 52
  • 73
  • Have you resolved your issue? do you have some working code for this? from what place have you start tracking your first installation? Have you added a broadcast receiver for listening to Intent.ACTION_PACKAGE_FIRST_LAUNCH or just wrote code in mainActivity? – yozhik Aug 10 '18 at 08:13
  • You can just implement `InstallReferrerStateListener` for callbacks. Check [this](https://android-developers.googleblog.com/2017/11/google-play-referrer-api-track-and.html) for reference. – Anoop M Maddasseri Aug 14 '18 at 12:28
  • Hey. I work at Adjust. I second what @AnoopM said. The idea here was to prevent "Click Injection"-- a commonplace adfraud scheme-- and prevent malicious apps from stealing traffic. The linked article is good further reading – solidak Oct 27 '18 at 08:52
  • since this api is almost impossible to test, can you give examples of how the `response.getInstallReferrer();` returns? – Rafael Lima Dec 12 '18 at 17:25
  • can anyone explain the meaning of "referrer click time"? – Rahul Bansal Dec 28 '18 at 09:41
  • @AnoopM I'm using the same implementation but I see installBeginTime and referrerClickTime always same and it is something like `1970-01-18T23:26:26+0000`. Any idea why is it taking default time? – ASN Mar 21 '19 at 18:10
  • "he API works only from Play Store version 8.3.73 onwards" Does that mean is has to be downloaded from that version of the Play Store (or later) on the users device? Or does it mean that the app has to use Play Services of that version or later? – CACuzcatlan Sep 11 '19 at 17:22
  • 2
    How did you test the new library APIs? – Darshan Pania Jan 09 '20 at 08:40
  • @DarshanPania wher you able to test this with new library API ? – sanjay km Oct 01 '20 at 10:09
  • @sanjaykm Just add the library and the code and you'll start getting install referrer info even for manual install on emulator or test device – Darshan Pania Oct 02 '20 at 11:04