I'm using redux-segment for my analytics and am trying to implement Intercom. The issue I am having is actually getting it to load etc. I'm trying to follow this, but still unsure on where to enter the app id, etc. Intercom segment. I am want to load intercom in my action creator when grabbing the current user, but there is no documentation on how to actually load intercom.
import { EventTypes } from 'redux-segment';
export function currentUser() {
const request = user.current(); //this correctly grabs current user.
if(request == null) {
//having trouble with this part. load intercom non user specific
} else {
load intercom user specific
}
return {
type: CURRENT_USER,
payload: request
};
}
After starting an Intercom trial, just copy the code snippet under "Add chat to your website" on the home tab. Paste the code right before the closing body tag of every page where you want the Intercom Messenger to appear. After adding the code, open your website and the Messenger will appear.
Installation: Open a terminal inside your ReactJS project folder and write the following code to install react-script-tag Package. Import 'ScriptTag' component: Import the built-in 'ScriptTag' component from the react-script-tag library at the top of the file where we want to add the script tag.
What you want to do is put the script to load intercom either in your index.html or in your entry component to load their analytics object. From their docs you can initialize it like this
class MyComponent extends Component {
constructor(props){
super(props);
window.Intercom('boot', {
app_id: INTERCOM_APP_ID,
// other settings you'd like to use to initialize Intercom
});
}
....
}
Accepted answer is correct. In detail:
class LandingPage extends Component {
constructor(props) {
super(props);
// initialize intercom (don't forget to *update* when page changes)
window.Intercom("boot", {
app_id: "your_app_id"
});
}
}
https://app.intercom.io/a/apps/bhfx1oqj/messages/guide/identify_your_users/track_users
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With