Get attribution info
Version:
The justtrack SDK automatically determines a user’s identity and attribution after setup. This includes details about the ad the user clicked (if any), the campaign that ad belongs to, and the associated network and channel.
You can access attribution data in your app through the JustTrackSdk::getAttribution method:
- Android
- iOS
- Unity
- React Native
val attribution = sdk.attribution.await()
val campaignName = attribution.campaign.name
val adsetId = attribution.adsetId
val userType = attribution.userType
val partnerName = attribution.partner.name
sdk.attribution.observe { result in
switch result {
case let .failure(error):
// handle error
case let .success(response):
log(response.campaign.name)
}
}
using JustTrack;
JustTrackSDKBehaviour.GetAttribution((attribution) => {
Debug.Log(attribution.Campaign.Name);
}, (error) => {
// handle error and wait for the attribution request to be retried automatically
});
const attributionData: JustTrackSdk.AttributionData = await JustTrackSdk.getAttribution();
console.log('The userType is ' + attributionData.userType);
console.log('The campaign name is ' + attributionData.campaign.name);
console.log('The partner name is ' + attributionData.partner.name);
console.log('The adsetId is ' + attributionData.adsetId);
console.log('The channel is ' + attributionData.channel.name);
If you are only using the justtrack dashboard to keep track of your install sources, you don't need to call getAttribution yourself.