<aside> 🙏 ebisumartをお使いですと、会員情報の連携ができます! 接客チャット対応時に閲覧・会員情報でフィルタリングして、実店舗のように適切なお客様に話しかけが可能です!

【連携される情報】 ・会員ID ・名前 ・メールアドレス ・携帯番号 ・会員ランク ・ポイント ・カート内金額 ・カート内商品数 ・郵便番号 ・住所

</aside>


1. チャネルトークにログイン後、Plugin Keyをコピーしましょう

チャネルの設定⚙チャットボタンの管理チャットボタンのインストールの順にクリックし、"Plugin Key"をコピーします

スクリーンショット 2022-04-15 11.09.36.png

2. 以下のコードをコピーして、YOUR_PLUGIN_KEY の箇所(上から12行目)を先ほどコピーしたPlugin Keyに入れ替えておきましょう

<!-- Channel Plugin Scripts -->
<script>
  function ch_parsePureNumber(number) {
    var ch_number = parseFloat(number.replace(/[^0-9\\.]+/g, ''));
    if (ch_number || ch_number === 0) {
      return ch_number;
    }
    return undefined;
  }

  var settings = {
    'pluginKey': '**YOUR_PLUGIN_KEY**',
    'profile' : {
      'availableMileage': ch_parsePureNumber(document.getElementById("ebisu_user_point").textContent),
      'cartPrice': ch_parsePureNumber(document.getElementById("ebisu_user_cart_price").textContent),
      'cartCount': ch_parsePureNumber(document.getElementById("ebisu_user_cart_item_count").textContent),
    }
  };

  if (document.getElementById("ebisu_user_id")) {
    settings.memberId = document.getElementById("ebisu_user_id").textContent;
    settings.profile.name = document.getElementById("ebisu_user_name").textContent;
    settings.profile.groupName = document.getElementById("ebisu_user_rank").textContent || undefined;
    settings.profile.email = document.getElementById("ebisu_user_pc_email") ? document.getElementById("ebisu_user_pc_email").textContent : undefined;
    settings.profile.mobileNumber = document.getElementById("ebisu_user_mobile_number") ? `+81${document.getElementById("ebisu_user_mobile_number").textContent.slice(1)}` : undefined;
    settings.profile.zipCode = document.getElementById("ebisu_user_zip") ? document.getElementById("ebisu_user_zip").textContent : undefined;
    settings.profile.address = document.getElementById("ebisu_user_address") ? document.getElementById("ebisu_user_address").textContent : undefined;
  }

  (function() {
    var w = window;
    if (w.ChannelIO) {
      return (window.console.error || window.console.log || function(){})('ChannelIO script included twice.');
    }
    var ch = function() {
      ch.c(arguments);
    };
    ch.q = [];
    ch.c = function(args) {
      ch.q.push(args);
    };
    w.ChannelIO = ch;
    function l() {
      if (w.ChannelIOInitialized) {
        return;
      }
      w.ChannelIOInitialized = true;
      var s = document.createElement('script');
      s.type = 'text/javascript';
      s.async = true;
      s.src = '<https://cdn.channel.io/plugin/ch-plugin-web.js>';
      s.charset = 'UTF-8';
      var x = document.getElementsByTagName('script')[0];
      x.parentNode.insertBefore(s, x);
    }
    if (document.readyState === 'complete') {
      l();
    } else if (window.attachEvent) {
      window.attachEvent('onload', l);
    } else {
      window.addEventListener('DOMContentLoaded', l, false);
      window.addEventListener('load', l, false);
    }
  })();
  ChannelIO('boot', settings);
</script>
<!-- End Channel Plugin -->

3. ebisumartの管理画面にログインして、タグマネージャで先ほどのタグを設置しましょう

3-1.データ解析 > タグマネージャ > タグの新規登録/一覧 > 新規登録 をクリックして、タグマネージャー の新規登録画面に移動します

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ff2b7fd8-ea58-44ba-ab5f-a50f165f56c5/_2021-06-22_23.00.28.png