Customize and enhance visitor's data
This page describes how to customize and enrich the information passed by the Butterflive Tracking Code.
Passing extra data about the page
Using this feature, you can pass any data you want to the agents. For instance, you could pass extra data regarding the page, like the section of the website, etc...
This data is passed as a Json object in the bflOptions startup parameters:
<script language="JavaScript" type="text/javascript"> bflOptions = { ... page: { section: "Hifi", product: { name: "TV", price: "9000" } } ... </script>
In the example above, the page variable contains a JSON object that is passed to Butterflive through the bflOptions parameters. The JSON object will be displayed into the widget, and all agents will be able to see it.
Data passed to Butterflive using the page variable is bound to the page viewed. Therefore, if the user changes the page, the page from the new page will be displayed, and the one from the old page will be dismissed.
Passing extra data about the user
You can also pass some data that will be bound to the user instead of the page. This data will be kept as long as the user is connected. For instance, you could push to the agents the name of the visitor, its mail, the content of its cart, etc...
To do this, you can use the code below:
<script language="JavaScript" type="text/javascript"> bflOptions = { ... session: { name: "bob", mail: "bob@mail.com" } } ... </script>
Of course, you can pass pieces of data that are both related to the page and to the user:
<script language="JavaScript" type="text/javascript"> bflOptions = { ... page: { section: "Hifi", product: { name: "TV", price: "9000" }, session: { name: "bob", mail: "bob@mail.com" } } ... </script>
The user profile will appear in the widget, when viewing the user details, as shown below:
You can keep improving your customization. For instance, you can customize the user list of the widget to display custom data directly in the list.
