Stay organized with collections
Save and categorize content based on your preferences.
public final class
InstallReferrerReceiver
The Google Play com.android.vending.INSTALL_REFERRER Intent is broadcast when an
app is installed from the Google Play Store. This BroadcastReceiver listens for that
Intent, passing the install referrer data to GTM for Mobile Apps and Google Analytics.
To enable this receiver, add the following to your AndroidManifest.xml file:
<!-- Used for install referrer tracking-->
<service android:name="com.google.tagmanager.InstallReferrerService"/>
<receiver
android:name="com.google.tagmanager.InstallReferrerReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
This receiver will automatically invoke the Google Analytics receiver to set the
Campaign data. If both the Google Analytics SDK and Google Tag Manager SDKs are in use,
only this receiver needs to be enabled.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["`InstallReferrerReceiver` processes install referrer data from the Google Play Store and sends it to Google Tag Manager and Google Analytics."],["To enable this functionality, you need to add the provided service and receiver entries to your `AndroidManifest.xml` file."],["This receiver automatically triggers the Google Analytics receiver for campaign data, eliminating the need for separate configuration when using both Google Analytics and Google Tag Manager SDKs."]]],["The `InstallReferrerReceiver` class listens for the `com.android.vending.INSTALL_REFERRER` intent, which is broadcast upon app installation from the Google Play Store. Upon receiving this intent, it passes install referrer data to Google Tag Manager (GTM) and Google Analytics. To enable, it requires a service and a receiver declaration in the `AndroidManifest.xml`, specifying the intent action. The class features a constructor and an `onReceive` method that processes the received intent. It also sets campaign data for the Google Analytics.\n"]]