CampaignTrackingReceiver
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
  
  
  
  
  
    
      
        
          Known Direct Subclasses
          
            
            
              
                
                  | 
                    
                    InstallReferrerReceiver
                   | 
                  The Google Play
                  com.android.vending.INSTALL_REFERRER Intent
                  is broadcast when an app is installed from the Google Play Store.  | 
                 
               
             
           
         | 
      
    
    
      Google Analytics receiver for com.android.vending.INSTALL_REFERRER. Google
      Play will broadcast the intent when an app is installed from the Google Play Store and has
      campaign data available (i.e. the app was installed from a link to the Google Play Store).
      This BroadcastReceiver
      registers for that Intent and passes
      the campaign data to Google Analytics.
      To enable installation campaign reporting register CampaignTrackingReceiver in your
      AndroidManifest.xml file:
      <manifest>
   <application>
     <!-- ... -->
     <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
         android:enabled="true">
         <intent-filter>
             <action android:name="com.android.vending.INSTALL_REFERRER" />
         </intent-filter>
     </receiver>
     <!-- ... -->
   </application>
 </manifest>
 
Only one receiver can receive the install referrer setting. If Google Tag Manager is
being used by the application, then only the Google Tag Manager receiver needs to be enabled. The
Google Tag Manager receiver will invoke the Google Analytics receiver automatically.
    
 
    
      
        
        
          Public Constructor Summary
          
        
        
        
          Inherited Method Summary
          
            From class android.content.BroadcastReceiver
            
              
              
                
                  
                    | final void | 
                    
                       
                        abortBroadcast()
                       
                     | 
                  
                  
                    | final void | 
                    
                       
                        clearAbortBroadcast()
                       
                     | 
                  
                  
                    | final boolean | 
                    
                       
                        getAbortBroadcast()
                       
                     | 
                  
                  
                    | final boolean | 
                    
                       
                        getDebugUnregister()
                       
                     | 
                  
                  
                    | final int | 
                    
                       
                        getResultCode()
                       
                     | 
                  
                  
                    | 
                      final String
                     | 
                    
                       
                        getResultData()
                       
                     | 
                  
                  
                    | 
                      final Bundle
                     | 
                    
                       
                        getResultExtras(boolean arg0)
                       
                     | 
                  
                  
                    | 
                      String
                     | 
                    
                       
                        getSentFromPackage()
                       
                     | 
                  
                  
                    | int | 
                    
                       
                        getSentFromUid()
                       
                     | 
                  
                  
                    | 
                      final 
                      BroadcastReceiver.PendingResult
                     | 
                    
                       
                        goAsync()
                       
                     | 
                  
                  
                    | final boolean | 
                    
                       
                        isInitialStickyBroadcast()
                       
                     | 
                  
                  
                    | final boolean | 
                    
                       
                        isOrderedBroadcast()
                       
                     | 
                  
                  
                    | abstract void | 
                    
                      
                     | 
                  
                  
                    | 
                      IBinder
                     | 
                    
                      
                     | 
                  
                  
                    | final void | 
                    
                       
                        setDebugUnregister(boolean arg0)
                       
                     | 
                  
                  
                    | final void | 
                    
                       
                        setOrderedHint(boolean arg0)
                       
                     | 
                  
                  
                    | final void | 
                    
                      
                     | 
                  
                  
                    | final void | 
                    
                       
                        setResultCode(int arg0)
                       
                     | 
                  
                  
                    | final void | 
                    
                      
                     | 
                  
                  
                    | final void | 
                    
                      
                     | 
                  
                
               
             
           
          
            From class java.lang.Object
            
              
              
                
                  
                    | 
                      Object
                     | 
                    
                       
                        clone()
                       
                     | 
                  
                  
                    | boolean | 
                    
                      
                     | 
                  
                  
                    | void | 
                    
                       
                        finalize()
                       
                     | 
                  
                  
                    | 
                      final Class<?>
                     | 
                    
                       
                        getClass()
                       
                     | 
                  
                  
                    | int | 
                    
                       
                        hashCode()
                       
                     | 
                  
                  
                    | final void | 
                    
                       
                        notify()
                       
                     | 
                  
                  
                    | final void | 
                    
                       
                        notifyAll()
                       
                     | 
                  
                  
                    | 
                      String
                     | 
                    
                       
                        toString()
                       
                     | 
                  
                  
                    | final void | 
                    
                       
                        wait(long arg0, int arg1)
                       
                     | 
                  
                  
                    | final void | 
                    
                       
                        wait(long arg0)
                       
                     | 
                  
                  
                    | final void | 
                    
                       
                        wait()
                       
                     | 
                  
                
               
             
           
        
      
     
    
    
    
    
    
    
    
    
      Public Constructors
      
        public CampaignTrackingReceiver ()
        
        
       
    
    
    
    
    
    
    
   
  
  
 
  
    
    
      
       
    
    
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2024-10-31 UTC.
  
  
  
    
      [null,null,["Last updated 2024-10-31 UTC."],[],["`CampaignTrackingReceiver` is a `BroadcastReceiver` for Google Analytics that handles the `com.android.vending.INSTALL_REFERRER` intent. When an app is installed from the Google Play Store, this receiver captures campaign data and forwards it to Google Analytics. To activate it, it requires registration in the `AndroidManifest.xml`. It has one main method, `onReceive`, to receive and process the `Intent`. If Google Tag Manager is used, its receiver will handle the data, automatically invoking the `CampaignTrackingReceiver`.\n"]]