Have a question?

Funnels API

Funnels is an extremely powerful analytics report that allows you to track visitors through a “path” on your website. For example, a path could be a series of steps through the signup process or through the purchase process. Once you define the path in Woopra, you can analyze where visitors fall off the path and don’t finish it. This will help you optimize these paths on your website.

Important: Read the introduction before proceeding.

Request Endpoint

http(s)://www.woopra.com/rest/funnel

Parameters (Post)

Required Name type Description
required website String The website your analyzing. e.g. woopra.com
required start_day String The funnel has to start on or after this date
required end_day String The funnel has to be completed on or before this date
required date_format String Format of your start and end dates e.g. dd-MM-yyyy (refer to Java’s date formats)
required goals JSON array Array of objects defining every goal in your funnel (refer to the goal object format below)
optional segments JSON array The filter object to limit your analysis on a specific segment of your visitors. Refer to Segments
Compare multiple segments (optional)
optional group_by JSONObject Groups or cohorts you’d like to compare e.g. {scope:"visits", key:"day"}
optional limit Number Number of group results you’d like to compare e.g. 15
optional order_by String The goal number that you’d like to order by e.g. 1 to order by highest hits on Goal #1

Goal Data Parameter

The data parameters above contain the goals array object. Every goal should have the following parameters.

Required Name Type Description
required name String A name for this goal e.g. Step 1, Signup, Question #1
required filters Array Every goal is an action filter. It could be more than one action ANDed or ORed. In most cases, a goal is only one action filter.

Example:

[{
    scope: 'actions',
    key: 'url',
    match: 'match',
    value: '/signup'
}]
required operator String Operator can be either AND or OR which defines whether the filters defined must all occur or any one of them. Ignore this field if your funnel steps are simple (1 action)

JSON Data Request Example


HTTP Response

The example below defines the format of the funnel response you’ll be receiving. Our API right now only supports JSON. We’ll keep you updated as we add more formats. Visit json.org for a wide range of preferred JSON Parsers.

{
    start_day: "23-09-2012",
    end_day: "22-10-2012",
    date_format: "dd-MM-yyy",
    goals: [
        {
        name: "Signup",
        filters: [{
            scope: "actions",
            key: "url",
            match: "match", // url matches exactly '/signup'
            value: "/signup"}]
        }, {
        name: "Add to cart",
        filters: [{
            scope: "actions",
            key: "url",
            match: "contains", // url contains 'cart
            value: "cart"}]
        }
    ],
    group_by: "day",
    order_by: 0, // Ordering by signup
}

Complete Example using jQuery

var obj = {
    website: "ecommerce-site.com",
    date_format: "dd-MM-yyyy",
    start_day: 29,
    end_day: 0,
    limit: 15,
    goals: [{
        operator: "AND",
        name: "Confirmed",
        filters: [{
            scope: "actions",
            value: "pay",
            match: "contains",
            key: "name"
        }]
    }],

    "order_by": 0,
    "segments": [],
    "group_by": {
        "scope": "visits",
        "key": "day"
    }
};

$.ajax({
    type: 'GET',
    url: 'http://www.woopra.com/rest/funnels',

    crossDomain: true,
    beforeSend: function (xhr) {
        xhr.setRequestHeader('X-Api-Version', '2.0');
        xhr.setRequestHeader('X-Access-Id', 'RONWDCCHAOHVQ4U30ESHSYNTW4W9VVZ8');
        xhr.setRequestHeader('X-Access-Secret', 'JhYxou0LOHgh3XApGD4z3CufdhgtjwFrw2WdOAtQFG56265gGYggqbAMuYEOirVq');
    },
    data: {
        request: JSON.stringify(obj)
    },
    success: function (text) {
        alert(JSON.stringify(text));
    }
});

Need any help? Contact our Data Jedis