Importing attributions on Unity
To set up integration, call the attribution retrieval method on the client, then call the attribution sending method AppMetrica.ReportExternalAttribution
.
AppsFlyer
- Register
IAppsFlyerConversionData
when initializing AppsFlyer. - Set up the sending of attribution data (the
AppMetrica.ReportExternalAttribution
method) in the AppMetrica SDK fromIAppsFlyerConversionData
.
public class AppsFlyerConversionDataListener : IAppsFlyerConversionData {
public void onConversionDataSuccess(string conversionData) {
AppMetrica.ReportExternalAttribution(ExternalAttributions.AppsFlyer(conversionData));
}
// ...
}
AppsFlyer.initSDK("devkey", "appId", new AppsFlyerConversionDataListener());
Adjust
- Register
Action<AdjustAttribution>
using theAdjustConfig.setAttributionChangedDelegate
method. - Set up the sending of attribution data (the
AppMetrica.ReportExternalAttribution
method) in the AppMetrica SDK fromAction<AdjustAttribution>
.
var adjustConfig = new AdjustConfig("token", AdjustEnvironment.Production);
adjustConfig.setAttributionChangedDelegate(attribution => {
AppMetrica.ReportExternalAttribution(ExternalAttributions.Adjust(attribution));
});
Adjust.start(adjustConfig);
Kochava
- Register
Action<KochavaTrackerInstallAttribution>
using theKochavaTracker.GetInstallAttribution
method. - Set up the sending of attribution data (the
AppMetrica.ReportExternalAttribution
method) in the AppMetrica SDK fromAction<KochavaTrackerInstallAttribution>
.
KochavaTracker.Instance.GetInstallAttribution(currentInstallAttribution => {
AppMetrica.ReportExternalAttribution(ExternalAttributions.Kochava(currentInstallAttribution.Raw.ToString()));
});
Tenjin
- Register
Tenjin.AttributionInfoDelegate
using theBaseTenjin.GetAttributionInfo
method. - Set up the sending of attribution data (the
AppMetrica.ReportExternalAttribution
method) in the AppMetrica SDK fromTenjin.AttributionInfoDelegate
.
var tenjinSdk = Tenjin.getInstance("apiKey");
tenjinSdk.Connect();
tenjinSdk.GetAttributionInfo(attributionInfoData => {
AppMetrica.ReportExternalAttribution(ExternalAttributions.Tenjin(attributionInfoData));
});
Airbridge
- Register the
OnAttributionResultReceived
callback using theAirbridgeUnity.SetOnAttributionReceived
method. - Set up the sending of attribution data (the
AppMetrica.ReportExternalAttribution
method) in the AppMetrica SDK fromOnAttributionResultReceived
.
public class AirbridgeAttribution : MonoBehaviour {
public void Init() {
AirbridgeUnity.SetOnAttributionReceived(name);
}
public void OnAttributionResultReceived(string jsonString) {
AppMetrica.ReportExternalAttribution(ExternalAttributions.Airbridge(jsonString));
}
}
Singular
- Register
SingularDeviceAttributionCallbackHandler
. - Set up the sending of attribution data (the
AppMetrica.ReportExternalAttribution
method) in the AppMetrica SDK fromOnSingularDeviceAttributionCallback
.
public class SingularDeviceAttributionHandler : SingularDeviceAttributionCallbackHandler {
public void OnSingularDeviceAttributionCallback(Dictionary<string, object> attributionInfo) {
AppMetrica.ReportExternalAttribution(ExternalAttributions.Singular(attributionInfo));
}
}
SingularSDK.SetSingularDeviceAttributionCallbackHandler(new SingularDeviceAttributionHandler());
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.