Welcome Message
Use Case
The following functions can show or hide the default welcome message based on your company's online or offline status.
Don't Forget!
Some tasks can be done within the Drift app. Here's how to set up your welcome/away message and how to set online/offline hours.
First, Initialize the Drift Widget
<script>
drift.on('ready',function(api, payload) {
// your code goes here
})
</script>
<script>
analytics.ready(function(){
//interact with the api here
})
</script>
Welcome Message Functions
api.showWelcomeMessage()
This will open the default greeting based on your siteβs settings. You can also pass some additional parameters to further customize the welcome message. All parameters are optional.
api.showWelcomeOrAwayMessage()
This will show the proper message based on your organization's current online / offline status.
api.hideWelcomeMessage()
This will hide the welcome message and reset its state.
Example with Parameters
Here's an example with parameter message
<script>
drift.on('ready',function(api, payload) {
api.showWelcomeMessage({
message:undefined,
// A string- replaces the default welcome message with a custom one.
})
})
</script>
Updated 8 months ago