Intercom.io use 2 level hash and separate user identification and user tracking. Analytics.js use plain hash to handle both identification and tracking. Below you can see migration scheme:
var intercomSettings = { analytics.initialize({
app_id: 'bk7tlzy4', 'Intercom': 'bk7tlzy4'
});
user_id: '9876', analytics.identify('9876', {
// NOTE: analytics.js use created instead of created_at
created_at: 1234567890, created: 1234567890,
name: 'John Doe' name: 'John Doe',
email: '[email protected]' email: '[email protected]'
custom_data: { // Custom data goes in same hash
priceplan: "Small", priceplan: "Small",
active_accounts: 12 active_accounts: 12
... ...
} });
};
If you want to use intercom using secure mode http://docs.intercom.io/#SecureMode you can initialize analytics.js this way:
analytics.initialize({
'Intercom': {
app_id: 'bk7tlzy4',
user_hash: "<%= Digest::SHA1.hexdigest('u35ijdqw' + current_user.email) %>"
}
});