Returning Impression Events

Was this article helpful?

Showing Ooyala Discovery recommendations to users through the API requires a call to Ooyala to report what results are displayed. The reported information is fed to the Discovery implementation to enhance recommendation algorithms and optimize the results for the site and audience.

For the best feedback, Ooyala recommends sending an impression event for each video displayed in recommendations. Impressions are part of the calculation of the Insights Report. Capturing the detailed impression events improves the accuracy of analytics reports.

Use the following steps to configure your implementation for recording impressions:

  1. Set up a web page or app to show Ooyala Discovery recommendations.
  2. Get the generated device_id.

    For Flash, the following example function gets the Flash device ID:

    public function get deviceId():String {
                var so:SharedObject = SharedObject.getLocal("auth");
                var deviceId:String = ? : null;
                return (deviceId == null || deviceId == "") ? "unknown" : deviceId;
    Note: If the device ID is unavailable, the example function returns unknown.
  3. Add the device_id parameter.
  4. Make a post request that contains the bucket_info parameter for each video that recommended and/or shown to the user. This step is shown in the following code sample:

    Ooyala Discovery returns a 200 response.

Note: Try out the code samples using your account credentials in the Ooyala Scratchpad. To launch the Scratchpad, go to Ooyala API Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad.