# Intercom Settings Object is not loading

**URL:** <https://community.weweb.io/t/intercom-settings-object-is-not-loading/10542>\
**Category:** Developer corner\
**Created:** [August 30, 2024, 12:11pm UTC](https://community.weweb.io/t/intercom-settings-object-is-not-loading/10542 "2024-08-30T12:11:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_new](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@Robert\_new](https://community.weweb.io/u/Robert_new)\
**Post date:** [August 30, 2024, 12:11pm UTC](https://community.weweb.io/t/intercom-settings-object-is-not-loading/10542/1 "2024-08-30T12:11:29Z")

</div>

Hi, I want to integrate Intercom Messenger into the app with the custom code option. I did put this code into the section. but it is not loading and not accesable thru the console:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/05174146c18f4d86e78862a964c8163737d85a4e.png)

```auto
<script>
    window.intercomSettings = {
    api_base: "https://api-iam.intercom.io",
    app_id: "mk7dlaha",
    user_id: wwLib.wwVariable.getValue("1831add6-b7d7-43c1-8b4f-5945b3bf5c4a"), // IMPORTANT: Replace "user.id" with the variable you use to capture the user's ID
    name: wwLib.wwVariable.getValue("ec42d099-6c09-4c95-a824-d351868389a6"), // IMPORTANT: Replace "user.name" with the variable you use to capture the user's name
    email: wwLib.wwVariable.getValue("c72c80ac-6f4d-4a65-96a6-8a431225f6ac"), // IMPORTANT: Replace "user.email" with the variable you use to capture the user's email address
    created_at: wwLib.wwVariable.getValue("edbb2c05-b054-4e64-baa8-7d3bc47d7b6f"), // IMPORTANT: Replace "user.createdAt" with the variable you use to capture the user's sign-up date
  };
</script>

<script>
    // We pre-filled your app ID in the widget URL: 'https://widget.intercom.io/widget/mk7dlaha'
  (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/mk7dlaha';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
</script>

```

Any Idea?

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [August 30, 2024, 12:14pm UTC](https://community.weweb.io/t/intercom-settings-object-is-not-loading/10542/2 "2024-08-30T12:14:05Z")

</div>

For window, always use `wwLib.getFrontWindow()`

---

<div class="post-metadata">

**Author:** ![Robert\_new](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@Robert\_new](https://community.weweb.io/u/Robert_new)\
**Post date:** [August 30, 2024, 12:17pm UTC](https://community.weweb.io/t/intercom-settings-object-is-not-loading/10542/3 "2024-08-30T12:17:27Z")

</div>

> [@Broberto](#):
>
> wwLib.getFrontWindow()

Thx for help. Could you share more details? How could I use it? Use

user\_id: wwLib.getFrontWindow(“1831add6-b7d7-43c1-8b4f-5945b3bf5c4a”),

instead of

user\_id: wwLib.wwVariable.getValue(“1831add6-b7d7-43c1-8b4f-5945b3bf5c4a”),

?

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [August 30, 2024, 12:18pm UTC](https://community.weweb.io/t/intercom-settings-object-is-not-loading/10542/4 "2024-08-30T12:18:31Z")

</div>

You need to use that instead of the `window`

---

<div class="post-metadata">

**Author:** ![Robert\_new](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@Robert\_new](https://community.weweb.io/u/Robert_new)\
**Post date:** [August 30, 2024, 12:35pm UTC](https://community.weweb.io/t/intercom-settings-object-is-not-loading/10542/5 "2024-08-30T12:35:18Z")

</div>

I tried:

```auto
<script>
    // Log the variable values
    console.log("user_id:", wwLib.wwVariable.getValue("1831add6-b7d7-43c1-8b4f-5945b3bf5c4a"));
    console.log("name:", wwLib.wwVariable.getValue("ec42d099-6c09-4c95-a824-d351868389a6"));
    console.log("email:", wwLib.wwVariable.getValue("c72c80ac-6f4d-4a65-96a6-8a431225f6ac"));
    console.log("created_at:", wwLib.wwVariable.getValue("edbb2c05-b054-4e64-baa8-7d3bc47d7b6f"));

    // Set intercomSettings with the retrieved values
    wwLib.getFrontWindow().intercomSettings = {
        api_base: "https://api-iam.intercom.io",
        app_id: "mk7dlaha",
        user_id: wwLib.wwVariable.getValue("1831add6-b7d7-43c1-8b4f-5945b3bf5c4a"),
        name: wwLib.wwVariable.getValue("ec42d099-6c09-4c95-a824-d351868389a6"),
        email: wwLib.wwVariable.getValue("c72c80ac-6f4d-4a65-96a6-8a431225f6ac"),
        created_at: wwLib.wwVariable.getValue("edbb2c05-b054-4e64-baa8-7d3bc47d7b6f")
    };
</script>

<script>
    (function(){
        var w = wwLib.getFrontWindow();
        var ic = w.Intercom;

        if(typeof ic === "function"){
            ic('reattach_activator');
            ic('update', w.intercomSettings);
        } else {
            var d = w.document;
            var i = function(){ i.c(arguments); };
            i.q = [];
            i.c = function(args){ i.q.push(args); };
            w.Intercom = i;
            var l = function(){
                var s = d.createElement('script');
                s.type = 'text/javascript';
                s.async = true;
                s.src = 'https://widget.intercom.io/widget/mk7dlaha';
                var x = d.getElementsByTagName('script')[0];
                x.parentNode.insertBefore(s, x);
            };
            if (d.readyState === 'complete'){
                l();
            } else if (w.attachEvent){
                w.attachEvent('onload', l);
            } else {
                w.addEventListener('load', l, false);
            }
        }
    })();
</script>

```

but it is still not working. Any Ideas?

---

<div class="post-metadata">

**Author:** ![Robert\_new](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@Robert\_new](https://community.weweb.io/u/Robert_new)\
**Post date:** [August 30, 2024, 12:48pm UTC](https://community.weweb.io/t/intercom-settings-object-is-not-loading/10542/6 "2024-08-30T12:48:29Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/1a1c7afd9cdc792dcaf66bada7053273cf706cc6.png)

It looks like wwLib isn´t loaded when weweb is injecting the java script.

---

<div class="post-metadata">

**Author:** ![fynn](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/fynn/32/15124_2.png) [@fynn](https://community.weweb.io/u/fynn)\
**Post date:** [February 19, 2025, 5:47pm UTC](https://community.weweb.io/t/intercom-settings-object-is-not-loading/10542/7 "2025-02-19T17:47:32Z")

</div>

Did you find a solution for it?
