使用自定义参数链接到Google Play商店

时间:2017-06-07 15:25:36

标签: android ios

是否可以使用自定义参数构建指向Play商店(到我的应用程序)的链接?我希望能够在安装后在我的应用程序中读取此参数。 我找到了Firebase动态链接,但它似乎不支持此类功能

1 个答案:

答案 0 :(得分:3)

您可以使用广告系列衡量链接。

链接生成器:

https://developers.google.com/analytics/devguides/collection/android/v4/campaigns#google-play-url-builder

您可以通过实施自己的BroadcastReceiver而不是使用com.google.android.gms.analytics.CampaignTrackingReceiver来阅读您定义的参数。

在您的接收器中,您可以执行类似的操作,以获取链接中定义的所有参数。

   public class InstallReceiver extends BroadcastReceiver {

        @Override
        public void onReceive(Context context, Intent intent) {
            Bundle extras = intent.getExtras();
            if(extras != null){
              //You will find all of your params under the extra "referrer" like:

              String referrer = extras.getString("referrer");

              //Then you only have to parse it and get the param you need.

            }
       }
   }

文档:https://developers.google.com/analytics/devguides/collection/android/v4/campaigns