무엇을 도와드릴까요?

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

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

JavaScript API: 페이지에서 위젯 제어

window.ReactiveChat의 모든 명령: 열기·닫기, 메시지 전송, 사용자 식별, 안내 말풍선·홍보 카드 제어, 투어 시작, 세션 조회의 매개변수, 반환값과 로드 전 큐.

위젯은 전역 객체 window.ReactiveChat 하나를 제공합니다. 모든 명령을 함수 형식으로 호출합니다.

ReactiveChat('command', argument1, argument2);

기본 명령 이름은 일반 채팅 위젯을 따릅니다(boot, shutdown, open, identify, update, track 등). 따라서 전환 작업이 적습니다.

로드 전 큐

로더가 먼저 ReactiveChat을 만듭니다. 코어 로드 전에는 모든 호출을 ReactiveChat.q에 기록하며 이후 코어가 순서대로 처리합니다. 호출은 사라지지 않습니다.

코드가 로더 태그 전에 실행될 수 있으면 앞에 다음 줄을 넣습니다.

window.ReactiveChat = window.ReactiveChat || function () {
  (window.ReactiveChat.q = window.ReactiveChat.q || []).push(arguments);
};

두 가지 결과가 있습니다.

명령은 예외를 던지지 않습니다. 오류는 undefined를 반환하며 알 수 없는 명령은 무시합니다(data-rc-debug="true"이면 콘솔에 표시).

ReactiveChat('on', 'ready', function () {
  var s = ReactiveChat('getSession');
  console.log('Visitor', s && s.visitorId);
});

시작과 종료

ReactiveChat('boot', { locale: 'en', theme: 'dark' });

창

document.querySelector('#hilfe').addEventListener('click', function (ev) {
  ReactiveChat('open', { anchor: ev.currentTarget, message: 'Question about my order', tab: 'msg' });
});

메시지와 대화

방문자와 맥락

ReactiveChat('track', 'produkt_angesehen', {
  page_type: 'product', product_id: 'SKU-4711', price: 49.9, currency: 'EUR', in_stock: true
});

언어와 테마

안내 말풍선, 홍보 카드와 투어

A/B 테스트

ReactiveChat('on', 'ready', function () { ReactiveChat('abGoal'); });

실행 중 디자인 변경

객체 필드는 사용자 지정에 있습니다.

이벤트

객체에서 직접 사용

로드 후 일부 명령은 ReactiveChat.getSession(), ReactiveChat.isOpen(), ReactiveChat.getEndpoint(), ReactiveChat.startConversation(), ReactiveChat.continueConversation() 메서드로도 사용할 수 있습니다. ReactiveChat.version은 코어 버전입니다. 로드 전에는 이 메서드가 없으므로 함수 형식이 안전합니다.

제공되지 않는 명령

destroy, reset, setUser, send, setConsent, trackPage, navigate 명령은 없습니다. 동의는 동의 플랫폼 또는 data-rc-consent로 제어하며(개인정보 보호 연동), 페이지 변경은 자동 감지합니다(SPA). 로그아웃은 방문자 식별을 참조합니다.

다음: 이벤트

최종 업데이트: