Messaging : 푸시/인앱 메시지
Wisetracker Messaging 서비스를 이용하는 고객들을 대상으로 측정을 권장하는 인앱 이벤트 API와 적용 예시를 안내합니다.
푸시메시지 알림 허용
푸시메시지 알림 허용이 완료된 시점에 아래 코드를 추가합니다.
Map<String, Object> eventMap = new HashMap<>();
eventMap.put("event", "w_notification_opt_in");
DOT.logEvent(eventMap);
val eventMap = mutableMapOf<String,Any>()
eventMap["event"] = "w_notification_opt_in"
DOT.logEvent(eventMap)
var screen = NSMutableDictionary()
screen["event"] = "w_notification_opt_in"
DOT.logEvent(screen)
NSMutableDictionary *screen = [[NSMutableDictionary alloc] init];
[screen setValue:@"w_notification_opt_in" forKey:@"event"];
[DOT logEvent:screen];
var screen = new Object();
screen["event"] = "w_notification_opt_in";
DOT.logEvent(screen);
// 웹사이트의 푸시수신동의여부는 해당사항 없습니다.
// .dart 에서 호출 할 때
Map notification = {};
notification["event"] = "w_notification_opt_in";
DOT.logEvent(notification);
// webview 에서 호출 할 때
DotFlutterDataBridge.postMessage(JSON.stringify({
method : "logEvent",
data: {
event : "w_notification_opt_in"
}
}));
// .js 에서 호출 할 때
NativeModules.DotReactBridge.logEvent(JSON.stringify({
event : "w_notification_opt_in"
}));
// webview 에서 호출 할 때
window.ReactNativeWebView.postMessage(JSON.stringify({
method:"logEvent",
data : {
event : "w_notification_opt_in"
}
}));
Dictionary<string, object> page = new Dictionary<string, object>();
page.Add("event", "w_notification_opt_in");
DOT.logEvent(page);
푸시메시지 알림 거부
푸시메시지 알림 거부가 완료된 시점에 아래 코드를 추가합니다.
Map<String, Object> eventMap = new HashMap<>();
eventMap.put("event", "w_notification_opt_in_reject");
DOT.logEvent(eventMap);
val eventMap = mutableMapOf<String,Any>()
eventMap["event"] = "w_notification_opt_in_reject"
DOT.logEvent(eventMap)
var screen = NSMutableDictionary()
screen["event"] = "w_notification_opt_in_reject"
DOT.logEvent(screen)
NSMutableDictionary *screen = [[NSMutableDictionary alloc] init];
[screen setValue:@"w_notification_opt_in_reject" forKey:@"event"];
[DOT logEvent:screen];
var screen = new Object();
screen["event"] = "w_notification_opt_in_reject";
DOT.logEvent(screen);
// 웹사이트의 푸시수신동의여부는 해당사항 없습니다.
// .dart 에서 호출 할 때
Map notification = {};
notification["event"] = "w_notification_opt_in_reject";
DOT.logEvent(notification);
// webview 에서 호출 할 때
DotFlutterDataBridge.postMessage(JSON.stringify({
method : "logEvent",
data: {
event : "w_notification_opt_in_reject"
}
}));
// .js 에서 호출 할 때
NativeModules.DotReactBridge.logEvent(JSON.stringify({
event : "w_notification_opt_in_reject"
}));
// webview 에서 호출 할 때
window.ReactNativeWebView.postMessage(JSON.stringify({
method:"logEvent",
data : {
event : "w_notification_opt_in_reject"
}
}))
Dictionary<string, object> page = new Dictionary<string, object>();
page.Add("event", "w_notification_opt_in_reject");
DOT.logEvent(page);
인앱메시지 노출
인앱메시지가 노출된 시점에 아래 코드를 추가합니다.
Map<String, Object> eventMap = new HashMap<>();
eventMap.put("event", "w_inappmsg_impression");
DOT.logScreen(eventMap);
val eventMap = mutableMapOf<String,Any>()
eventMap["event"] = "w_inappmsg_impression"
DOT.logScreen(eventMap)
var screen = NSMutableDictionary()
screen["event"] = "w_inappmsg_impression"
DOT.logScreen(screen)
NSMutableDictionary *screen = [[NSMutableDictionary alloc] init];
[screen setValue:@"w_inappmsg_impression" forKey:@"event"];
[DOT logScreen:screen];
var screen = new Object();
screen["event"] = "w_inappmsg_impression";
DOT.logScreen(screen);
var screen = new Object();
screen["event"] = "w_inappmsg_impression";
WDOT.logScreen(screen);
// .dart 에서 호출 할 때
Map impression = {};
notification["event"] = "w_inappmsg_impression";
DOT.logScreen(impression);
// webview 에서 호출 할 때
DotFlutterDataBridge.postMessage(JSON.stringify({
method : "logScreen",
data: {
event : "w_inappmsg_impression"
}
}));
// .js 에서 호출 할 때
NativeModules.DotReactBridge.logScreen(JSON.stringify({
event : "w_inappmsg_impression"
}));
// webview 에서 호출 할 때
window.ReactNativeWebView.postMessage(JSON.stringify({
method:"logScreen",
data : {
event : "w_inappmsg_impression"
}
}));
Dictionary<string, object> page = new Dictionary<string, object>();
page.Add("event", "w_inappmsg_impression");
DOT.logScreen(page);
인앱메시지 클릭
인앱메시지를 클릭한 시점에 아래 코드를 추가합니다.
Map<String, Object> eventMap = new HashMap<>();
eventMap.put("event", "w_inappmsg_click");
DOT.logEvent(eventMap);
val eventMap = mutableMapOf<String,Any>()
eventMap["event"] = "w_inappmsg_click"
DOT.logEvent(eventMap)
let event = NSMutableDictionary()
event["event"] = "w_inappmsg_click"
DOT.logEvent(event)
NSMutableDictionary *event = [[NSMutableDictionary alloc] init];
[event setValue:@"w_inappmsg_click" forKey:@"event"];
[DOT logEvent:event];
var event = new Object();
event["event"] = "w_inappmsg_click";
DOT.logEvent(event);
var event = new Object();
event["event"] = "w_inappmsg_click";
WDOT.logEvent(event);
// .dart 에서 호출 할 때
Map inappmsgClick = {};
inappmsgClick["event"] = "w_inappmsg_click";
DOT.logEvent(inappmsgClick);
// webview 에서 호출 할 때
DotFlutterDataBridge.postMessage(JSON.stringify({
method : "logEvent",
data: {
event : "w_inappmsg_click"
}
}));
// .js 에서 호출 할 때
NativeModules.DotReactBridge.logEvent(JSON.stringify({
event : "w_inappmsg_click"
}));
// webview 에서 호출 할 때
window.ReactNativeWebView.postMessage(JSON.stringify({
method:"logEvent",
data : {
event : "w_inappmsg_click"
}
}));
Dictionary<string, object> eventDic = new Dictionary<string, object>();
eventDic.Add("event", "w_inappmsg_click");
DOT.logEvent(eventDic);
Last updated