API Requests: v2 Analytics and v3 Analytics Comparison (Deprecated)

These examples show some commonly used queries in v2 Analytics and their equivalents in v3 Analytics (Ooyala IQ).
Warning: The v2 Analytics API has been deprecated. See Ooyala IQ Analytics for more details on the new v3 Analytics API.
For ease of reading:
  • The v3 query parameter values are not URL-encoded.
  • Variable values are prefixed with a $ sign.
  • Some requests are broken across lines.
  • "&metrics=metrics" is left out of the syntax because by default all metrics are returned. Define specific metrics to return in your reports with "&metrics=yourDesiredMetrics".

Total Dimensions

v2 URL Syntax v3 Equivalent
/v2/analytics/reports/account/performance/total/
$date_range
/v3/analytics/reports/?report_type=performance&
start_date=$start&end_date=$end&api_key=yourApiKey
https://api.ooyala.com/v3/analytics/reports/?report_type=performance&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD&api_key=yourApiKey&expires=yourExpiration&signature=yourSignature

Sample Ooyala IQ Response:

                     
{  
     “status_code”:“200”,
     "result_count":1,
     "results":[  
      {  
          “start_date”:“YYYY-MM-DD”,
          “end_date”:“YYYY-MM-DD”,
          “data”:[  
            {  
                 “group”:{  
                     }, 
                 "metrics":{  
                     "playthrough_50": "40000",      
                     "uniq_displays": "3000000",      
                     "video_starts": "4000000",      
                     "displays": "5000000",
                     “percentage_watched":[  
                        18,
                        14,
                        13,
                        13,
                        15,
                        20,
                        12,
                        14,
                        12,
                        11,
                        19,
                        18,
                        8,
                        13,
                        11,
                        18,
                        16,
                        10,
                        15,
                        17,
                        15,
                        16,
                        8,
                        10,
                        12,
                        13,
                        8,
                        9,
                        8,
                        14,
                        8,
                        10,
                        11,
                        11,
                        12,
                        10,
                        11,
                        5,
                        0,
                        14
                     ],
                     "player_loads":5000000,
                     "segment_watched":[  
                        18,
                        14,
                        13,
                        13,
                        15,
                        20,
                        12,
                        14,
                        12,
                        11,
                        19,
                        18,
                        8,
                        13,
                        11,
                        18,
                        16,
                        10,
                        15,
                        17,
                        15,
                        16,
                        8,
                        10,
                        12,
                        13,
                        8,
                        9,
                        8,
                        14,
                        8,
                        10,
                        11,
                        11,
                        12,
                        10,
                        11,
                        5,
                        0,
                        14
                     ],
                     "urls_copied": "3",
                     "plays_requested": "6500",      
                     "embeds_copied": "2",      
                     "facebook": "3",      
                     "replays": "145",      
                     "uniq_video_starts": "2000000",      
                     "autoplays": "0",      
                     "emails_sent": "0",      
                     "digg": "0",      
                     "playthrough_25": "50000",      
                     "playthrough_75": "40000",      
                     "twitter": "0",      
                     "uniq_plays_requested": "60000",      
                     "playthrough_100": "30000",      
                     "time_watched": "8.3k:33:00"                                      
                  }                               
               }                        
            ]                 
         }          
      ],
        “total_count”:1,
        “status”:“OK”
   }

Note: There is no data in the group because there’s no dimension specified, and the plays requested, displays is grand total for all the metrics across the time frame

Total with Breakdown by Day

v2 URL Syntax v3 Equivalent
/v2/analytics/reports/account/performance/total/
$date_range?breakdown_by=day
/v3/analytics/reports/?report_type=performance
&time_segment=day&
start_date=$start&end_date=$end&api_key=yourApiKey
https://api.ooyala.com/v3/analytics/reports/?report_type=performance&time_segment=day&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD&api_key=yourApiKey&expires=yourExpiration&signature=yourSignature

Sample Ooyala IQ Response:

{  
   “status_code”:“200”,
   "result_count":3,
   "results":[  
      {  
         “start_date”:“YYYY-MM-DD”,
         “end_date”:“YYYY-MM-DD”,
         “data”:[  
            {  
               “group”:{  

               },
               "metrics":{  
                 "playthrough_50":100,
                 "uniq_displays":2500,
                 "video_starts":3000,
                 ... 
                 "time_watched":24:00:00
         }
            }
         ]
      },
   {  
      “start_date”:“YYYY-MM-DD”,
      “end_date”:“YYYY-MM-DD”,
      “data”:[  
         {  
            “group”:{  

            },
            "metrics":{  
              "playthrough_50":100,
              "uniq_displays":2500,
              "video_starts":3000,
              ... 
              "time_watched":24:00:00
         }
         }
      ]
   },
{  
   “start_date”:“YYYY-MM-DD”,
   “end_date”:“YYYY-MM-DD”,
   “data”:[  
      {  
         “group”:{  

         },
         "metrics":{  
            "playthrough_50":100,
            "uniq_displays":2500,
            "video_starts":3000,
            ... 
            "time_watched":24:00:00
         }                            
      }                                   
   ]       
}   
],
“status”:“OK”,
“total_count”:3
}
This returns metric totals broken down by day.

Geo Dimensions

v2 URL Syntax v3 Equivalent
/v2/analytics/reports/asset/$asset_id/
performance/
countries/$country/
regions/$region/
$date_range
 /v3/analytics/reports/?report_type=performance
&dimensions=asset,country,region
&filters=asset=='asset_id',country=='country',region=='region'
&start_date=$start&end_date=$end&api_key=yourApiKey
https://api.ooyala.com/v3/analytics/reports/?report_type=performance&dimensions=asset,country,region&filters=asset==’asset_id’, country==’country’,region==’region’&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD &api_key=yourApiKey&expires=yourExpiration&signature=yourSignature

Sample Ooyala IQ Response:

{  
     “status_code”:“200”,
     "result_count":1,
     "results":[  
      {  
          “start_date”:“YYYY-MM-DD”,
          “end_date”:“YYYY-MM-DD”,
          “data”:[  
            {  
                 “group”:{  
                     "asset”:”asset_id”,
                     "country":"Country Code",
                     "countryName":"Country Name",
                     "region":"Region",
                     "name”:”Asset Name”, 
                     "status":"live”, 
                     "type":”video"
                     }, 
                 "metrics":{  
                     "playthrough_50": "40000",      
                     "uniq_displays": "3000000",      
                     "video_starts": "4000000",      
                     "displays": "5000000",
                     “percentage_watched":[  
                        18,
                        14,
                        13,
                        13,
                        15,
                        20,
                        12,
                        14,
                        12,
                        11,
                        19,
                        18,
                        8,
                        13,
                        11,
                        18,
                        16,
                        10,
                        15,
                        17,
                        15,
                        16,
                        8,
                        10,
                        12,
                        13,
                        8,
                        9,
                        8,
                        14,
                        8,
                        10,
                        11,
                        11,
                        12,
                        10,
                        11,
                        5,
                        0,
                        14
                     ],
                     "player_loads":5000000,
                     "segment_watched":[  
                        18,
                        14,
                        13,
                        13,
                        15,
                        20,
                        12,
                        14,
                        12,
                        11,
                        19,
                        18,
                        8,
                        13,
                        11,
                        18,
                        16,
                        10,
                        15,
                        17,
                        15,
                        16,
                        8,
                        10,
                        12,
                        13,
                        8,
                        9,
                        8,
                        14,
                        8,
                        10,
                        11,
                        11,
                        12,
                        10,
                        11,
                        5,
                        0,
                        14
                     ],
                     "urls_copied": "3",
                     "plays_requested": "6500",      
                     "embeds_copied": "2",      
                     "facebook": "3",      
                     "replays": "145",      
                     "uniq_video_starts": "2000000",      
                     "autoplays": "0",      
                     "emails_sent": "0",      
                     "digg": "0",      
                     "playthrough_25": "50000",      
                     "playthrough_75": "40000",      
                     "twitter": "0",      
                     "uniq_plays_requested": "60000",      
                     "playthrough_100": "30000",      
                     "time_watched": "75:33:00"                                      
                  }                               
               }                        
            ]                 
         }          
      ],
        “total_count”:1,
        “status”:“OK”
   }

Device and Platform Dimensions

v2 URL Syntax v3 Equivalent
/v2/analytics/reports/asset/$asset_id/
performance/
device_types/$device_type/
platforms/$platform/
$date_range
/v3/analytics/reports/?report_type=performance
&dimensions=asset,device_type
&filters=((device_type=='$device_type')) AND 
((asset_id=='$asset_id'))
&start_date=$start
&end_date=$end&api_key=yourApiKey
https://api.ooyala.com/v3/analytics/reports/?report_type=performance&dimensions=asset,device_type&filters=%28%28device_type%3D%3D%27device_type%27%29%29+AND+%28%28asset_id%3D%3D%27$asset_id%27%29%29 &start_date=YYYY-MM-DD&end_date=YYYY-MM-DD &api_key=yourApiKey&expires=yourExpiration&signature=yourSignature

Sample Ooyala IQ Response:

{  
     “status_code”:“200”,
     "result_count":1,
     "results":[  
      {  
          “start_date”:“YYYY-MM-DD”,
          “end_date”:“YYYY-MM-DD”,
          “data”:[  
            {  
                 “group”:{  
                     "asset”:”asset_id”,
                     "name”:”Asset Name”, 
                     "status":"live”, 
                     "type":”video",
                     "device_type":"device_type” 
                     }, 
                 "metrics":{  
                     "playthrough_50": "40000",      
                     "uniq_displays": "3000000",      
                     "video_starts": "4000000",      
                     "displays": "5000000",
                     “percentage_watched":[  
                        18,
                        14,
                        13,
                        13,
                        15,
                        20,
                        12,
                        14,
                        12,
                        11,
                        19,
                        18,
                        8,
                        13,
                        11,
                        18,
                        16,
                        10,
                        15,
                        17,
                        15,
                        16,
                        8,
                        10,
                        12,
                        13,
                        8,
                        9,
                        8,
                        14,
                        8,
                        10,
                        11,
                        11,
                        12,
                        10,
                        11,
                        5,
                        0,
                        14
                     ],
                     "player_loads":5000000,
                     "segment_watched":[  
                        18,
                        14,
                        13,
                        13,
                        15,
                        20,
                        12,
                        14,
                        12,
                        11,
                        19,
                        18,
                        8,
                        13,
                        11,
                        18,
                        16,
                        10,
                        15,
                        17,
                        15,
                        16,
                        8,
                        10,
                        12,
                        13,
                        8,
                        9,
                        8,
                        14,
                        8,
                        10,
                        11,
                        11,
                        12,
                        10,
                        11,
                        5,
                        0,
                        14
                     ],
                     "urls_copied": "3",
                     "plays_requested": "6500",      
                     "embeds_copied": "2",      
                     "facebook": "3",      
                     "replays": "145",      
                     "uniq_video_starts": "2000000",      
                     "autoplays": "0",      
                     "emails_sent": "0",      
                     "digg": "0",      
                     "playthrough_25": "50000",      
                     "playthrough_75": "40000",      
                     "twitter": "0",      
                     "uniq_plays_requested": "60000",      
                     "playthrough_100": "30000",      
                     "time_watched": "75:33:00"                                      
                  }                               
               }                        
            ]                 
         }          
      ],
        “total_count”:1,
        “status”:“OK”
   }

Was this article helpful?