@ SuppressWarnings ( { "unused" , "WeakerAccess" } ) public synchronized void pushInstallReferrer ( String source , String medium , String campaign ) { if ( source == null && medium == null && campaign == null ) return ; try { // If already pushed, don't send it again int status = StorageHelper . getInt ( context , "app_install_status" , 0 ) ; if ( status != 0 ) { Logger . d ( "Install referrer has already been set. Will not override it" ) ; return ; } StorageHelper . putInt ( context , "app_install_status" , 1 ) ; if ( source != null ) source = Uri . encode ( source ) ; if ( medium != null ) medium = Uri . encode ( medium ) ; if ( campaign != null ) campaign = Uri . encode ( campaign ) ; String uriStr = "wzrk://track?install=true" ; if ( source != null ) uriStr += "&utm_source=" + source ; if ( medium != null ) uriStr += "&utm_medium=" + medium ; if ( campaign != null ) uriStr += "&utm_campaign=" + campaign ; Uri uri = Uri . parse ( uriStr ) ; pushDeepLink ( uri , true ) ; } catch ( Throwable t ) { Logger . v ( "Failed to push install referrer" , t ) ; } }
This method is used to push install referrer via UTM source medium & campaign parameters