Example 20 (HTTP) - Targetted Ad Delivery

This example delivers only ads that match a "food" category. To achieve this, ads are configured on the OpenX server with a "site variable" called "category" and a value of "food" is assigned.

The configuration for this example is:


flowplayer("a.example", "../dist/flowplayer-3.1.5.swf", {
    plugins: {
        controls: {
            autoHide: "always"
        },

        openAdStreamer: {
            url: '../dist/OpenAdStreamer.swf',

            "debug": {
                "debugger": "firebug",
                "levels": "fatal"
            },

            "ads": {
                "pauseOnClickThrough": true,
                "servers": [
                    {
                       "type": "OpenX",
                       "apiAddress": "http://openx.openvideoads.org/openx/www/delivery/fc.php",
                       "customProperties": { 
                            "target": [ "category=food", "gender=male" ] 
                            // This is also possible for a single param: 
                            //     "target": "category=food" 
                       }
                    }
                ],
                "schedule": [
                    {
                      "zone": "5",
                      "position": "pre-roll",
                    }
                ]
            }
        }
    }
});