무엇을 도와드릴까요?

문의 내용을 간단히 알려 주세요. 이메일로 답변드릴게요.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
홈으로

브라우저 이벤트: on, off와 DOM 이벤트

ReactiveChat('on')과 window의 DOM 이벤트로 위젯이 페이지에 알리는 이벤트, 포함 데이터와 분석 도구에 전달하는 방법.

위젯은 채팅의 동작을 ReactiveChat('on', …)과 window의 DOM 이벤트 두 방식으로 알립니다. 어느 쪽도 메시지 텍스트를 포함하지 않으며 발생 사실만 알립니다. 서버에서 콘텐츠를 받으려면 웹훅을 사용합니다.

ReactiveChat('on')과 ('off')

function beiNachricht(e) {
  if (e.direction === 'in') { document.title = '(1) ' + document.title; }
}
ReactiveChat('on', 'message', beiNachricht);
// later:
ReactiveChat('off', 'message', beiNachricht);

로드 전에 on을 호출하면 구독이 큐에서 기다립니다. 다만 on은 명령이므로 command 트리거로 코어를 즉시 로드합니다. 콜백의 오류는 위젯이 잡으므로 채팅에 영향을 주지 않습니다. 알 수 없는 이름은 조용히 무시합니다.

이벤트와 데이터:

예: 분석 도구에 이벤트 전달

['open', 'close', 'csat', 'handoff', 'promo:click'].forEach(function (name) {
  ReactiveChat('on', name, function (e) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({ event: 'reactivechat_' + name.replace(':', '_'), rc: e });
  });
});

window의 DOM 이벤트

on과 별개로 위젯은 window에서 CustomEvent를 발생시킵니다. 버블링하지 않으며 bubbles: false입니다. 모든 detail에는 ts도 있습니다. 태그 관리자처럼 DOM 이벤트를 수신하는 도구에 적합합니다.

window.addEventListener('reactivechat:opened', function (ev) {
  console.log('Chat open since', new Date(ev.detail.ts));
});

위젯이 수신하는 이벤트

MousePlayer를 사용하면 mouseplayer:ready, mouseplayer:frustration, mouseplayer:intent, mouseplayer:milestone 이벤트를 처리합니다. mouseplayer:frustration은 코어도 미리 로드합니다. 다른 출처는 필요하지 않습니다.

제공되지 않는 기능

다음: 방문자 식별과 맥락 전달

최종 업데이트: