Android Mobile SDK: Assign Tracker ID

The methodAssign Tracker ID” is used to manually assign the SDK a contact identifier (trackerId) obtained from a source external to the SDK itself. Before applying it, the SDK validates with the server that the given trackerId corresponds to an existing contact in your account, using the Connectif.assignTrackerId function.

 

How to Use

The tracker assignment uses the trackerId parameter to validate and identify the corresponding contact in Connectif.

As a recommendation, this method should only be used when receiving a trackerId from a source external to the SDK session itself.

It is not recommended to use this method if the SDK has already identified a known contact.

• Tracker Info:

Parameter Description Required Considerations
trackerId The contact identifier to assign Yes Must correspond to an existing contact in Connectif. If the trackerId sent does not exist, it cannot be assigned.
 

If the provided trackerId does not exist for the account, the assignment will not be applied and the error will be reported through the onError callback, keeping the previously assigned trackerId.

 

Example

The tracker assignment will look like this.

Connectif.assignTrackerId("60f1b3b3b3b3b3b3b3b3b3b3")

 

Callbacks (Optional)

If you want feedback on possible errors when sending events, you can add an EventCallbacks when using our method.

 object : EventCallbacks {
    override fun onSuccess() {
        //Handle success case
    }
    override fun onError(message: String?) {
         //Handle error case
    }
}

 

 

Congratulations!
You have reached the end of the lesson.

  

Do you still have unresolved questions?
Remember that our Connectif specialists are available to help you. To contact them, simply open a Support ticket by clicking the blue “Help” button on your dashboard.

 


Keep learning!

To take full advantage of your Connectif account’s potential, we recommend continuing with the following articles: