Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing Google Play Install Referrer Library

I'm looking to migrate from listening to the Play Store's INSTALL_REFERRER intent, to using the new Google Play Install Referrer Library.

I am struggling to find a way to test this new library without first having to add my app to the Play Store. When listening for the INSTALL_REFERRER intent via a BroadcastReceiver, I could test by manually sending a broadcast via the Activity Manager to mimic the behavior. That is to say, I could test by following these steps from Google.

Does there also exist a way I can test this new library without having to first put my app on the Play Store?

like image 660
Bart Kerfeld Avatar asked Feb 28 '18 23:02

Bart Kerfeld


People also ask

How do I do a test install referrer?

If all goes well, you should be able click the generated URL on your Android device, go to the Play store, install the "Referrer Test for Google Play" application, run the application, and see the referrer string you entered on this site show up in the log within the application.

How does Google Play install referrer work?

The Play Install Referrer API Client Library is written in the Java programming language and is a wrapper for the Android Interface Definition Language (AIDL) file that defines the interface to the Install Referrer service. You can use the Play Install Referrer API Client Library to simplify your development process.

Is Play install referrer API permission safe?

You can use the Google Play Store's Install Referrer API to securely retrieve referral content from Google Play, such as: The referrer URL of the installed package. The timestamp, in seconds, of when a referrer click happened (both client- and server-side).

What is permission play install referrer API?

The Play Install Referrer API is an AIDL Service Interface primarily used by non-Java programmers. Note: The Play Install Referrer Library provides a wrapper around the Play Install Referrer API and is designed to help Java programmers use the API.


2 Answers

There's one old hack to test this.

Steps:

  1. Start Google Play on the device using campaign link, for example, https://play.google.com/store/apps/details?id=com.test.test_project&referrer=utm_source%3Dtest_source%26utm_medium%3Dtest_medium%26utm_term%3Dtest-term%26utm_content%3Dtest_content%26utm_campaign%3Dtest_name (You can use google play generator: https://developers.google.com/analytics/devguides/collection/android/v3/campaigns#google-play-url-builder)

  2. DON'T TAP ON INSTALL BUTTON

  3. Install your test build using adb. adb install -r app-debug.apk

Google Play will be returning your test campaign now.

like image 56
Quickern Avatar answered Sep 21 '22 05:09

Quickern


This is the summary of my test:

  1. old broadcast way can test.But it's deprecated and not support for now
  2. U can test install referrer lib set up by use adb,and you will get utm_source=google-play&utm_medium=organic just like download form Google Play directly. But we can't get more info, it's can only test your library settings is correct
  3. https://stackoverflow.com/a/60342463/12716149 by @Quickern.To be honest, it works follow these tips
    • ensure that the application ID is the same.
      • Open via browser on computer(if on your phone, make sure in browser): https://play.google.com/store/apps
      • Find and click an app which u want to use. U will saw a url in address bar. e.g. https://play.google.com/store/apps/details?id=com.google.android.youtube
      • Set the "id"(com.google.android.youtube) as your app Application Id
    • Open test url directly by Google Play app(don't download)
      • https://developers.google.com/analytics/devguides/collection/android/v4/campaigns#google-play-url-builder build test url. Application ID must be your test app id.if you can't see the builder, maybe the reason is your browser extensions
      • past the url on your phone where click can open by Google play app directly. If don't open by Google Play app directly, will received(not20%set).So, directly by Google play app is the key
    • Use adb install your test app
    • Open your app and your will received what you set in the url
  4. Use Beta test provided by Google Play: https://stackoverflow.com/a/49750758/12716149. Without a doubt, it works
  5. Use emulator:https://stackoverflow.com/a/59744213/12716149 @Marilia. I didn't test this, because emulator with Google Play Store is just like a real device.And the answer said the condition is upload app to Google Play store,so I think it's just like article 4
like image 35
likeme Avatar answered Sep 22 '22 05:09

likeme