Support Home > SDK Integration > SDK – KochavaTracker Android > Class – Tracker.Configuration

Class – Tracker.Configuration

Class

Tracker.Configuration

Enclosing Class:

Tracker


@AnyThread
public static class Tracker.Configuration
extends java.lang.Object

Tracker Configuration Builder.

The Tracker can be configured on any thread but it is recommended that it be configured directly in Application.onCreate on the main thread. Minimal initialization is performed during configuration prior to dispatching to a background thread and returning to the caller. Once the configure method returns all other methods are available to use immediately.

Typical Usage

Configuration in Application.onCreate:

 

Advanced Usage

Multiple Processes:

The Tracker SDK can only be configured in a single process. If the app uses multiple processes a check must be performed in the Application.onCreate method to ensure the Tracker is only configured in the desired process. Typically this would be the same process your UI runs in as running the Tracker in a different process will prevent session tracking.

If running the Tracker in a process other than the default, the ReferralReceiver Broadcast Receiver must be updated to use that process. This should be done by following the Multiple Receivers instructions where your broadcast receiver is defined as running in the same process as the Tracker.

Other processes can send events by bundling them in an Intent as type Parcelable that is sent to an internal Broadcast Receiver that runs on the same process as the Tracker. The Broadcast Receiver then extracts the Event from the Intent and forwards it to the Tracker.sendEvent(Event) method.


Constructor Detail

Configuration
public Configuration(@NonNull
android.content.Context context)

Creates a Configuration Builder that is used to configure the Tracker

Once all desired parameters are set, pass this object to Tracker.configure(Configuration)

Parameters:
context – Application Context.

Method Detail

Modifier and Type Method and Description
Tracker.Configuration addCustom
@CheckResult
@NonNull
public final Tracker.Configuration addCustom(@NonNull java.lang.String key, @NonNull java.lang.String value)

Adds a custom parameter. Only use if directed to by your Client Success Managers.

Parameters:
key – Parameter key.
value – Parameter Value.

Returns:
Configuration Builder.

tracker.Configuration addCustom
@CheckResult
@NonNull
public final Tracker.Configuration addCustom(@NonNull org.json.JSONObject custom)

Adds a custom parameter json object. Only use if directed to by your Client Success Managers.

Parameters:
custom – Parameter Object.

Returns:
Configuration Builder.

Tracker.Configuration setAppGuid
@CheckResult
@NonNull
public final Tracker.Configuration setAppGuid(@NonNull java.lang.String appGuid)

Sets the App Guid for this app. Retrieve your app guid from the Kochava dashboard to place here.

Required unless otherwise specified by your Client Success Managers.

Set this or setPartnerName(String) but not both.

Parameters:
appGuid – Your App Guid

Returns:
Configuration Builder.

Tracker.Configuration setAppLimitAdTracking
@CheckResult
@NonNull
public final Tracker.Configuration setAppLimitAdTracking
(boolean appLimitAdTracking)

Sets if app level advertising tracking should be limited.

This value is unrelated to and is sent in addition to the operating system limit ad tracking value.

Default False.

Parameters:
appLimitAdTracking – True to limit ad tracking for this app. False for normal operation.

Returns:
Configuration Builder.

Tracker.Configuration setAttributionListener
@CheckResult
@NonNull
@Deprecated
public final Tracker.Configuration setAttributionListener(@NonNull AttributionListener attributionListener)

DEPRECATED: As of version 3.3.0, because attribution information can now be updated and delivered to the app multiple times. The replacement with update functionality is now handled through setAttributionUpdateListener(AttributionUpdateListener).

Sets an attribution listener.

Attribution information is assessed and stored within Kochava’s Servers, where it is reported back to you through your Kochava’s account.
You may also retrieve this information from within your app by passing in an implementation of AttributionListener.

NOTE: Retrieving the information within your app should only be done if your app makes use of this information, otherwise it causes needless network communication.

Parameters:
attributionListener – Attribution listener.

Returns:
Configuration Builder.

Tracker.Configuration setAttributionUpdateListener
@CheckResult
@NonNull
public final Tracker.Configuration setAttributionUpdateListener(@NonNull AttributionUpdateListener attributionUpdateListener)

Sets an attribution update listener.

Attribution information is assessed and stored within Kochava’s Servers, where it is reported back to you through your Kochava’s account.

You may also retrieve this information from within your app by passing in an implementation of AttributionUpdateListener.

NOTE: Retrieving the information within your app should only be done if your app makes use of this information, otherwise it causes needless network communication.

Parameters:
attributionUpdateListener – Attribution listener.

Returns:
Configuration Builder.

Tracker.Configuration setConsentStatusChangeListener
@CheckResult
@NonNull
public final Tracker.Configuration setConsentStatusChangeListener(@NonNull ConsentStatusChangeListener consentStatusChangeListener)

Sets the Intelligent Consent Management status change listener.

Use with setIntelligentConsentManagement(boolean).

Parameters:
consentStatusChangeListener – Consent Status Listener.

Returns:
Configuration Builder.

Tracker.Configuration setIdentityLink
@CheckResult
@NonNull
public final Tracker.Configuration setIdentityLink(@NonNull Tracker.IdentityLink identityLink)

Sets a user identity link that is used for linking based off of external criteria such as a user login.

Parameters:
identityLink – IdentityLink that maps key names with values.

Returns:
Configuration Builder.

Tracker.Configuration setIntelligentConsentManagement
@CheckResult
@NonNull
public final Tracker.Configuration setIntelligentConsentManagement(boolean intelligentConsentManagement)

Enables Intelligent Consent Management.

Intelligent Consent Management must be enabled both here and on the Kochava Dashboard in order to function.

BEST PRACTICES:Refer to our SDK – Intelligent Consent Management support documentation for more information on usage.

Sample Code Implementation

Parameters:
intelligentConsentManagement – True to enable Kochava Intelligent Consent Management. False (default) to operate normally.

Returns:
Configuration Builder.

Tracker.Configuration setLogLevel
@CheckResult
@NonNull
public final Tracker.Configuration setLogLevel(int logLevel)

Sets the log level for the Tracker. This defaults to Tracker.LOG_LEVEL_INFO

Use of a log level beyond Tracker.LOG_LEVEL_INFO in production is discouraged.

Parameters:
logLevel – Log Level type def Tracker.LogLevel

Returns:
Configuration Builder.

Tracker.Configuration setPartnerName
@CheckResult
@NonNull
public final Tracker.Configuration setPartnerName(@NonNull java.lang.String partnerName)

Sets the Partner Name for Auto Provisioning. Use only if directed to by your Client Success Managers.

Set this or setAppGuid(String) but not both.

Parameters:
partnerName – Partner Name

Methods Inherited from Class java.lang.object:

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait


See Also

Related Method Tracker.configure

Configures the Tracker.

 
 

Last Modified: Jun 19, 2018 at 4:57 pm