Intercom + Discourse

Thanks so much for posting this.

I tried inserting the code with my app ID and discourse forum URL, but I still can’t get it working.

Below is what I have added to my head section:

 <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/m866jl5z';
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>
<script>
window.Intercom('boot', {
   app_id: 'm866jl5z',
   custom_launcher_selector: '#my_custom_link' 
});
</script>
<script>
window.Intercom('boot', {
   app_id: 'm866jl5z',
   email: 'example@example.com',
   user_id: 'abc123',
   created_at: 1234567890,
   custom_launcher_selector: '#my_custom_link' 
});
</script>
<script>
$(window).scroll(function() {

    if ($(this).scrollTop() > 120)
     {
        $('.crunchify-container').fadeIn();
     }
    else
     {
      $('.crunchify-container').fadeIn();
     }
 });
</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/m866jl5z';
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>

And here is what I have added to my body section:

<script>
$.getJSON("https://community.myfishingcapecod.com/session/current.json", function(json){
    var currentusernamefromjson = String(json.current_user.username);
    var currentuserflname = String(json.current_user.name);
    var fulllinktojson = "https://community.myfishingcapecod.com/users/" + currentusernamefromjson + ".json";
    $.getJSON(fulllinktojson, function(json){
        var currentuseremail = String(json.user.email);
        var currentuserid = String(json.user.id);

        window.Intercom('boot', {
            app_id: 'm866jl5z',
            email: currentuseremail,
            name: currentuserflname,
            "discourse_username": currentusernamefromjson,
            "discourse_uid": currentuserid
        });
    });
});
</script>

I reached out to the Intercom support team as well, so I will post back any solutions if I find any.

Obviously I appreciate any insight anyone here on this forum may also be able to provide to help me get Intercom working with Discourse. Thank you all for the helpful posts thus far :+1: