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>
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.
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.
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.
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
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With