如何检测介绍人的Andr​​oid [英] How Detected Referrals Android

查看:199
本文介绍了如何检测介绍人的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出一种方法来检测我的应用程序,通过推荐下载。 第一件事,我不希望使用任何转诊code。通过用户输入。这是我真正需要的:

I am trying to figure out a method to detect my apps downloaded through referral. First thing I don't want to use any referral code enter by user. This is what I actually need:

1.Here是我的推荐链接 http://affiliate.flipkart.com/install-app?affid=Inflation

1.Here is my referral link http://affiliate.flipkart.com/install-app?affid=Inflation

(凡affliate / refferal编号为通货膨胀)

(Where affliate/refferal Id is Inflation)

你们现在当有人下载​​我的应用程序使用的推荐链接,这样他会重定向到playstore。

2.Now when someone download my app using referrals link so he will redirect to playstore.

3.After成功安装了如何检测转诊ID的应用程序...(不使用用户交互)

3.After successfully installations how detect referral id in app ?????(without using user interaction)

有没有谷歌播放服务API来检测哪个环节掉在playstore ???

Is there any google play service api to detect which link fall on playstore???

其实,有应用程序,它做类似这样的,但我不知道它是如何工作? 谢谢

Actually there is app which doing like this but I don't know how it's works... Thanks

推荐答案

1)建立在谷歌你的应用程序的URL起到这样的事

1) Build a URL of your app in google play something like this

<一个href="https://play.google.com/store/apps/details?id=com.hello&referrer=tracking_id%3D123456789">https://play.google.com/store/apps/details?id=com.hello&referrer=tracking_id%3D123456789

或使用

<一个href="https://developers.google.com/analytics/devguides/collection/android/v3/campaigns#google-play-url-builder">google-play-url-builder

在其中引用参数可能会活动家的独特价值。

In which referrer parameter may have the unique value of campaigner.

2)定义在您的应用程序manifest.in一个接收器<$c$c>com.android.vending.INSTALL_REFERRER将帮助你获得广播应用程序时,应用程序从谷歌播放安装..

2) Define a receiver in your app manifest.in which com.android.vending.INSTALL_REFERRER will help you to get a broadcast in the app when app installed from google play..

<receiver android:name="com.package.Tracker" android:exported="true">
   <intent-filter>
       <action android:name="com.android.vending.INSTALL_REFERRER" />
   </intent-filter>
</receiver> 

3)广播接收器

3) Broadcast receiver

    public class Tracker extends BroadcastReceiver {

          private String referrer = "";

    @Override
    public void onReceive(Context context, Intent intent) {

        if (intent.getAction().equals("com.android.vending.INSTALL_REFERRER")) {
            Bundle extras = intent.getExtras();
            if (extras != null) {
                referrer = extras.getString("referrer");
            }
            Log.i("REFERRER", "Referer is: " + referrer);
        }
    }
}

获取活动家详细信息后,你可以提交给谷歌Analytics(分析)运动测量

您可以测试您的应用程序的配置,在终端中运行以下命令:

You can test your app configuration running this command in the terminal:

adb shell am broadcast -a com.android.vending.INSTALL_REFERRER 
                       -n your.package.name/path.to.receiver --es referrer
                       --es referrer "EXTRA_STRING_VALUE"

例如,如果你的包名是com.hello和接收器的路径是com.ex.Tracker test命令将是:

For example if your package name is com.hello and the path of your receiver is com.ex.Tracker the test command will be:

adb shell am broadcast -a com.android.vending.INSTALL_REFERRER 
                       -n "com.hello/com.ex.Tracker"
                       --es referrer "tracking_id=123456789"

有关 有关的工作,或者你也可以乘坐看看第三方人员它提供的UI太多,但它的成本。

For more about working or you can also take a look at third party SDK which offers UI too but it costs..

这篇关于如何检测介绍人的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