Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we have INSTALL_REFERRER two times in a single Android app?

Tags:

android

I am working on an Android application where I am using INSTALL_REFERRER to know source of installation of my app. For this, I am using first Google Analytics Install_Referrer intent filter and one of my own custom ones.

Is it possible to have two broadcast receiver entries with an intent filter com.android.vending.INSTALL_REFERRER in Android?

Google Analytics Receiver

<receiver
    android:name="com.google.analytics.tracking.android.CampaignTrackingReceiver"
    android:exported="true" >
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
</receiver>

My Custom Broadcast Receiver.

<receiver
    android:name="com.xyz.broadcastreceiver.ReferrerCatcher"
    android:exported="true" >
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
</receiver>
like image 276
N Sharma Avatar asked Dec 15 '14 05:12

N Sharma


People also ask

How does Google Play install referrer work?

The Google Install Referrer is an Android-specific measurement technology that attributes clicks on Google Play Store app pages to the correlating app download. Google's Install Referrer framework sends an install referrer (or unique code string) to the Google Play store when an ad click has occurred.

What does install referrer API mean?

The definition of install referrer An Install Referrer is an Android-specific ad tracking identifier. Like Device IDs and Device Fingerprinting, an install referrer is a unique string that's sent to the Play Store when a user clicks on an ad.

What is Google Play referrer?

A Google Play install referrer is a string of numbers that is used to measure mobile app install ad performance on Android devices. If you're a web marketer, think of it like UTM parameters for mobile app installs.


1 Answers

No we can't have two Install Referrer broadcast receiver. For this I created my own custom broadcast receiver to achieve Google Analytics Source tracking and my own stuff.

<receiver
    android:name="com.xyz.broadcastreceiver.ReferrerCatcher"
    android:exported="true" >
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
</receiver>

In the ReferrerCatcher broadcast receiver

public class ReferrerCatcher extends BroadcastReceiver {
    public static final String TAG = InstallReceiver.class.getCanonicalName();

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

        // Google Analytics
        new CampaignTrackingReceiver().onReceive(context, intent);

        Log.d(TAG, intent.getExtras().getString("referrer");
        // my stuff here 
    }
}
like image 95
N Sharma Avatar answered Sep 28 '22 10:09

N Sharma