Freshchat SDK 내에서 사용자 행동을 추적하는 방법

일반 SDK 설정

Freshchat SDK 내부에서 사용자 행동 추적하는 방법

Freshchat 모바일 SDK는 사용자 행동과 관련된 메타 속성을 수신할 수 있도록 합니다. 이 기능은 다음 SDK 버전부터 사용할 수 있습니다. Android: 2.7.0+, iOS: 2.7.0+. 플랫폼에 따라 사용자 이벤트를 다음과 같이 수신할 수 있습니다.

Android

사용자 이벤트 등록

Application 클래스의 onCreate에서 등록하는 것을 권장합니다.

IntentFilter userActionsIntentFilter = new IntentFilter(Freshchat.FRESHCHAT_EVENTS); getLocalBroadcastManager().registerReceiver(receiver, userActionsIntentFilter);
BroadcastReceiver receiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent == null || intent.getExtras() == null) {
            return;
        }
        
        Event event = Freshchat.getEventFromBundle(intent.getExtras());
        if (event != null) {
            Log.d("Name", "Name : " + event.getEventName().getName());
            Log.d("Prop", "Event Properties: " + event.getProperties());
        }
    }
};

사용자 이벤트 등록 해제

Application 클래스의 onTerminate에서 등록 해제할 수 있습니다.

getLocalBroadcastManager().unregisterReceiver(receiver);

참고: '사용자 이벤트 추적'에 대한 비디오를 여기에서 확인할 수 있습니다.

iOS

Objective C

사용자 이벤트 등록

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(userActionEvent:)
                                             name:FRESHCHAT_EVENTS
                                           object:nil];
- (void) userActionEvent:(NSNotification *)notif {
    FreshchatEvent *fcEvent = notif.userInfo[@"event"];
    // Check with available event enum
    if (fcEvent.name == FCEventFAQOpen){
        // Log existing event meta / properties
        NSLog(@"Event properties - %@",fcEvent.properties);
    }
}

사용자 이벤트 등록 해제

[[NSNotificationCenter defaultCenter]removeObserver: FRESHCHAT_EVENTS];

Swift

사용자 이벤트 등록

NotificationCenter.default.addObserver(self,selector: #selector(userActionEvent(_:)),name: NSNotification.Name(rawValue: FRESHCHAT_EVENTS),object: nil)
func userActionEvent(_ notification: Notification) {
    var fcEvent : FreshchatEvent? = nil
    fcEvent = (notification.userInfo?["event"] as? FreshchatEvent)
    // Check with available event enum
    if fcEvent?.name == FCEventFAQOpen {
        // Log existing event meta / properties
        print ("Event properties - \(String(describing: fcEvent?.properties))")
    }
}

사용자 이벤트 등록 해제

NotificationCenter.default.removeObserver(FRESHCHAT_EVENTS)

지원되는 이벤트

이벤트 이름 설명
FCEventFAQCategoryListOpen FAQ 카테고리 목록이 열릴 때
FCEventFAQListOpen FAQ 목록이 열릴 때
FCEventFAQOpen FAQ가 열릴 때
FCEventFAQSearch 검색 결과에서 FAQ가 선택되거나 검색 결과가 취소될 때
FCEventFAQVote FAQ에 투표할 때
FCEventChannelListOpen 토픽 목록이 열릴 때
FCEventMessageSent 사용자 메시지가 전송될 때
FCEventConversationOpen 토픽이 열릴 때
FCEventCsatOpen 사용자에게 CSAT가 표시될 때
FCEventCsatSubmit 사용자가 CSAT에 응답할 때
FCEventCsatExpiry CSAT가 만료되어 사용자에게 표시되지 않을 때
FCEventLinkTap 사용자가 외부 링크를 클릭할 때
FCEventScreenView Freshchat SDK 화면이 사용자에게 표시될 때
FCEventMessageReceive 사용자가 메시지를 받을 때
FCEventNotificationReceive 사용자가 Freshchat 알림을 받을 때
FCEventIdTokenStatusChange 사용자의 JWT 토큰 상태가 변경될 때
FCEventDropDownShow 드롭다운 메시지가 사용자에게 표시될 때
FCEventDropDownOptionSelect 사용자가 드롭다운 옵션을 선택할 때
FCEventCarouselShow 캐러셀 메시지가 사용자에게 표시될 때
FCEventCarouselOptionSelect 사용자가 캐러셀 옵션을 선택할 때
FCEventCarouselOptionView 사용자가 캐러셀 보기 버튼을 클릭할 때
FCEventCalendarFindTimeSlotClick 사용자가 시간 슬롯 찾기 버튼을 클릭할 때
FCEventCalendarInviteCancel 사용자가 회의 초대를 취소할 때
FCEventCalendarNoTimeSlotFound 회의 초대가 없을 때
FCEventCalendarBookingSuccess 사용자가 회의를 성공적으로 예약할 때
FCEventCalendarBookingRetry 사용자가 회의 예약을 재시도할 때
FCEventCalendarBookingFailure 사용자의 회의 예약이 실패할 때
FCEventShowOriginalClick 사용자가 라이브 번역 토글 버튼을 클릭하여 에이전트의 원본 메시지를 볼 때
FCEventHideOriginalClick 사용자가 라이브 번역 토글 버튼을 클릭하여 에이전트의 원본 메시지를 숨길 때

이 문서가 도움이 되었나요?

Freshdesk Omni AI 도우미

Freshchat SDK 내에서 사용자 행동을 추적하는 방법

AI 어시스턴트 초기화 중...