Overview: Intercom lets you send custom attributes about your customers. This means that you can filter your user list and send messages when users meet criteria specific to your business.
You send custom attributes by adding it to your intercomSettings code snippet as additional key/value pairs. Make sure to double check that your custom attribute keys always have a JSON-valid value; this means double quotes around strings and sending null as a value when there isn’t a value for that user. It’s also important to note that:
1. Field names must not contain Periods (‘.’) or Dollar (‘$’) characters
2. Field values must be JSON Strings, Numbers or Booleans – Objects and Arrays will be rejected.
3. Keys cannot contain characters such as ~`!@#%^&*'{}|\'” or the NULL character.
4. Keys are case-sensitive.
5. Values cannot be nested hashes or arrays.
6. We only allow custom data attributes of string type to have up to 255 characters.
Here are some custom attribute examples:
1 2 3 4 5 6 7 8 9 |
<script> window.intercomSettings = { app_id: '${applicationScope.appProperties.intercomLiveChatAppId}', // Below custom attributes tells intercom what flow they're in so membercare can easily triage where they are. flow_type : '${flowType}', account_created : '${accountCreated}' }; </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/opwirei9';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> |
Here are some screen shots for seeing the custom attributes in intercom.