// Before mp.js has loaded - the queue keeps every call:
(window.mp_q = window.mp_q || []).push(['consent', true]);
// After mp.js has loaded - the same, directly:
MousePlayer.setConsent(true);
通过自己的 ID,同一人的全部设备会在列表中合为一个访客,您也可用已知编号搜索支持请求。该 ID 还会应用于同一浏览器最近 30 天的较早访问。
// After login - your own customer number, not an e-mail address:
MousePlayer.setUserId('customer-4711');
// or through the queue
(window.mp_q = window.mp_q || []).push(['set', 'user_id', 'customer-4711']);
请使用内部编号,而非电子邮箱地址或姓名。只要出现该访客,MousePlayer 就会显示此 ID。
读取 ID
MousePlayer.getSessionUrl(); // replay link of the running session
MousePlayer.getSessionId();
MousePlayer.getVisitorId(); // null without consent
// Through the queue, with a callback:
(window.mp_q = window.mp_q || []).push(['get', 'session_url', function (url) {
// e.g. attach it to a support ticket
}]);
// A wizard that keeps its address:
MousePlayer.step('shipping');
MousePlayer.step('payment');
MousePlayer.step(''); // back to the page itself
(window.mp_q = window.mp_q || []).push(['step', 'payment']);
<!-- Nothing typed in here leaves the browser as text -->
<section data-mp-mask> ... </section>
<!-- The value of this field is never recorded -->
<input name="voucher" data-mp-ignore>
<!-- Tell MousePlayer what an element is -->
<span class="amount" data-mp-role="price">89,90 EUR</span>