Intercom JS
Categories
Component ID
2404449
Component name
Intercom JS
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Component created
Component changed
Component body
Provides JS integration with Intercom.IO.
Here at Webscope we've been doing an API intergration with Intercom. Unfortunately, the current Intercom API requires PHP 5.4, and most Drupal 7 sites run on PHP 5.3. So we ended up using their JavaScript API, which turned out to be just enough for our needs.
What this module does, is that it injects a bit of JavaScript into the page template and submits events to Intercom.
Features
- Tracking of basic user info - user name, user id, email, created date.
- Page view events.
- Tracking of user 1 can be disabled (all users are tracked by default).
Installation instructions
- Download and enable the module as usual.
- Visit
admin/config/services/intercom/settingsto specify the APP ID. Alternatively, you can edit yoursettings.phpfile, which is handy for handling different environments. - Insert the following snippet into your
html.tpl.phpjust before the closing<body>tag.
if (in_array(PANTHEON_ENVIRONMENT, array('live'))) {
$conf['intercomjs_app_id'] = 'abcdefgh';
}
else {
$conf['intercomjs_app_id'] = 'ijklmnop';
}
<?php if (isset($intercomjs)): ?>
<?php print $intercomjs; ?>
<?php endif; ?>