Firehose

Overview

The Firehose lets you build customer engagement and awareness of what's going on your site by providing realtime data on events received. By serving data from Firehoses to public API's, such as widgets on your site, it is possible to show data for a variety of purposes. Some examples include:

  • Most popular product
  • Most recent searches
  • Fastest selling product this week

Configuration

To set up a new firehose you need to decide on which events to capture and what properties you want to expose through the firehose.

The firehose configuration has a name, list of event actions and list of fields to display.

Description: Firehoses can be configured by posting configuration to the firehose configuration API.

URL: https://www.intilery.com/rest/firehose

Method: POST

Content-Type: application/json

Example

The firehose configuration below tells the Intilery engine to record all Flight Searches and the fields To and From, then make them available in an ordered list (most recent first).

Object example:

{
    "id": "5463a3f13004e25668425b9e",
    "eventActions": ["flight search"],
    "fieldsToDisplay": ["Flight Search.From", "Flight Search.To"]
}

Each firehose will record the last 20 events for which it is configured, these events can then be consumed by public APIs for various uses, such as those mentioned above.

Request

To request the firehose data as collected, use the procedure described below. The data from the example detailed could be used to populate a list of recent searches on your website.

Description: Each firehose requires a unique id: using this id it is possible to use JSONp to request details of that firehose.

URL: https://www.intilery-analytics.com/rest/public/firehose/<accountID>/events/<firehoseID>

Method: GET

Parameters:

- accountID -- your trackable account ID

- firehoseID -- your firehose identification

Content-Type: application/json

Response Object example:

{
    "accountID": 100,
    "firehoseID": "5463a3f13004e25668425b9e",
    "limit": 0,
    "lastID": 0,
    "elements": [{
        "id": 1423510285829,
        "visitorID": 0,
        "eventAction": "flight search",
        "eventData": {
            "FLIGHT SEARCH.TO": "TFS",
            "FLIGHT SEARCH.FROM": "MAN"
        }
    }, {
        "id": 1423510285167,
        "visitorID": 0,
        "eventAction": "flight search",
        "eventData": {
            "FLIGHT SEARCH.TO": "JNB",
            "FLIGHT SEARCH.FROM": "LON"
        }
    }]
}

Aggregator

This functionality is used to provide context to entities on your site, for example, the number of visitors / customers who are currently viewing a product, or the number of visitors / customers who have purchased a product in the past 24 hours.

Description: The Intilery Firehose aggregator automatically calculates the number of unique visitors / customers that have interacted with an entity on your site.

URL: https://www.intilery-analytics.com/rest/public/firehose/<accountID> /q?type= <typeName>&<params>

Method: GET

Parameters:

- accountID -- your trackable account ID

- typeName -- aggregation type name

- params -- aggregator parameters

Content-Type: application/json

Example

The following example provides the ability for a hotel site to display the number of people viewing a hotel (that a visitor is looking at), and when the last booking was made.

Request example:

$.ajax({
    'cache': false,
    'url': 'https://www.intilery-analytics.com/rest/public/firehose//q?type=hotel&id=123&id=456&id=89',
    'dataType': "jsonp",
    success: function(hotelMap) {
        methodToApplyDetails(hotelMap);
    }
});

NOTE: It is possible to retrieve data for more than one entity in a single call by passing a comma separated list of entity ids

Response example:

{
    "123": {
        "views": 12,
        "properties": {
            "__CREATEDAT": 1396351442743,
            "NAME": "Hotel 1",
        },
        "lastBookingAt": 1423437595655
    },
    "456": {
        "views": 36,
        "properties": {
            "__CREATEDAT": 1396352644763,
            "NAME": "Hotel 2",
        },
        "lastBookingAt": 1423506913824
    },
    "789": {
        "views": 14,
        "properties": {
            "__CREATEDAT": 1396352026127,
            "NAME": "Hotel 3",
        },
        "lastBookingAt": 1423145281659
    }
}

If you have any further questions about the firehose, or you would like to discuss further uses of it for your site. Please contact your account manager.

Still need help? Contact Us Contact Us