adjust-icon

이벤트 정보 전송

Adjust SDK가 제공하는 AdjustEvent 객체는 이벤트 정보를 구성하고 이러한 정보를 앱에서 Adjust 서버로 전송하는 데 사용할 수 있습니다.

AdjustEvent 객체 인스턴스화

메서드 서명
public AdjustEvent(string eventToken)
{
this.eventToken = eventToken;
this.isReceiptSet = false;
}

Adjust SDK를 사용하여 이벤트 정보를 전송하려면 AdjustEvent 객체를 인스턴스화해야 합니다. 이 객체에는 앱에서 이벤트가 발생할 때 Adjust로 전송되는 변수가 포함됩니다.

이벤트 객체를 인스턴스화하려면 새로운 AdjustEvent 인스턴스를 생성하고 다음 파라미터를 전달합니다.

AdjustEvent adjustEvent = new AdjustEvent("abc123");
//...
Adjust.trackEvent(adjustEvent);

이벤트 전송

메서드 서명
public static void trackEvent(AdjustEvent adjustEvent);

Adjust 이벤트 토큰을 연결하여 앱의 이벤트를 기록할 수 있습니다. 이벤트 기록 방법:

  • 새 Adjust 이벤트 인스턴스를 만들고 이벤트 토큰을 문자열 인수로 전달합니다.
  • 이벤트 인스턴스를 인수로 trackEvent 메서드를 호출합니다.
AdjustEvent adjustEvent = new AdjustEvent("abc123");
//...
Adjust.trackEvent(adjustEvent);

예시

본 예시에서는 사용자가 버튼을 조작할 때마다 g3mfiw라는 토큰으로 이벤트를 기록하는 방법을 보여줍니다.

