I am experiencing an issue when using the getAllCampaigns function to check the number of campaigns in my account. The function returns a count of 6 campaigns, but I actually have 36 campaigns in my account. The account ID is 157-619-8444.
Thank you for your assistance!
function main() {
const searchResults = AdsApp.search(
'SELECT campaign.name,campaign.advertising_channel_type FROM campaign');
for (const row of searchResults) {
const campaignName = row.campaign.name;
const campaignType = row.campaign.advertisingChannelType;
console.log(`${campaignName}, ${campaignType}`);
}
}
![]() |
Google Ads Scripts Team |
Thank you for your helpful response regarding the AdsApp.campaigns().get() method and the suggestions to use the reporting options. I appreciate the information you've provided.
However, I still have some confusion. When using the reporting method, I am unable to query the geo.country dimension. Can you please provide guidance on how to include this specific segmentation in my reports?
Thank you for your assistance!
Thank you for your assistance so far.
I would like to utilize the method outlined in the Geographic View Query Builder to query the spend for a specific region. Could you please provide a sample script for this purpose?
I appreciate your help and look forward to your response.
Best regards,
Hi,
I would suggest that you use the metric ‘geographic_view.country_criterion_id’ in the WHERE field to get metrics for specified locations. You may refer to the sample query to understand this better.
SELECT metrics.cost_micros FROM geographic_view WHERE geographic_view.country_criterion_id IN (criterion_id)
You can add or edit the above query and validate it by using the Google Ads Query Validator. After building the required query, I would suggest that you use the Report method to retrieve the data in logs.
I hope this helps.
Thanks,Hi,
I hope this message finds you well.
I have been using the method outlined in the script below to process data:
However, I am facing the following error:
This has left me quite confused. The account ID I am working with is 787-394-3146.
Could you please provide some guidance on how to resolve this issue? I appreciate your help!
Thank you!
I wanted to express my sincere thanks for your assistance; I’ve finally resolved the issue! Your help has been invaluable.
However, I have another question: I’m looking to query ad spend broken down by device platform (such as ios and android,not desktop and mobile), but I can’t seem to find the corresponding table or data source. Could you provide some guidance on where I can find this information?
Thank you for your help, and I look forward to your reply!
I hope this message finds you well.
I wanted to follow up regarding the concern I raised earlier. Have there been any updates from the rest of the team? I appreciate your assistance and look forward to hearing back from you soon.
![]() |
|
||||
[2025-02-19 02:01:38Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02vH1ea:ref" (ADR-00288165)
--
-- 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/BkkzM000000000000000000000000000000000000000000000SRWQYQ00YWmTdn0YQxu-sA_tY9VW3A%40sfdc.net.