Access 'All Conv. value / cost' or 'All Conv. Value' in the google ad script.

437 views
Skip to first unread message

Rukesh Prajapati

unread,
Feb 2, 2021, 6:40:45 AM2/2/21
to Google Ads Scripts Forum
Hi All,

I am writing a script for google adword that will exclude the unnecessary products.

I have automated a task to disable all products whose click value is above 50 but conversion is still 0.
We can get all product whose click value is grater than 50 and conversion value is 0 from 'withCondition' parameter below.
After that it will disable all those prouduct with 'excludeTheProducts' function.

function main() {
var campaignName = 'CAMPAIGN NAME';  //Campaign Name
var adGroupName = 'ADGROUP NAME';           //Ad Group Name   
  
var clickValue ='50';  //Maximum Click Value
var conversionValue='0'; //Minumum Conversion value

var shoppingAdGroup = AdsApp.shoppingAdGroups()
      .withCondition("CampaignName = '" + campaignName +
          "' and AdGroupName = '" + adGroupName + "'").get().next();
var root = shoppingAdGroup.rootProductGroup();
  //Get all product with Greater or equal to the Click value and Less than or equal to Converstion value
var childProductClicksGroups = root.children().withCondition("Clicks >= '"+clickValue+"' and Conversions <= '"+conversionValue+"'").forDateRange('LAST_MONTH').get();

    //This will exclude the product
excludeTheProducts(childProductClicksGroups);
}

Now I would like to same process for all products whose 'All Conv. value / cost' (https://prnt.sc/y0gx27) is less than 1 and Clickvalue is above 50.
But it seems that there is no way of accessing 'All Conv. value / cost' or 'All Conv. Value' in the google ad script.

How do we access those values in ad script?

Thanks

Sigurd Fabrin

unread,
Feb 2, 2021, 9:08:17 AM2/2/21
to Google Ads Scripts Forum
You can get the data from this report using AdsApp.report() https://developers.google.com/adwords/api/docs/appendix/reports/shopping-performance-report it's aggregated on OfferId level. You'll need to calculate roas yourself though.

Google Ads Scripts Forum Advisor

unread,
Feb 3, 2021, 2:08:17 AM2/3/21
to adwords...@googlegroups.com

Hi Rukesh,

 

Thanks for reaching out. Only the number of conversions is available by using the getStatsFor in ProductGroup and getConversions method in ​Stats through scripts. You may also consider using the suggestion from Sigurd by using Google Ads reporting to retrieve a Shopping Performance Report.

 

Please see also AllConversions or AllConversionValue fields for your reference. Let me know if you have questions.

 

Thanks,

Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


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