I want to send information collected in Typeform on my WordPress site to my Intercom account.
I'm pretty certain that to do that I need to create custom attributes in Intercom of the Typeform data.
I am curretly using the Intercom pluging for Wordpress. I have been told by Intercom that I need to use JS for custom attributes as the plugin is not support for that function.
I know how to insert the Intercom JS script in the footer. However, I dont know how to set up the script in the correct way.
More specifically:
This is the intercom JS for PHP:
<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>
So it sounds like you're getting yourself wrapped up a bit with trying to get that Typeform data across to Intercom. Let's take a step back and look at the main issue and limitations:
Now that we have that cleared up, I'm going to recommend going a simpler route and linking your TypeForm > Zapier > Intercom. That way you don't need to mess with any backend code and you can get this setup nice and quickly. Here's a Zapier template that should help you get started: https://zapier.com/app/editor/template/912
About Custom Attributes, they are essentially short pieces of information that should be relevant to most of your users. E.g. 'Account Type', 'Account Status', 'Number of Projects', etc.
You can create them in Intercom but simply sending them to us works as well. All you'd need to do is add them to your Javascript snippet and they'll automatically be created. Here's an example:
{
app_id: 'abc',
email: '[email protected]',
name: 'My Customer',
'Account Status': 'Trial'
}
Something like this will create a user (if they don't exist) with an email, name and custom attribute called 'Account Status' set to 'Trial'.
More details on custom attributes are available on the docs site: Custom Attributes