2012-04-09 69 views
6

當通過手機上的Market應用程序安裝應用程序時,該應用程序將正確接收傳遞給它的引薦者信息(如此處所述:http://code.google.com/mobile/analytics/docs/android/#android-market-tracking)。安裝引薦者未在Android網絡市場上追蹤

但是,當通過基於Web的市場安裝具有相同引用鏈的相同應用程序時,引用信息將被刪除,並且不會被應用程序接收。這使得從網絡定位到您的應用的廣告系列無法跟蹤。

是否有可能通過Android網絡市場跟蹤安裝推薦人?

回答

6

不,無法從基於網絡的Google Play商店跟蹤安裝推薦鏈接。這是a known issue with the latest SDK

Google Play廣告系列跟蹤目前不支持從網絡Play商店啓動的網絡到設備 安裝。

+2

任何一個可以圍繞提出任何工作? – Gem 2014-01-31 12:56:17

+2

文檔鏈接和「已知問題」部分適用於傳統v2。從更高版本開始,整個「已知問題」部分丟失。那麼,該功能現在應該工作嗎?對我而言,似乎並非如此,即原來的「不通過網絡市場推薦人」問題依然存在。 – 2014-12-12 07:20:13

0

這裏可能有點晚了。幸運的是,這適用於我們跟蹤來自網上商店的安裝。

接收器類:

private final BroadcastReceiver mUpdateReceiver = new BroadcastReceiver() { 
    @Override 
    public void onReceive(Context context, Intent intent) { 
     someMethod(); //send received data to your method and use it your way 
    } 
}; 

的someMethod你在哪裏接收數據:

private void someMethod(){ 
    String referrerDataRaw = MyApplication.getReferrerDataRaw(getApplicationContext()); 

    if(referrerDataRaw.toLowerCase().contains(matchx.toLowerCase())){   
     Log.i("true",referrerDataRaw); 
     Toast.makeText(getBaseContext(),"Install referrer found",Toast.LENGTH_SHORT).show(); 
     //postBack(); 
    } 
    else { 
     Log.i("false","no referrer found"); 
     Toast.makeText(getBaseContext(),"no referrer found",Toast.LENGTH_SHORT).show(); 
    } 

} 

獎金這一個,如果你在MainActivity

public class OwnReceiver extends BroadcastReceiver { 

public static final String ACTION_UPDATE_DATA = "ACTION_UPDATE_DATA"; 
private static final String ACTION_INSTALL_REFERRER = "com.android.vending.INSTALL_REFERRER"; 
private static final String KEY_REFERRER = "referrer"; 

public OwnReceiver() { 
} 

@Override 
public void onReceive(Context context, Intent intent) { 
    if (intent == null) { 
     Log.e("ReferrerReceiver", "Intent is null"); 
     return; 
    } 
    if (!ACTION_INSTALL_REFERRER.equals(intent.getAction())) { 
     Log.e("ReferrerReceiver", "Wrong action! Expected: " + ACTION_INSTALL_REFERRER + " but was: " + intent.getAction()); 
     return; 
    } 
    Bundle extras = intent.getExtras(); 
    if (intent.getExtras() == null) { 
     Log.e("ReferrerReceiver", "No data in intent"); 
     return; 
    } 

    MyApplication.setReferrerDate(context.getApplicationContext(), new Date().getTime()); 
    //Contro.setReferrerData(context.getApplicationContext(), (String) extras.get(KEY_REFERRER)); 
    MyApplication.setReferrerData(context.getApplicationContext(), (String) extras.get(KEY_REFERRER)); 
    LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(ACTION_UPDATE_DATA)); 
} 
} 

使用發送回覆

public void postBack() { 
    // String postTest = "https://play.google.com/store/apps/details?id=com.neon.myApp&referrer=utm_source=someOne&utm_medium=cpr&utm_term=testytest"; 
    String referrerDataRaw = MyApplication.getReferrerDataRaw(getApplicationContext()); 

    // Toast.makeText(this, "raw : " + postTest, Toast.LENGTH_SHORT).show(); 
    String[] split = referrerDataRaw.split("="); 
    String end = split[split.length - 1]; 

    Toast.makeText(this, AppConstant.lin + end, Toast.LENGTH_SHORT).show(); 

    StringRequest strReq = new StringRequest(Request.Method.POST, 
      AppConstant.lin + end, new Response.Listener<String>() { 

     @Override 
     public void onResponse(String response) { 
      Toast.makeText(getBaseContext(),"postback sent",Toast.LENGTH_SHORT).show(); 

     } 
    }, new Response.ErrorListener() { 

     @Override 
     public void onErrorResponse(VolleyError error) { 

     } 
    }); 

    // Adding request to request queue 
    MyApplication.getInstance().addToRequestQueue(strReq, tag_string_req); 
} 

得到大部分的幫助下從這種靈魂在github https://github.com/SimonMarquis/Android-InstallReferrer

相關問題