Why is the "averageCPC" value so high when I have not spent this much on my Google Ads?

61 views
Skip to first unread message

Marcus D'Suza

unread,
Dec 29, 2021, 3:57:11 PM12/29/21
to Google Ads Scripts Forum
Greetings! 

I am working with the Shopping Performance View report in Google Ads Script. I want to retrieve the clicks, conversion value, impressions, ctr, and the average cost per click for all products in my Google Ads account. 

Everything except the average cost per click and conversion value is good. Currently, I am not sure why the averageCost value for each product is high? This is shown in millions but I have not spent this much on Google Ads? Is it represented in other currency formats, if yes how can I convert it to regular format? I know it may sound silly to ask but I am not sure about the current format representation of averageCPC.

In addition to that, what is the difference between metrics.conversion and metrics.conversion_value? 
Screenshot_30.png

Marcus D'Suza

unread,
Dec 29, 2021, 3:58:32 PM12/29/21
to Google Ads Scripts Forum
The Google Ads Code I am using to get this data is; 

function productList() {
    var productsDetails = [];
   
    // Query to retrieve required data
    var query = 'SELECT segments.product_channel, segments.product_country, segments.product_language, segments.product_item_id, metrics.average_cpc, metrics.clicks, metrics.conversions, metrics.ctr, metrics.impressions FROM shopping_performance_view';
    var result = AdsApp.search(query, {apiVersion: 'v9'});
    while (result.hasNext()) {
      var row = result.next();
      productStats = {"metrics" : row['metrics'], "segments" : row['segments']};
     
      if (Object.keys(productStats['segments']).indexOf('productItemId') === -1) {
        continue;
      }
      productsDetails.push(productStats);
    }
    return productsDetails;

Nils Rooijmans

unread,
Dec 30, 2021, 7:33:06 AM12/30/21
to Google Ads Scripts Forum
Hi Marcus,

the return value from the AdsApp.search method represents money in micros;  '1370000'  is equal to currency '1.37'.

You need to convert this micros value to your currency within your script. Here's a function you can use to do so:

// convert money data type to currency cost value
function convertMoney(m) {
  return m / 1000000;
}



Hope this helps,

Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/

Google Ads Scripts Forum Advisor

unread,
Dec 31, 2021, 3:46:16 AM12/31/21
to adwords...@googlegroups.com
Hi Marcus,

The Google Ads API should mirror more the data that the keyword planner shows

Please do note that the Google Ads Scripts should mirror the data on your Google Ads UI. That said, it would be best to contact our Product support team via this link instead if your concern is on why a specific metric (averageCost) is high as they are more equipped in this kind of inquiries.

However, if you're seeing a discrepancy between the result of your Google Ads Scripts vs. Google Ads UI, then provide us the following.
  • CID 
  • Script Name
  • Screenshot of your Google Ads UI and Google Ads Scripts showing the discrepancy
Regards,
Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team
 


Regards,
Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team
 


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