fetching search impression share

200 views
Skip to first unread message

Yaniv Lev-Ari

unread,
Apr 12, 2022, 2:55:55 AM4/12/22
to Google Ads Scripts Forum
I want to create a script that looks everyday for search impression share of each keyword, and raise bid if share is less than 0.7

for the first step I just wanted to log the details, but I got an error.

here is my current script:

function main() {

const TARGET_IMPRESSION_SHARE = 0.7;

const TOLERANCE = 0.05;

// How much to adjust the bids.
const BID_ADJUSTMENT_COEFFICIENT = 1.05;
 
  var keywords=  AdsApp.keywords()
      .withCondition(`ad_group_criterion.status = ENABLED`)
      .withCondition(`campaign.status = ENABLED`)
      .withCondition(
          `metrics.search_impression_share < ${TARGET_IMPRESSION_SHARE - TOLERANCE}`)
      .orderBy(`metrics.search_impression_share ASC`)
      .forDateRange(`YESTERDAY`)
      .get().next();
 
 
  var name = keywords.getText();
 
  var query = 'SELECT SearchImpressionShare FROM ACCOUNT_PERFORMACE_REPORT WHERE KeywordText = "' + name + '" DURING YESTERDAY ' ;
 
  var report = AdWordsApp.report(query);  
  var rows = report.rows();

  while (rows.hasNext()) {
    var row = rows.next();
    var share = row["SearchImpressionShare"];
    var stats = keywords.getStatsFor(YESTERDAY);
    var imp = stats.getImpressions();
    var clk = stats.getClicks();
   
    Logger.log(name + " imp = " + imp + " click = " + clk + " share = " + share);
   
 
}
 

 and this is my error:
InputError: Report not mapped: ACCOUNT_PERFORMACE_REPORT at Ih (adsapp_compiled:1662:11) at new lG (adsapp_compiled:16499:15) at new CG (adsapp_compiled:16724:22) at pH.report (adsapp_compiled:17386:12) at qH.report (adsapp_compiled:17525:21) at Object.<anonymous> (adsapp_compiled:18315:54)
}

Google Ads Scripts Forum Advisor

unread,
Apr 13, 2022, 6:00:24 AM4/13/22
to adwords...@googlegroups.com
Hi Yaniv,

Thank you for reaching out to us.

As per checking on your error, it appears that the cause of this is that you're using AWQL on new script experience. With this, we would recommend to migrate your AWQL to GAQL using this migration tool.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a2AKp:ref

Yaniv Lev-Ari

unread,
Apr 15, 2022, 7:35:34 AM4/15/22
to Google Ads Scripts Forum
It appears I only had a spelling error, writing performace instead of performance,
But I still looking for a way to set the search.imperssion.share value into a variable, and I don't understand what is the name of it.

Can you help me? 

ב-יום רביעי, 13 באפריל 2022 בשעה 13:00:24 UTC+3, adsscripts כתב/ה:

Google Ads Scripts Forum Advisor

unread,
Apr 20, 2022, 2:56:23 AM4/20/22
to adwords...@googlegroups.com

Hello,

I’m James, also a member of the Google Ads scripts support team. Allow me to further assist you.

Glancing with the given code snippet, I can say that the implementation on how you set the retrieved value for SearchImperssionShare into a specific variable is correct. Having said that, can you please add more details about your concern so that we can have a better understanding of your query and we can guide you accordingly?

Also, kindly share with the following details below for our investigation.

  • CID
  • Name of the script wherein the given code snippet is implemented
  • Screenshot of the issue


Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


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