if (GUI.Button(new Rect(0, Screen.height * 1 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Send Simple Event")) {
AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
Adjust.trackEvent(adjustEvent);
}
이벤트 로그
Path: /event
ClientSdk: unity4.38.1
Parameters:
android_uuid 781f17d5-5048-4fae-a4e5-77b58bab62b9
api_level 34
41 collapsed lines
app_token 2fm9gkqubvpc
app_version 1.0
attribution_deeplink 1
callback_params {"key":"value","foo":"bar"}
connectivity_type 1
country US
cpu_type arm64-v8a
created_at 2024-01-25T14:13:16.151Z+0100
currency EUR
device_manufacturer Google
device_name sdk_gphone64_arm64
device_type phone
display_height 2205
display_width 1080
environment sandbox
event_buffering_enabled 0
event_count 3
event_token g3mfiw
gps_adid 5962dfc1-3a53-4692-850b-22c4bf4311a5
gps_adid_attempt 2
gps_adid_src service
hardware_name UE1A.230829.036
language en
mcc 310
mnc 260
needs_response_details 1
os_build UE1A.230829.036
os_name android
os_version 14
package_name com.adjust.examples
partner_params {"key":"value","foo":"bar"}
revenue 0.25
screen_density high
screen_format long
screen_size normal
session_count 2
session_length 23
subsession_count 1
time_spent 23
tracking_enabled 1
ui_mode 1

매출 이벤트 기록

메서드 서명
public void setRevenue(double amount, string currency);

이벤트 인스턴스에서 매출 및 통화 속성을 설정하여 이벤트 관련 매출을 기록할 수 있습니다. 이 기능을 사용하여 앱 내에서 매출을 발생시키는 행동을 측정하시기 바랍니다.

이러한 속성을 설정하려면 setRevenue 메서드를 호출하고 다음 인수를 전달합니다.

  • revenue (double): 해당 이벤트에 의해 창출된 매출 금액
  • currency (string): 이벤트 통화의 ISO 4217 코드
AdjustEvent adjustEvent = new AdjustEvent("abc123");
//...
adjustEvent.setRevenue(0.01, "EUR");
//...
Adjust.trackEvent(adjustEvent);

예시

본 예시에서는 사용자가 버튼을 조작할 때마다 g3mfiw라는 토큰으로 이벤트를 기록하는 방법을 보여줍니다. 이 함수는 이벤트의 revenue 속성을 0.25 , currency 속성을 EUR 로 설정합니다.

if (GUI.Button(new Rect(0, Screen.height * 2 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Send Revenue Event")) {
AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
adjustEvent.setRevenue(0.25, "EUR");
Adjust.trackEvent(adjustEvent);
}
이벤트 로그
Path: /event
ClientSdk: unity4.38.1
Parameters:
environment sandbox
event_count 3
event_token abc123
revenue 0.25
currency EUR

결제 검증

구매 검증을 활성화한 경우, 검증을 위해 구매 이벤트와 함께 추가 정보를 전송해야 합니다. Adjust의 서버는 이벤트 객체에서 이 정보를 수신하면 이를 Apple에 전달하여 구매를 검증합니다.

  • productId (string): 성공적으로 구매된 아이템의 제품 ID
  • purchaseToken (string): 성공적으로 완료된 인앱 구매에 대해 생성된 구매 토큰
AdjustEvent adjustEvent = new AdjustEvent("abc123");
adjustEvent.setRevenue(6.0, "EUR");
adjustEvent.setProductId("product-id"); // Android & iOS
adjustEvent.setTransactionId("transaction-id"); // iOS only
adjustEvent.setReceipt("receipt"); // iOS only
adjustEvent.setPurchaseToken("purchase-token"); // Android only
Adjust.trackEvent(adjustEvent);

고유 이벤트

메서드 서명
public void setTransactionId(string transactionId);

중복 이벤트 기록을 방지하기 위해 선택적 식별자를 전달할 수 있습니다. SDK는 최근순으로 10개의 ID를 저장하고, 중복된 트랜잭션 ID가 있는 매출 이벤트를 건너뜁니다.

ID를 설정하려면 setTransactionId 메서드를 호출하고 트랜잭션 ID를 string 인수로 전달합니다.

AdjustEvent adjustEvent = new AdjustEvent("abc123");
//...
adjustEvent.setTransactionId("transactionId");
//...
Adjust.trackEvent(adjustEvent);

예시

본 예시에서는 사용자가 버튼을 조작할 때마다 g3mfiw라는 토큰으로 이벤트를 기록하는 방법을 보여줍니다. 이 함수는 setTransactionId 메서드를 사용하여 uniqueId5e85484b-1ebc-4141-aab7-25b869e54c49로 설정합니다.

if (GUI.Button(new Rect(0, Screen.height * 2 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Send Unique Event")) {
AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
string uniqueId = "5e85484b-1ebc-4141-aab7-25b869e54c49"
adjustEvent.setTransactionId(uniqueId);
Adjust.trackEvent(adjustEvent);
}
이벤트 로그
Path: /event
ClientSdk: unity4.38.1
Parameters:
environment sandbox
event_count 3
event_token abc123
transaction_id 5e85484b-1ebc-4141-aab7-25b869e54c49

콜백 파라미터 추가

메서드 서명
public void addCallbackParameter(string key, string value);

Adjust 대시보드에 콜백 URL을 등록하면 SDK가 이벤트를 기록할 때 ADK가 GET 요청을 콜백 URL로 보냅니다.

서버로 보낼 콜백 파라미터를 구성할 수 있습니다. 이벤트에 대한 파라미터 구성이 완료되면 SDK는 이를 콜백 URL에 추가합니다. 해당 정보를 사용하여, BI 시스템을 통해 사용자 인앱 행동을 분석할 수 있습니다.

string 키-값 인수와 함께 addCallbackParameter 메서드를 호출하여 이벤트에 콜백 파라미터를 추가합니다. 이 메서드를 여러 번 호출함으로써 여러 파라미터를 추가할 수 있습니다.

AdjustEvent adjustEvent = new AdjustEvent("abc123");
//...
adjustEvent.addCallbackParameter("key", "value");
//...
Adjust.trackEvent(adjustEvent);

Adjust SDK는 이벤트를 측정하고 콜백 파라미터가 추가된 URL로 요청을 전송합니다. 예를 들어 URL https://www.mydomain.com/callback을 등록한 경우 콜백은 다음과 같습니다.

https://www.mydomain.com/callback?key=value&foo=bar

CSV 업로드를 사용하는 경우, 반드시 CSV 정의에 파라미터를 추가하시기 바랍니다.

Adjust는 SDK에서 URL로 정보를 전송하는 데 사용할 수 있는 다양한 플레이스홀더를 지원합니다. 예를 들어, iOS의 경우 {idfa} 플레이스홀더, Android의 경우 {gps_adid} 플레이스홀더입니다. {publisher_parameter} 플레이스홀더는 단일 문자열의 모든 콜백 파라미터를 나타냅니다.

예시

본 예시에서는 사용자가 버튼을 조작할 때마다 g3mfiw라는 토큰으로 이벤트를 기록하는 방법을 보여줍니다. 다음 콜백 파라미터가 추가됩니다.

  • 다양한 event_token
  • 이벤트별로 생성되는 revenue_amount

콜백 URL의 결과는 다음과 같습니다.

http://www.mydomain.com/callback?event_token=g3mfiw&revenue_amount=0.05
if (GUI.Button(new Rect(0, Screen.height * 2 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Send Callback Event")) {
AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
adjustEvent.addCallbackParameter("event_token", "g3mfiw");
adjustEvent.addCallbackParameter("revenue_amount", "0.05");
Adjust.trackEvent(adjustEvent);
}
이벤트 로그
Path: /event
ClientSdk: unity4.38.1
Parameters:
callback_params {"event_token":"g3mfiw","revenue_amount":"0.05"}
environment sandbox
event_count 1
event_token g3mfiw

파트너 파라미터 추가

메서드 서명
public void addPartnerParameter(string key, string value);

파트너 파라미터를 추가하여 네트워크 파트너에게 추가 정보를 전송할 수 있습니다.

Adjust는 설정한 외부 파트너에게 파트너 파라미터를 전송합니다. 이러한 정보는 보다 세분화된 분석과 리타겟팅에 유용할 것입니다. 파트너에 대해 파라미터를 설정하고 활성화하면 Adjust 서버는 해당 파라미터를 포워드 합니다.

string 키-값 인수와 함께 addPartnerParameter 메서드를 호출하여 이벤트에 파트너 파라미터를 추가합니다. 이 메서드를 여러 번 호출함으로써 여러 파라미터를 추가할 수 있습니다.

AdjustEvent adjustEvent = new AdjustEvent("abc123");
//...
adjustEvent.addPartnerParameter("key", "value");
//...
Adjust.trackEvent(adjustEvent);

예시

본 예시에서는 사용자가 버튼을 조작할 때마다 g3mfiw라는 토큰으로 이벤트를 기록하는 방법을 보여줍니다. 다음 파트너 파라미터가 추가됩니다.

  • 관련 제품의 product_id
  • 이벤트를 트리거한 사용자의 user_id
if (GUI.Button(new Rect(0, Screen.height * 2 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Send Partner Event")) {
AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
adjustEvent.addPartnerParameter("product_id", "29");
adjustEvent.addPartnerParameter("user_id", "835");
Adjust.trackEvent(adjustEvent);
}
이벤트 로그
Path: /event
ClientSdk: unity4.38.1
Parameters:
partner_params {"product_id":"29","user_id":"835"}
environment sandbox
event_count 1
event_token g3mfiw

콜백 ID 추가

메서드 서명
public void setCallbackId(string callbackId)

트래킹하려는 각 이벤트에 커스텀 문자열 ID를 추가할 수도 있습니다. Adjust 서버는 이벤트 콜백에서 이러한 식별자를 보고합니다. 이를 통해 성공적으로 트래킹된 이벤트 확인이 가능합니다.

ID를 string 인수로 한 setCallbackId 메서드를 호출하여 이 ID를 설정할 수 있습니다.

AdjustEvent adjustEvent = new AdjustEvent("abc123");
//...
adjustEvent.setCallbackId("{your_callback_id}");
//...
Adjust.trackEvent(adjustEvent);

예시

본 예시에서는 사용자가 버튼을 조작할 때마다 g3mfiw라는 토큰으로 이벤트를 기록하는 방법을 보여줍니다. callbackIdf2e728d8-271b-49ab-80ea-27830a215147로 설정되었습니다.

if (GUI.Button(new Rect(0, Screen.height * 2 / numberOfButtons, Screen.width, Screen.height / numberOfButtons), "Send Unique Callback Event")) {
AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
string callbackId = "f2e728d8-271b-49ab-80ea-27830a215147"
adjustEvent.setCallbackId(callbackId);
Adjust.trackEvent(adjustEvent);
}
이벤트 로그
Path: /event
ClientSdk: unity4.38.1
Parameters:
environment sandbox
event_count 3
event_token g3mfiw
callback_id f2e728d8-271b-49ab-80ea-27830a215147