# Intercom integration with Discourse?

**URL:** https://meta.discourse.org/t/intercom-integration-with-discourse/106280
**Category:** Support
**Created:** [January 11, 2019, 2:10pm UTC](https://meta.discourse.org/t/intercom-integration-with-discourse/106280 "2019-01-11T14:10:13Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Rob\_Jeffrey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_jeffrey/32/119646_2.png) [@Rob\_Jeffrey](https://meta.discourse.org/u/Rob_Jeffrey)
#### Post date: [January 11, 2019, 2:10pm UTC](https://meta.discourse.org/t/intercom-integration-with-discourse/106280/1 "2019-01-11T14:10:13Z")

</div>

Hello all,

I have Intercom ([https://www.intercom.com/](https://www.intercom.com/)) on my discourse site and I want to auto populate the email address as the user is already logged in with their email to the discouse forum (as its a closed community)

Intercom offer the following code in Ruby:

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/c/4c0b2d5bc256fee661dfe795c2e9cc861f439f98.png)

I’m guessing I cant use any server side code within the admin/customization panel in discourse its self but I am wondering if any one else has solved this problem before?

Thanks in advance, I really appreciate all responses.

Rob

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [January 12, 2019, 1:35pm UTC](https://meta.discourse.org/t/intercom-integration-with-discourse/106280/3 "2019-01-12T13:35:23Z")

</div>

Look at the #howto topics about developing themes.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [January 14, 2019, 5:24pm UTC](https://meta.discourse.org/t/intercom-integration-with-discourse/106280/4 "2019-01-14T17:24:38Z")

</div>

Hi Rob, I think you can do it if you add variables to the script, for example:

```plaintext
<script>
$.getJSON("/session/current.json", function(json) {
    var userusername = String(json.current_user.username);
    var currentname = String(json.current_user.name);
    var pathtojson = "/users/" + userusername + ".json";
    $.getJSON(pathtojson, function(json){
        var useremail = String(json.user.email);
        var createdatuser = String(json.user.created_at);

        window.intercomSettings = {
            app_id: '[APP_ID]',
            email: useremail,
            name: currentname,
            created_at: createdatuser,
            "discourse_username": userusername,
        };
    });
});
</script>

```

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [January 15, 2019, 8:06pm UTC](https://meta.discourse.org/t/intercom-integration-with-discourse/106280/9 "2019-01-15T20:06:34Z")

</div>

@Rob_Jeffrey have a look at our official Intercom plugin topic

> [@Discourse Intercom (Advanced)](https://meta.discourse.org/t/discourse-intercom/106622):
>
> information_source This plugin implements Intercom’s [“Identity Verification”](https://www.intercom.com/help/configure-intercom-for-your-product-or-site/staying-secure/enable-identity-verification-for-web-and-mobile) system. If you do not need this, a simpler theme component is available [here](https://meta.discourse.org/t/intercom-widget/107517). discourse2Summary Discourse Intercom is the official [Intercom](https://www.intercom.com) integration plugin for Discourse.hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-intercom](https://github.com/discourse/discourse-intercom)open_bookInstall Guide [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157)Features It will add the [Intercom Messenger](https://www.intercom.com/messenger) to your Discourse site in few …

---

<div class="post-metadata">

### Author: ![Rob\_Jeffrey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_jeffrey/32/119646_2.png) [@Rob\_Jeffrey](https://meta.discourse.org/u/Rob_Jeffrey)
#### Post date: [January 29, 2019, 11:41am UTC](https://meta.discourse.org/t/intercom-integration-with-discourse/106280/10 "2019-01-29T11:41:09Z")

</div>

Thanks for your reply! This worked great, genius

---

<div class="post-metadata">

### Author: ![Rob\_Jeffrey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_jeffrey/32/119646_2.png) [@Rob\_Jeffrey](https://meta.discourse.org/u/Rob_Jeffrey)
#### Post date: [January 29, 2019, 11:41am UTC](https://meta.discourse.org/t/intercom-integration-with-discourse/106280/11 "2019-01-29T11:41:37Z")

</div>

Ah great to know, in future discourse installs I will use the official plugin

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [January 29, 2019, 11:51am UTC](https://meta.discourse.org/t/intercom-integration-with-discourse/106280/13 "2019-01-29T11:51:48Z")

</div>

We have also released some days ago a theme component for Intercom, you can take a look here

> [@Intercom Widget](https://meta.discourse.org/t/intercom-widget/107517):
>
> discourse2Summary Intercom Widget allows basic integration with Intercom.hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-intercom-widget](https://github.com/discourse/discourse-intercom-widget)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features Intercom Widget allows basic integration with Intercom. Add your Intercom app ID to the relevant setting to link it to your site. Settings Name Description app id extend content…

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [February 3, 2022, 8:27pm UTC](https://meta.discourse.org/t/intercom-integration-with-discourse/106280/14 "2022-02-03T20:27:30Z")

</div>



---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 4, 2022, 6:00am UTC](https://meta.discourse.org/t/intercom-integration-with-discourse/106280/15 "2022-02-04T06:00:34Z")

</div>


