Device IDs
The Adtrace SDK enables the collection of useful device identifiers. You can use these for reporting purposes by including them in your callbacks.
iOS ID for Advertisers (IDFA)
Some analytics services need you to coordinate device and client IDs. This is necessary to prevent duplicate reporting. You can gather the device IDFA by calling the idfa` method .
- Objective-C
- Swift
- Javascript
NSString *idfa = [Adtrace idfa];
let idfa = Adtrace.idfa()
Adtrace.getIdfa(function(idfa) {
// …
});
Adtrace device identifier (ADID)
When the backend tracks a device, it generates a unique ID for it. To get the device's ADID, call the adid method.
The ADID is only available after the Adtrace backend has tracked an install. It is not possible to access the ADID before you initialize the SDK. Once the SDK has sent the install information to the backend, you will be able to access the ADID.
- Objective-C
- Swift
- Javascript
NSString *adid = [Adtrace adid];
let adid = Adtrace.adid()
var adid = Adtrace.getAdid();
External device ID (Experimental)
This feature is not fully integrated to Adtrace panel!
An external device identifier is a custom value that you can assign to a device or user. They can help you to recognize users across sessions and platforms. They can also help you to deduplicate installs by user so that a user isn't counted as multiple new installs.
You can also use an external device ID as a custom identifier for a device. This can be useful if you use these identifiers elsewhere and want to keep continuity.
You need to set your external device ID before initializing the Adtrace SDK.
To set an external device ID, assign the identifier to the externalDeviceId property of your config instance. The external device ID is case-sensitive. If you have imported external device IDs, you need to make sure the value you pass matches the imported value.
- Objective-C
- Swift
- Javascript
[adtraceConfig setExternalDeviceId:@"yourExternalDeviceId"];
adtraceConfig?.externalDeviceId = "yourExternalDeviceId"
adtraceConfig.setExternalDeviceId("yourExternalDeviceId");