The event is used for individual tracking of ad revenue on user devices. The method is used if there are CPI data available on the client device (they can be obtained from the ad network SDK).
Do not apply this method if you use ad networks that utilize the server-server protocol for sending ad revenue data (ironSource, AppLovin MAX, and Fyber networks) and you already set up this method of data collection because if you use both data sources, your revenue data may be duplicated.
Parameter
Type
Restrictions
Description
DTDAnalytics.adImpression(network:"Network name", revenue:0.15, placement:"Placement of the banner", unit:"Banner title")
Parameter
Type
Restrictions
Description
[DTDAnalytics adImpressionWithNetwork:@"Network name"
revenue:0.15f
placement:@"Placement of the banner"
unit:@"Banner title"];
Parameter
Type
Restrictions
Description
DTDAnalytics.adImpression( network ="Network name", revenue =0.45, placement ="Placement of the banner", unit ="Banner title")
DTDAnalytics.INSTANCE.adImpression("Network name",0.45,"Placement of the banner","Banner title");
var network ="Network name";var revenue =0.15;var placement ="Placement of the banner";var unit ="Banner title";DTDAnalytics.AdImpression(network, revenue, placement, unit);
var network ="Network name";var revenue =0.15;var placement ="Placement of the banner";var unit ="Banner title";DTDAnalytics.AdImpression(network, revenue, placement, unit);
var reffer =GDDTDReferralProperty.new()reffer.AddCampaign("Warm Snow Boots")reffer.AddContent("Snow Boots")reffer.AddMedium("CPI")reffer.AddSource("AdWords")reffer.AddTerm("shoes+boots")DTDAnalytics.Referrer(reffer)
Force dispatch of accumulated events
To send an event packet before it is full (10 events, by default) or before the end of the period of its formation (2 minutes, by default), you can use immediate dispatch.
We don’t recommend using this method unless absolutely necessary!
When the Real payment event is created, the forced dispatch of the packet occurs automatically.
DTDAnalytics.sendBufferedEvents()
[DTDAnalytics sendBufferedEvents];
DTDAnalytics.sendBufferedEvents()
DTDAnalytics.INSTANCE.sendBufferedEvents();
DTDAnalytics.SendBufferedEvents();
DTDAnalytics.SendBufferedEvents();
window.devtodev.sendBufferedEvents()
UDTDAnalyticsBPLibrary::SendBufferedEvents();
DTDAnalytics.SendBufferedEvents()
Setters & Getters
When working with getters you should take into account that the new devtodev SDK is completely asynchronous. The execution result must be processed within the completionHandler.
All set and get methods need to be called only after the initialization of the SDK.
It is also worth remembering that the SDK will call the callback in background queues, so we recommend that you transfer the processing of return values to the queue you need.
For example:
DispatchQueue.main.async{}
dispatch_async(dispatch_get_main_queue(), ^{ });
Handler(Looper.getMainLooper()).post{}
ContextCompat.getMainExecutor(context).execute(() -> {
// This is where your UI code goes.
});
var result = await DTDAnalytics.GetUserId();
DTDAnalytics.GetUserId( id => {
//your code
});
auto onResult = new FDTDGetterStringDelegate();
onResult->BindLambda([](const FString& value)
{
// Your code...
});
UDTDAnalyticsBPLibrary::GetUserId(*onResult);
Setting User Tracking Status (GDPR)
This method denies/allows tracking of user data and also implements the right to be forgotten in accordance with the requirements of the GDPR.
When this method is called with the 'false' value, the SDK sends a command to the server to delete all personal user data that was collected by devtodev in this application, blocking further user data collection.
The user will remain in the devtodev system only as an impersonal unit in the previously aggregated metrics.
If it is set to ‘true', tracking can be enabled again. In this case, the user will be considered new.
To enable/disable user tracking by the devtodev system. Bool type.
DTDAnalytics.getDeviceId { deviceId in
// your code
}
[DTDAnalytics deviceIdHandler:^(NSString * _Nonnull deviceId) {
// your code
}];
DTDAnalytics.getDeviceId { deviceId ->
// your code
}
DTDAnalytics.INSTANCE.getDeviceId(deviceId ->
// your code
null
);
var devideId = await DTDAnalytics.GetDeviceId();
DTDAnalytics.GetDeviceId( id => {
//your code
});
var devideId = window.devtodev.getDeviceId()
auto onResult = new FDTDGetterStringDelegate();
onResult->BindLambda([](const FString& value)
{
// Your code...
});
UDTDAnalyticsBPLibrary::GetDeviceId(*onResult);
var trackingAvailability = window.devtodev.getTrackingAvailability()
auto onResult = new FDTDGetterBoolDelegate();
onResult->BindLambda([](bool value)
{
// Your code...
});
UDTDAnalyticsBPLibrary::GetTrackingAvailability(*onResult);
devtodev ID is the primary numeric identifier for the device/user account in the devtodev database. Using devtodev ID, you are sure to find the user in devtodev.
The identifier will be received from the server some time after the initialization of the SDK.
If you have set counting by users, a separate devtodev id will be issued for each device user.
To obtain the devtodev ID, you need to pass the listener to DTDAnalytics:
The delegate must implement the (void)didReceiveDevtodevIdWith:(NSInteger)devtodevId;
- (void)didReceiveDevtodevIdWith:(NSInteger)devtodevId {
// your code
}
The didReceiveDevtodevId method will be called with every ID change on the server side.
To obtain the devtodev ID, you need to pass the DTDIdentifiersListener listener to DTDAnalytics:
DTDAnalytics.setIdentifiersListener(object : DTDIdentifiersListener {
override fun didReceiveDevtodevId(devtodevId: Long) {
/// your code
}
})
The didReceiveDevtodevId method will be called with every ID change on the server side.
To obtain the devtodev ID, you need to pass the DTDIdentifiersListener listener to DTDAnalytics:
DTDAnalytics.INSTANCE.setIdentifiersListener(new DTDIdentifiersListener() {
@Override
public void didReceiveDevtodevId(long devtodevId) {
// your code
}
});
The didReceiveDevtodevId method will be called with every ID change on the server side.
To obtain the devtodev ID, you need to pass the DTDIdentifiersListener listener delegate to DTDAnalytics:
DTDAnalytics.SetIdentifiersListener(devtodevId =>
{
// Your code...
});
The delegate method will be called with every ID change on the server side.
To obtain the devtodev ID, you need to pass the DTDIdentifiersListener listener delegate to DTDAnalytics:
DTDAnalytics.SetIdentifiersListener(devtodevId =>
{
// Your code...
});
The delegate method will be called with every ID change on the server side.
window.devtodev.setIdentifiersListener((devtodevId) =>
{
// Your code...
})
auto listener = new FDTDGetterLongDelegate();
listener->BindLambda([](int64 value)
{
// Your code...
});
UDTDAnalyticsBPLibrary::SetIdentifiersListener(*listener);
To obtain the devtodev ID, you need to pass the Callable to DTDAnalytics:
DTDAnalytics.SetIdentifiersCallback(identifiersUpdated)
func identifiersUpdated(devtodevID: int):
print("SetIdentifiersCallback DevtodevID is " + str(devtodevID))
The didReceiveDevtodevId method will be called with every ID change on the server side.
Initialization callback
To receive a callback when the SDK initialization is complete, you can use amethod that will implement the initialization callback. When the SDK completes the initialization, the callback will be called on the main application thread.
We recommend implementing a callback before calling initialization.
DTDAnalytics.setInitializationCompleteCallback {
print("Initialized has been finished.")
}
let config = DTDAnalyticsConfiguration()
config.logLevel = .error
DTDAnalytics.initialize(applicationKey: "App ID", configuration: config)
DTDAnalytics.setInitializationCompleteCallback {
Log.d("TAG", "Initialized has been finished.")
}
val config = DTDAnalyticsConfiguration()
config.logLevel = DTDLogLevel.Error
DTDAnalytics.initialize(appKey = "App ID", analyticsConfiguration = config, context = this)
DTDAnalytics.INSTANCE.setInitializationCompleteCallback(() -> {
Log.d("TAG", "Initialized has been finished.");
return null;
});
DTDAnalyticsConfiguration config = new DTDAnalyticsConfiguration();
config.setLogLevel(DTDLogLevel.Error);
DTDAnalytics.INSTANCE.initialize("App ID", config, this);
DTDAnalytics.LogLevel = DTDLogLevel.Error;
DTDAnalytics.SetInitializationCompleteCallback(()=>Console.WriteLine($"Initialization has been finished"));
DTDAnalytics.Initialize("APP_KEY");
DTDAnalytics.SetInitializationCompleteCallback(() =>
{
Debug.Log("Initialized has been finished.");
});
DTDAnalytics.SetLogLevel(DTDLogLevel.Error);
DTDAnalytics.Initialize("APP_KEY");
func initCompleteCallback():
print("Initialized has been finished.")
func _ready():
DTDAnalytics.SetInitializationCompleteCallback(initCompleteCallback)
var config = GDDTDAnalyticsConfiguration.new()
config.logLevel = GDDTDLogLevel.Error
DTDAnalytics.InitializeWithConfig(appKey, config)
Parameter
Type
Restrictions
Description
Parameter
Type
Restrictions
Description
Parameter
Type
Restrictions
Description
Parameter
Type
Restrictions
Description
network
String
from 1 to 100 symbols
Name of the ad network responsible for the impression
revenue
Double
from 0,0 to Double.max
Reward for banner display in USD
placement
String?
from 1 to 100 symbols,
optional
Banner placement
unit
String?
from 1 to 100 symbols,
optional
Banner name
network
NSString
from 1 to 100 symbols
Name of the ad network responsible for the impression
revenue
double
from 0,0 to Double.max
Reward for banner display in USD
placement
NSString _Nullable
from 1 to 100 symbols,
optional
Banner placement
unit
NSString _Nullable
from 1 to 100 symbols,
optional
Banner name
network
String
from 1 to 100 symbols
Name of the ad network responsible for the impression
revenue
Double
from 0,0 to Double.max
Reward for banner display in USD
placement
String?
from 1 to 100 symbols,
optional
Banner placement
unit
String?
from 1 to 100 symbols,
optional
Banner name
network
String
from 1 to 100 symbols
Name of the ad network responsible for the impression
revenue
Double
from 0,0 to Double.max
Reward for banner display in USD
placement
String?
from 1 to 100 symbols,
optional
Banner placement
unit
String?
from 1 to 100 symbols,
optional
Banner name
network
String
from 1 to 100 symbols
Name of the ad network responsible for the impression
revenue
Double
from 0,0 to Double.max
Reward for banner display in USD
placement
String?
from 1 to 100 symbols,
optional
Banner placement
unit
String?
from 1 to 100 symbols,
optional
Banner name
network
String
from 1 to 100 symbols
Name of the ad network responsible for the impression
revenue
Double
from 0,0 to Double.max
Reward for banner display in USD
placement
String?
from 1 to 100 symbols,
optional
Banner placement
unit
String?
from 1 to 100 symbols,
optional
Banner name
Parameter
Type
Restrictions
Description
socialNetwork
FString
from 1 to 100 symbols
The name of the ad network that delivered the impression.
revenue
float
form 0.0 to float.MaxValue
Reward for displaying a banner in USD.
placement
FString
from 1 to 100 symbols
Placement of the banner.
unit
FString
from 1 to 100 symbols
Banner title.
network
String
from 1 to 100 symbols
Name of the ad network responsible for the impression