Query: Accessing Daily Remaining Account Budget & Total Impression Share in Account Scripts

41 views
Skip to first unread message

yixuan Yang

unread,
Nov 18, 2025, 6:40:43 PM (11 days ago) Nov 18
to Google Ads Scripts Forum
Hi,
I am working on a script to run at the Google Ads account level and I have two specific data retrieval questions for the community.
1. Daily Remaining Account Budget
I am looking for a way to fetch the daily remaining budget for the current account directly within my Account-level Script.
• Question: Does Google Ads Scripts offer a native method to retrieve this specific value?
• How to get it: If possible, what specific object, method, or report (e.g., using AdsApp.currentAccount().... or a particular report type) should I use to access the daily remaining budget amount?
2. Total Impression Share (Account-Level)
I need to retrieve the Total Impression Share for the account, rather than the impression share for a specific Campaign, Ad Group, or Keyword. This metric is visible in the Google Ads UI.
• Question: Can I obtain the overall Account-Level Total Impression Share data via an Account-level Script or by querying a specific report?
• How to get it: If feasible, which report type (e.g., search_query_performance_report, account_performance_report, etc.) and which specific field (e.g., Metrics.IMPRESSION_SHARE) should I query to get this high-level overview?
Any guidance or code snippets on achieving these two goals would be greatly appreciated!
Thank you for your time and assistance!
Best regards,
Yixuan Yang

Google Ads Scripts Forum Advisor

unread,
Nov 19, 2025, 9:41:34 AM (11 days ago) Nov 19
to adwords...@googlegroups.com
Hi Yixuan,
 
Thank you for reaching out to the Google Ads Scripts Support team.
 
Here are the answers to your questions:
 
1) I am looking for a way to fetch the daily remaining budget for the current account directly within my Account-level Script.
 
Currently it's not possible to fetch the daily remaining budget for the current account using the Google Ads Scripts. But , you can get the account budget details, using the account_budget report. You may try the following sample code :
function main() {
  
  let report = AdsApp.report(
    "SELECT " +
    "account_budget.id, account_budget.name, account_budget.amount_served_micros, account_budget.adjusted_spending_limit_micros, account_budget.adjusted_spending_limit_type " +
    "FROM account_budget ");
  
  
let rows = report.rows();
while (rows.hasNext()) {
    let row = rows.next();
  
     let id = row["account_budget.id"];
     let amount_served_micros = row["account_budget.amount_served_micros"]
  console.log("Account budge id:" +  id + "Amount served micros : " +  amount_served_micros);
}
  
}
 
2) I need to retrieve the Total Impression Share for the account, rather than the impression share for a specific Campaign, Ad Group, or Keyword. This metric is visible in the Google Ads UI.
 
You can get the total impression share for the account using the customer report. You may try the following sample code :
function main() {
  
  let report = AdsApp.report(
    "SELECT " +
    "metrics.search_impression_share  " +
    "FROM customer ");
  
let rows = report.rows();
while (rows.hasNext()) {
    let row = rows.next();
  
  let  totalImpressionShare = parseFloat(row["metrics.search_impression_share"]);
  
  console.log("Total impression share :" +  totalImpressionShare);
}
  
}
 Additionally, you can utilize the Query Builder and Query Validator to build and validate your queries. 
 
I hope this helps Feel free to get back to us if you have any further questions. 
 
Thanks,
 
Google Logo Google Ads Scripts Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-11-19 14:41:06Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01vTtI7:ref" (ADR-00340601)



yixuan Yang

unread,
Nov 19, 2025, 10:53:24 PM (10 days ago) Nov 19
to Google Ads Scripts Forum

Hi ,

Thank you so much for your previous assistance. I have tried the method you suggested for retrieving the Total Impression Share, and it is working perfectly for the account level.

However, I realized that querying the customer resource does not allow me to filter by specific campaign attributes.

Could you please advise if it is possible to retrieve the aggregated Total Impression Share for specific subsets of campaigns? Specifically, I am looking to get this metric for:

  1. Performance Max (PMax) campaigns only.

  2. Campaigns containing specific text in their name (e.g., all campaigns with "dtc" in the title).

Is there a way to achieve this via the scripts ?

I really appreciate your time and help with this.

Best regards,

Yixuan Yang

Google Ads Scripts Forum Advisor

unread,
Nov 20, 2025, 3:21:42 AM (10 days ago) Nov 20
to adwords...@googlegroups.com

 Hi Yixuan,

I would like to inform you that there is no such metric available to retrieve the aggregated total impression share. However, you can retrieve the top impression share, search impression share of a campaign. I would recommend that you use the below code for the same.

function main() {  
  let report = AdsApp.report(“SELECT metrics.search_impression_share, metrics.search_top_impression_share FROM campaign WHERE campaign.advertising_channel_type = 'PERFORMANCE_MAX' AND campaign.name LIKE 'dtc'”);
let rows = report.rows();
while (rows.hasNext()) {
    let row = rows.next();
     let search_impression_share = row["metrics.search_impression_share"];
     let search_top_impressions = row["metrics.search_top_impression_share"]
  console.log("search impression share:" + search_impression_share + "search top impression share : " +  metrics.search_top_impression_share);
}
}
Additionally, you can utilize the Google Ads Query Builder and Query Validator to build and validate the queries for retrieving the data from the Google Ads API.

Thanks,
 
Google Logo Google Ads Scripts Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-11-20 08:21:08Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01vTtI7:ref" (ADR-00340601)



meenarawattm

unread,
Nov 23, 2025, 7:49:28 PM (6 days ago) Nov 23
to yixuan Yang 提供方 Google Ads Scripts Forum
hello Yixuan

Thanks a lot, really appreciate it.

Meena

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/adwords-scripts/3cd0eda7-5313-4b04-a3cf-0c8a17b41b03n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages