Getting error while retrieving stats for shared budgets.

39 views
Skip to first unread message

kuldeep verma

unread,
Jun 21, 2022, 1:39:37 PM6/21/22
to Google Ads Scripts Forum
Hello Team,

I am trying to retrieve shared budget stats like: cost & conversions. below is my code.

But i am getting given error when i preview. can you please help ?

---------
Code:
---------

var budgets = AdsApp.budgets().withCondition("campaign_budget.name = 'Main Campaigns'").withCondition("campaign_budget.explicitly_shared = true").get();
        if(budgets.hasNext()){
          var budget = budgets.next();
         
          Logger.log(budget.getStatsFor("ALL_TIME").getCost());
}


--------
Error
--------

SystemError: Could not read from Google Ads (Internal details: Missing field [0] in object [ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { "clicks": "82396", "videoViews": "0", "conversions": 1924.416663, "costMicros": "123778360000", "ctr": 0.07389331762127298, "averageCpc": 1502237.487256663, "averageCpm": 111005311.78843962, "impressions": "1115067" } ]) at g (adsapp_compiled:265:50) at Kj.Rb (adsapp_compiled:2611:12) at Xv.getStatsFor (adsapp_compiled:629:31) at Object.<anonymous> (adsapp_compiled:18335:54)

Can you please help me in solving the same ?

Thank you so much

Google Ads Scripts Forum

unread,
Jun 24, 2022, 7:25:37 AM6/24/22
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/RZXqj0bJuV4) from the forum as it wasn't routed to our support queue.

Regards,
Teejay
Google Ads Scripts Team

Google Ads Scripts Forum Advisor

unread,
Jun 27, 2022, 1:09:09 AM6/27/22
to adwords...@googlegroups.com

Hi,

I’m James from the Google Ads scripts support team. Thank you for reaching out to us.

Can you please provide us with the following information below so that we can further investigate and troubleshoot?

  • Google Ads account ID / CID
  • Script name

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


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