Trending Content Recommendations

The Ooyala Discovery trending algorithms are designed to find content that is popular on your site now and reinforce its popularity.

Note: Rather than constructing ad hoc requests (with individual parameters for each request), consider using discovery profiles to centralize your settings and recommendations behavior. Discovery profiles are defined configurations of settings created by you, which you then reuse by reference on the GET routes. For more information, see Discovery Profiles.

About Trending Content

For example, if one of your videos becomes popular on Reddit or Facebook, it might appear in the trending results. Once it appears, it will be found by your regular site visitors, reinforcing its popularity. Additionally, your regular viewers are affecting the trending results. When new visitors find your site, good recommendations will make them likely to stay around longer.

Additionally, if you use trending through the APIs, you have more control over what can be displayed. For example, you could define logic similar to the following:

  • If the viewer has not accessed the site for over 30 days, display trending content for the month.
  • If the viewer accessed the site between 8 and 30 days ago, display trending content for the week.
  • If the viewer accessed the site between 1 and 7 days ago, display trending content for the day.
  • If the viewer accessed the site less than 24 hours ago, display trending content for the hour.

Steps

Use the following steps to configure Discovery to return recommendations based on trending content:

  1. Select from the following options:
    • Get the most popular videos.

      The following example returns the five most popular videos for the day in all countries:

      [GET]/v2/discover/trending/top?countries=all&time=now&window=day&limit=5                           
    • Get the videos with the most momentum.

      The following example returns the five videos with the most momentum for the day in all countries:

      [GET]/v2/discover/trending/momentum?countries=all&time=now&window=day&limit=5         

    Backlot returns a response similar to the following.

    {  
       "results":[  
          {  
             "name":"Cat Video #145678434",
             "description":"More cats!",
                  "embed_code":"embed_code",
             "external_id":"external_id",
               "preview_image_url":"image_url",
             "duration":"91000",
             "hostedAtURL":null,
             "bucket_info":"bucket_info_id",
             "reason":"top"
          },
          {  
             "name":"Cat Video #145678435",
             "description":"Even more cats!",
             "embed_code":"embed_code",
             "external_id":"external_id",
               "preview_image_url":"image_url",
             "duration":"91000",
             "hostedAtURL":null,
             "bucket_info":"bucket_info_id",
             "reason":"top"
          },
          {  
             "name":"Cat Video #145678436",
             "description":"Yet even more cats!",
             "embed_code":embed_code,
             "external_id":"external_id",
             "preview_image_url":"image_url",
             "duration":"91000",
             "hostedAtURL":null,
             "bucket_info":"bucket_info_id",
             "reason":"top"
          },
          {  
             "name":"Cat Video #145678437",
             "description":"Can you believe it?",
             "embed_code":"embed_code,
             "external_id":"external_id",
             "preview_image_url":"image_url",
             "duration":"91000",
             "hostedAtURL":null,
             "bucket_info":"bucket_info_id",
             "reason":"top"
          },
          {  
             "name":"Dog Video #0000001",
             "description":"Dogs",
             "embed_code":"embed_code",
             "external_id":"external_id",
             "preview_image_url":"image_url",
             "duration":"91000",
             "hostedAtURL":null,
             "bucket_info":"bucket_info_id",
             "reason":"top"
          }
       ]    
  2. Get the information from each result to generate web page content.
    Note: Be sure to retain a copy of the bucket_info associated with each recommendation for use in the final step.
    The following example contains simple HTML content.
    <div class="sidebar">
        <h4 class="sidebar-head">Popular Now</h4>
        <ul>
            <li>
                <p><a href="/video/Z2dnRsNDrcK-TYHGlFIZuTlPoDZ_QkW3">Cat Video #145678434</a></p>
                <p>More cats!</p>
            </li>
            <li>
                <p><a href="/video/Z2dnRsNDrcK-ZaRTYhuTlPoDZ_tyrD">Cat Video #145678435</a></p>
                <p>Even more cats!</p>
            </li>        
            <li>
                <p><a href="/video/Z2dnRsNDrcK-ZaZrlFIZuTlPoDZ_RTfs">Cat Video #145678436</a></p>
                <p>Yet even more cats!</p>
            </li>
            <li>
                <p><a href="/video/Z2dnRsNDrcK-ZaZrlFITYnrPoDZ_RFtg">Cat Video #145678437</a></p>
                <p>Can you believe it?</p>
            </li>
            <li>
                <p><a href="/video/Z2dnRsNDrcK-ZaZrlFIZuTlPoDZ_tyHG">Dog Video #0000001</a></p>
                <p>Dogs.</p>
            </li>
        </ul>
    </div>        
  3. Every time your viewer is displayed a video from Ooyala Discovery or clicks a link presented by Ooyala Discovery, copy the associated bucket_info and return it to Ooyala in feedback via one of the following routes:
    • The /v2/discover/feedback/impression route, which is to record displays of videos. For details and an example of use, Returning Impression Events.
    • The /v2/discover/feedback/play route, which is to record clicks to play a video. For details and an example of use, see Returning Click Events.
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.

해당 내용이 도움 되었습니까?