2

Google is deprecating intall_referrer intent soon. I found google analytic CampaignTrackingReceiver is using it in our project. Adding the code from manifest for reference:

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

How can I replace this with firebase analytics?

Suneesh Ambatt
  • 1,347
  • 1
  • 11
  • 41

2 Answers2

0

Found the answer here:

Campaign Measurement

Check the link above, and here is the part of code that matches the old way of using CampaignTrackingReceiver

// Tracker for Classic GA (call this if you are using Classic GA only)
    private void trackInstallReferrer(final String referrerUrl) {
        new Handler(getMainLooper()).post(new Runnable() {
            @Override
            public void run() {
                CampaignTrackingReceiver receiver = new CampaignTrackingReceiver();
                Intent intent = new Intent("com.android.vending.INSTALL_REFERRER");
                intent.putExtra("referrer", referrerUrl);
                receiver.onReceive(getApplicationContext(), intent);
            }
        });
    }
Itai Spector
  • 652
  • 11
  • 24
0

Remove the Google Analytics install referrer broadcast from code. It will stop sending referrer data to https://analytics.google.com/analytics. But it won’t be a problem, we can configure Firebase in the project and track campaign data. Please check this video - https://www.youtube.com/watch?v=lvADEr1CfEs

Suneesh Ambatt
  • 1,347
  • 1
  • 11
  • 41