我想使用模板中的以下代码将thinkific与内部通信连接起来:
<head>
<script>
if({{site.current_user.signed_in}}) {
window.intercomSettings = {
app_id: "xxxxx",
name: "{{ site.current_user.full_name }}",
//email: "[email protected]", // They dont provide this variable {{ site.current_user.email}}
};
} else {
window.intercomSettings = {
app_id: "xxxxx",
};
}
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/edetfbym';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
</head>
它适用于潜在客户,但我遇到的唯一问题是当用户登录并且我无法获得他的电子邮件地址或思想的用户ID时我可以传递到对讲机对象...这样它就可以工作了完美的整合。
我一直在从思考文档中查看这些可用变量:http://help.thinkific.com/support/solutions/articles/216707-variables-version-1-x-x,但似乎他们不提供用户电子邮件作为从模板中访问的变量。
任何想法,我如何将对讲机整合到思想中?
它改变了这个:
window.intercomSettings = {
app_id: "edetfbym",
name: "{{ site.current_user.full_name }}", // Full name
email: Thinkific.current_user.email, // Email address
};
希望这有助于其他人遇到同样的问题
请务必更换2个app id并确保在内部通信中禁用身份验证,否则一旦用户登录,它将无法运行。
<script>
if(Thinkific.current_user !== null) {
window.intercomSettings = {
app_id: "APP_ID",
name: Thinkific.current_user.full_name, // Full name
email: Thinkific.current_user.email // Email address
};
} else {
window.intercomSettings = {
app_id: "APP_ID",
};
}
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/erckqe4k';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>