AdWords
3.1K members online now
3.1K members online now
For questions related to Google Shopping and Merchant Center. Learn to optimize your Shopping ads
Guide Me
star_border
Reply

Adwords Script Conversion_Value for Shopping Campaigns

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Is it possible to pull out The conversion value for a ProductGroup in a shopping campaign script wrote in javascript? I am currently using this script to pull out the spend and the converted clicks to make bid adjustment in shopping campaigns but i would like to add the Conversion Value field.

 

 

function main(){    

 

var today = new Date()  

var todaynum = today.getDay()   

 

  if( todaynum !== 0 && todaynum !== 6){     

var productGroups = AdWordsApp.productGroups()    

   .withCondition("Clicks > 20")  

     .forDateRange("LAST_14_DAYS")   

    .withCondition("CampaignName CONTAINS_IGNORE_CASE 'Shopping'")    

   .get();  

while (productGroups.hasNext()) {   

  var productGroup = productGroups.next();  

   var stats = productGroup.getStatsFor("LAST_14_DAYS");    

var cost = stats.getCost();   

  var conversions = stats.getConvertedClicks();   

  var CPO = cost / conversions;  

   var CPC= stats.getAverageCpc();   

  var maxCPC = productGroup.getMaxCpc();    

var clicks = stats.getClicks();    

 

      if(conversions > 0){     

 

    if(CPO > 25 && CPC < maxCPC){     

   productGroup.setMaxCpc(maxCPC*0.95);   

  }      

   if(CPO < 10 && CPC > 0.8*maxCPC){ 

    productGroup.setMaxCpc(maxCPC*1.05);

       }    

} else {  

   if(clicks > 100){  

   productGroup.exclude(); 

    }    } } } }

1 Expert replyverified_user

Re: Adwords Script Conversion_Value for Shopping Campaigns

Top Contributor
# 2
Top Contributor

there are getClickConversionRate and getConvertedClicks;
otherwise, conversionvalue is exposed in the report methods.

otherwise, the adwords-scripts forum is currently here:
https://groups.google.com/forum/#!forum/adwords-scripts