我想将我的 WordPress 网站上的 Typeform 收集的信息发送到我的 Intercom 帐户。
我非常确定要做到这一点,我需要在 Typeform 数据的 Intercom 中创建自定义属性。
我目前正在使用 Wordpress 的 Intercom 插件。 Intercom 告诉我,我需要使用 JS 来自定义属性,因为该插件不支持该功能。
我知道如何在页脚中插入 Intercom JS 脚本。但是,我不知道如何以正确的方式设置脚本。
更具体地说:
- Intercom 手册指出,在 WordPress 中插入 JS 时,我应该更改 JS 中的用户数据以匹配我的网站。在 WordPress 中哪里可以找到这些数据?
这是 PHP 的对讲 JS:
<script>
window.intercomSettings = {
app_id: "da0xoenf",
name: "<?php echo $current_user->name ?>", // Full name
email: "<?php echo $current_user->email ?>", // Email address
created_at: <?php echo strtotime($current_user->created_at) ?> // Signup date as a Unix timestamp
};
</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/da0xoenf';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>
- 如何将 typeform 与对讲机集成?如何以及在哪里创建自定义属性?
最佳答案
听起来您似乎正忙于尝试将 Typeform 数据传输到 Intercom。让我们退一步看看主要问题和限制:
- 您想要从 Typeform 获取信息到 Intercom。
- Intercom WordPress 插件目前不提供对自定义属性的支持。
- 自定义属性如何工作以及如何创建?!
现在我们已经解决了这个问题,我建议采用更简单的路线并链接您的 TypeForm > Zapier > Intercom。这样您就不需要弄乱任何后端代码,并且可以快速快速地完成此设置。这是一个可以帮助您入门的 Zapier 模板:https://zapier.com/app/editor/template/912
关于自定义属性,它们本质上是应该与大多数用户相关的简短信息。例如。 “帐户类型”、“帐户状态”、“项目数量”等。
您可以在 Intercom 中创建它们,但只需将它们发送给我们也可以。您所需要做的就是将它们添加到您的 Javascript 代码段中,它们就会自动创建。这是一个例子:
{
app_id: 'abc',
email: 'mycustomer@hisemail.com',
name: 'My Customer',
'Account Status': 'Trial'
}
类似的操作将创建一个用户(如果不存在),其电子邮件、姓名和名为“帐户状态”的自定义属性设置为“试用”。
有关自定义属性的更多详细信息,请访问文档网站: Custom Attributes
关于javascript - 如何将 Intercom.io JS 与 WordPress 和 Typeform 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41947049/