2

How can I implement Google Campaign Measurement using react native .

I am trying to follow this guide: https://developers.google.com/analytics/devguides/collection/android/v4/campaigns

Steps I am taking

  1. Add the Google Analytics receiver to your AndroidManifest.xml file
<application>
    <!-- Used for Google Play Store Campaign Measurement-->
    <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
        android:enabled="true"
        android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>
    <service android:name="com.google.android.gms.analytics.CampaignTrackingService"
        android:enabled="true"
        android:exported="false" />
</application>
  1. Broadcasting an INSTALL_REFERRER Intent
$ cd <path_to_adb_tool>
$ echo 'am broadcast \
    -a com.android.vending.INSTALL_REFERRER \
    -n "your.package.name/path.to.receiver" \
    --es "referrer" \
      "utm_source=test_source&utm_medium=test_medium&utm_term=test_term&utm_content=test_content&utm_campaign=test_name"; \
    exit' | ./adb shell
  1. Verifying the Campaign Data Was Received- not able to receive this below line in adb output GAv4 : Received installation campaign: source=testSource

Is there any extra step I need to do for react native with react-native-firebase?

shubham choudhary
  • 2,670
  • 5
  • 13
  • 16

0 Answers0