Hello Jay,
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 details below so that we can check your issue?
Regards,
|
||||||
Hello Jay,
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 details below so that we can check your issue?
- Google Ads account ID / CID: 781-438-3043
- Name of the script that encountered the said error: "create text report"
Regards,
James Howell Google Ads Scripts Team
ref:_00D1U1174p._5004Q2d0v74:ref
--
-- 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 a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/YG3-X6hK8kI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/iHLCg000000000000000000000000000000000000000000000RFK7RP00oQpGep37QCGisHZnwNc4lw%40sfdc.net.
Hello Jay,
Thank you for providing the requested information. I checked your script and I observed that you’re not utilizing the function main() which is the main reason why you encountered the said error. Having said that, I made some adjustments to your script below for it to work on your end.
function main() {
const searchResults = AdsApp.search(
'SELECT campaign.name, metrics.clicks, metrics.impressions, metrics.cost_micros ' +
'FROM campaign ' +
'WHERE metrics.impressions < 10 ' +
' AND segments.date DURING LAST_30_DAYS');
for (const row of searchResults) {
const campaignName = row.campaign.name;
const clicks = row.metrics.clicks;
const impressions = row.metrics.impressions;
const cost = row.metrics.cost;
console.log(`${campaignName}, ${clicks}, ${impressions}, ${cost}`);
}
}
Can you please try to implement the given code above and let me know how it goes on your end?
Regards,
Hello Nils,
Thank you for sharing your insights here. We appreciate it.
@Jay - you may also try the given approach by Nils. It is an alternative way to execute your scripts successfully.
If you have any questions, please let us know. We’re here to assist you.
Regards,