Dokümantasyonumuzu sürekli güncel tutuyoruz, ancak bazı güncellemeler henüz tüm dillerde yayınlanmamış olabilir. En güncel bilgiler için lütfen İngilizce versiyonuna göz atın.
You can measure revenue associated with an event by setting the revenue and currency properties on your event instance. Use this feature to measure revenue-generating actions in your app.
To set these properties, call the setRevenue method and pass the following arguments:
let event = ADJEvent(eventToken: "abc123")
event?.setRevenue(0.01, currency: "EUR")
Adjust.trackEvent(event)
İpucu:
If you are measuring in-app purchases, call trackEvent only after the purchase is complete.
Example
In this example, we measure an event with the token g3mfiw whenever a user interacts with a button. We set the revenue property of this event to 0.25 and the currency property to EUR.
Swift
Objective-C
Javascript
import Adjust
import UIKit
class ViewControllerSwift: UIViewController {
@IBOutlet weak var btnRecordEventRevenue: UIButton?
@IBAction func btnRecordEventRevenue(_sender: UIButton) {
let event = ADJEvent(eventToken: "g3mfiw");
event?.setRevenue(0.25, currency: "EUR");
Adjust.trackEvent(event);
}
}
You can pass an optional identifier to avoid measuring duplicate events. The SDK stores the last ten identifiers and skips revenue events with duplicate transaction IDs.
To set the identifier, call the setTransactionId method and pass your transaction ID as a string argument.
Swift
Objective-C
Javascript
let event = ADJEvent(eventToken: "abc123")
event?.setTransactionId(eventIdentifier)
Adjust.trackEvent(event)
Example
In this example, we measure an event with the token g3mfiw whenever a user interacts with a button. We create a string variable called uniqueId with the value 5e85484b-1ebc-4141-aab7-25b869e54c49. We then pass this value to the setTransactionId method to set the transactionId property.
Swift
Objective-C
Javascript
import Adjust
import UIKit
class ViewControllerSwift: UIViewController {
@IBOutlet weak var btnRecordEventUnique: UIButton?
@IBAction func btnRecordEventUnique(_sender: UIButton) {
let event = ADJEvent(eventToken: "g3mfiw");
let uniqueId = "5e85484b-1ebc-4141-aab7-25b869e54c49";
event?.setTransactionId(uniqueId);
Adjust.trackEvent(event);
}
}
Adjust dashboard'undaki eventleriniz için bir callback URL'i kaydederseniz, SDK bir event ölçümlediğinde callback URL'inize Adjust tarafından bir GET request'i gönderilir.
Callback parametrelerini kendi sunucularınıza göre yapılandırabilirsiniz. Bir event parametresini yapılandırdığınızda, SDK bunu sizin callback URL'inize ekler. Bu bilgiler ile kullanıcılarınızın uygulama içindeki davranışlarını BI sisteminizle birlikte ölçümleyebilirsiniz.
Dizi anahtar-değer değişkenleriyle addCallbackParameter methodunu kullanarak eventleri tetiklemek için eventinize bir callback parametresi ekleyin. Bu methodu birden fazla kullanarak çoklu parametre ekleyebilirsiniz.
Adjust SDK'i eventi ölçer ve URL'nize callback parametreleriyle bir istek gönderir. Örneğin, http://www.mydomain.com/callback URL'ini kaydederseniz, callback'iniz böyle görünecektir:
Adjust, SDK'den URL'nize bilgi aktarmak için kullanabileceğiniz birçok placeholder'ı destekler. Örneğin, {idfa} placeholder'ı iOS, {gps_adid} placeholder'ı Android içindir. {publisher_parameter} placeholder'ı, tüm callback parametrelerini tek bir string'de toplar.
Kullanılabilir değerlerin tam listesi de dahil olmak üzere URL callback'lerinin kullanımına daha fazla bilgiyi callback rehberimizde bulabilirsiniz.
Not:
Adjust, özel callback parametrelerinizi depolamaz. Özel parametreler sadece callback URL'inize eklenir.
Example
In this example, we measure an event with the token g3mfiw whenever a user interacts with a button. We add the following callback parameters:
You can send extra information to your network partners by adding partner parameters.
Adjust sends partner parameters to external partners you have set up. This information is useful for more granular analysis and retargeting purposes. The backend forwards these parameters once you have set them up and enabled them for a partner.
Not:
Partner parameters do not appear in raw data by default. You can add the {partner_parameters} placeholder to receive them as a single string.
Add partner parameters to your event by calling the addPartnerParameter method with string key-value arguments. You can add multiple parameters by calling this method multiple times.
In this example, we measure an event with the token g3mfiw whenever a user interacts with a button. We add the following information as partner parameters:
You can add a custom string identifier to each event you want to measure. The Adjust backend can report on this identifier in event callbacks. This enables you to keep track of which events have been successfully measured.
Set up this identifier by calling the setCallbackId method with your ID as a string argument.
Swift
Objective-C
Javascript
let event = ADJEvent(eventToken: "abc123")
event?.setCallbackId("Your-Custom-ID")
Adjust.trackEvent(event)
Example
In this example, we measure an event with the token g3mfiw whenever a user interacts with a button. We create a string variable called callbackId with the value f2e728d8-271b-49ab-80ea-27830a215147. We then pass this value to the setCallbackId method to set the callbackId property.
Swift
Objective-C
Javascript
import Adjust
import UIKit
class ViewControllerSwift: UIViewController {
@IBOutlet weak var btnRecordEventCallbackId: UIButton?
@IBAction func btnRecordEventCallbackId(_sender: UIButton) {
let event = ADJEvent(eventToken: "g3mfiw");
event?.setCallbackId("f2e728d8-271b-49ab-80ea-27830a215147")
Adjust.trackEvent(event);
}
}