사용자 지정 이벤트 로깅
Braze SDK를 통해 사용자 지정 이벤트를 기록하는 방법을 알아보세요.
note:
목록에 없는 래퍼 SDK의 경우 관련 네이티브 Android 또는 Swift 메서드를 대신 사용하세요.
사용자 지정 이벤트 로깅하기
사용자 지정 이벤트를 기록하려면 다음 이벤트 로깅 방법을 사용하세요.
네이티브 Android의 경우 다음 방법을 사용할 수 있습니다:
1
| Braze.getInstance(context).logCustomEvent(YOUR_EVENT_NAME);
|
1
| Braze.getInstance(context).logCustomEvent(YOUR_EVENT_NAME)
|
인필리온 비콘을 앱에 통합한 경우 visit.getPlace()
을 추가로 사용하여 위치별 이벤트를 기록할 수 있습니다. requestImmediateDataFlush
은 앱이 백그라운드에 있는 경우에도 이벤트가 기록되는지 확인합니다.
1
2
| Braze.getInstance(context).logCustomEvent("Entered " + visit.getPlace());
Braze.getInstance(context).requestImmediateDataFlush();
|
1
2
| Braze.getInstance(context).logCustomEvent("Entered " + visit.getPlace())
Braze.getInstance(context).requestImmediateDataFlush()
|
1
| AppDelegate.braze?.logCustomEvent(name: "YOUR_EVENT_NAME")
|
1
| [AppDelegate.braze logCustomEvent:@"YOUR_EVENT_NAME"];
|
표준 웹 SDK 구현의 경우 다음 방법을 사용할 수 있습니다:
1
| braze.logCustomEvent("YOUR_EVENT_NAME");
|
대신 Google 태그 관리자를 사용하려면 사용자 지정 이벤트 태그 유형을 사용하여 logCustomEvent
메서드를 호출하고 사용자 지정 이벤트 속성을 포함하여 선택적으로 사용자 지정 이벤트를 Braze에 전송할 수 있습니다. 이렇게 하려면
- 변수를 사용하거나 이벤트 이름을 입력하여 이벤트 이름을 입력합니다.
- 행 추가 버튼을 사용하여 이벤트 속성을 추가합니다.

1
| braze.logCustomEvent('YOUR_EVENT_NAME');
|
1
| Braze.logCustomEvent("YOUR_EVENT_NAME");
|
1
| m.Braze.logEvent("YOUR_EVENT_NAME")
|
1
| AppboyBinding.LogCustomEvent("YOUR_EVENT_NAME");
|
1
| UBraze->LogCustomEvent(TEXT("YOUR_EVENT_NAME"));
|
메타데이터 속성 추가하기
사용자 지정 이벤트를 기록할 때 이벤트와 함께 속성 개체를 전달하여 해당 사용자 지정 이벤트에 대한 메타데이터를 추가하는 옵션이 있습니다. 속성은 키-값 쌍으로 정의됩니다. 키는 문자열이며 값은 string
, numeric
, boolean
또는 Date
오브젝트일 수 있습니다.
메타데이터 속성을 추가하려면 다음 이벤트 로깅 메서드를 사용합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| Braze.logCustomEvent("YOUR-EVENT-NAME",
new BrazeProperties(new JSONObject()
.put("you", "can")
.put("pass", false)
.put("orNumbers", 42)
.put("orDates", new Date())
.put("or", new JSONArray()
.put("any")
.put("array")
.put("here"))
.put("andEven", new JSONObject()
.put("deeply", new JSONArray()
.put("nested")
.put("json"))
)
));
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| Braze.logCustomEvent("YOUR-EVENT-NAME",
BrazeProperties(JSONObject()
.put("you", "can")
.put("pass", false)
.put("orNumbers", 42)
.put("orDates", Date())
.put("or", JSONArray()
.put("any")
.put("array")
.put("here"))
.put("andEven", JSONObject()
.put("deeply", JSONArray()
.put("nested")
.put("json"))
)
))
|
1
2
3
4
5
6
7
8
9
10
11
12
13
| AppDelegate.braze?.logCustomEvent(
name: "YOUR-EVENT-NAME",
properties: [
"you": "can",
"pass": false,
"orNumbers": 42,
"orDates": Date(),
"or": ["any", "array", "here"],
"andEven": [
"deeply": ["nested", "json"]
]
]
)
|
1
2
3
4
5
6
7
8
9
10
11
| [AppDelegate.braze logCustomEvent:@"YOUR-EVENT-NAME"
properties:@{
@"you": @"can",
@"pass": @(NO),
@"orNumbers": @42,
@"orDates": [NSDate date],
@"or": @[@"any", @"array", @"here"],
@"andEven": @{
@"deeply": @[@"nested", @"json"]
}
}];
|
1
2
3
4
5
6
7
8
9
10
| braze.logCustomEvent("YOUR-EVENT-NAME", {
you: "can",
pass: false,
orNumbers: 42,
orDates: new Date(),
or: ["any", "array", "here"],
andEven: {
deeply: ["nested", "json"]
}
});
|
1
2
3
4
5
| braze.logCustomEvent('custom_event_with_properties', properties: {
'key1': 'value1',
'key2': ['value2', 'value3'],
'key3': false,
});
|
1
2
3
4
5
| Braze.logCustomEvent("custom_event_with_properties", {
key1: "value1",
key2: ["value2", "value3"],
key3: false,
});
|
1
| m.Braze.logEvent("YOUR_EVENT_NAME", {"stringPropKey" : "stringPropValue", "intPropKey" : Integer intPropValue})
|
1
| AppboyBinding.LogCustomEvent("event name", properties(Dictionary<string, object>));
|
1
2
3
4
5
6
7
8
9
| TMap<FString, FString> Properties;
Properties.Add(TEXT("you"), TEXT("can"));
Properties.Add(TEXT("pass"), TEXT("false"));
Properties.Add(TEXT("orNumbers"), FString::FromInt(42));
Properties.Add(TEXT("orDates"), FDateTime::Now().ToString());
Properties.Add(TEXT("or"), TEXT("any,array,here")); // Arrays are stored as comma-separated strings
Properties.Add(TEXT("andEven"), TEXT("deeply:nested,json"));
UBraze->LogCustomEventWithProperties(TEXT("YOUR_EVENT_NAME"), Properties);
|
important:
time
및 event_name
키는 예약되어 있으며 사용자 지정 이벤트 속성으로 사용할 수 없습니다.