With Mouseflow, it's easy to seamlessly integrate into chat software like Olark. You can do the integration both ways, either adding the playback URL to the chat session inside Olark, or add customer details from Olark into the Mouseflow session. Let's go through both options here.
Adding the playback URL to Olark
What happens in the code is the following:
- We make sure the
_mfqvariable is available. This is the variable that is used to communicate with the Mouseflow object.
- We call
_mfq.push( ... )to make sure the inner function is called when Mouseflow's context is fully loaded.
- We call
olark('api.visitor.updateCustomFields', name: value)to add a new custom field to olark. The name is
mouseflowPlaybackUrl, and the value is the URL of the playback (requires that you are logged into your Mouseflow account)
Adding customer data from Olark into Mouseflow
The above code checks if the Olark session has an email address registered, and if so, adds it as a custom variable to Mouseflow. You can see the full
details object here (see right-side column). To enhance this integration further, you can use the above email address to identify the user directly in Mouseflow. This is done like this: