video_views metric not working in script - please help

20 views
Skip to first unread message

Mike Rhodes

unread,
Sep 27, 2022, 11:37:25 PM9/27/22
to Google Ads API and AdWords API Forum
So I have this SELEVT query
works fine, but conv_value, video_views & cpv all come back as 'undefined' (in console.log) or blank when I output to a spreadsheet 

any ideas???

  let q = 'SELECT ' +
      'campaign.name, metrics.clicks, metrics.impressions, metrics.cost_micros, metrics.conversions, metrics.conversions_value, metrics.video_views, metrics.average_cpv ' +
      'FROM   campaign ' +
      'WHERE  metrics.impressions >= 1 ' +
      ' AND   segments.date DURING LAST_30_DAYS';
      'ORDER BY metrics.cost_micros DESC';


  const searchResults = AdsApp.search(q);
 
    for (const row of searchResults) {
    const name = row.campaign.name;
    const clicks = row.metrics.clicks;
    const impr = row.metrics.impressions;
    const cost = row.metrics.costMicros / 1000000;
    const conv = row.metrics.conversions;
    const value = row.metrics.conversions_value;
    const views = row.metrics.video_views;
    const cpv = row.metrics.average_cpv;

    console.log(`${name}, ${clicks}, ${impr}, ${cost}, ${conv}, ${views}, ${cpv}`);

THANKS in advance!!


Google Ads API Forum Advisor

unread,
Sep 28, 2022, 3:16:49 AM9/28/22
to mi...@websavvy.com.au, adwor...@googlegroups.com
Hi Mike,

Thank you for reaching us out. I am Sherwin from Google Ads API support team. I hope that you are doing well today.

Looks your concern is related to the output of the metrics. To further investigate this issue, could you please provide us the complete request and response logs with request ID and request header generated on your end? You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com. If you haven't enabled the logging yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.

Furthermore, could you please provide us the full screenshot of the UI which you see the metrics that you wanted to fetch and the Account ID that you use to fetch the report?

Kind regards,
Google Logo
Sherwin Vincent
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ehPqI:ref
Reply all
Reply to author
Forward
0 new messages