דוחות
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
צור דוח מסוג טקסט
function runReport() {
// Google Ads reports return data faster than campaign management methods
// and can be used to retrieve basic structural information on
// your Account, Campaigns, AdGroups, Ads, Keywords, etc. You can refer to
// https://developers.google.com/google-ads/api/docs/reporting/overview
// for more details.
// See https://developers.google.com/google-ads/api/fields/latest/overview#list-of-all-resources
// for all the supported report types.
// See https://developers.google.com/google-ads/api/docs/query/overview for
// details on how to use GAQL, the query language for reports.
// See https://developers.google.com/google-ads/api/docs/reporting/uireports
// for details on how to map an Google Ads UI feature to the corresponding
// reporting API feature.
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.costMicros;
console.log(`${campaignName}, ${clicks}, ${impressions}, ${cost}`);
}
}
צור דוח מסוג גיליון אלקטרוני
function exportReportToSpreadsheet() {
const spreadsheet = SpreadsheetApp.create('INSERT_REPORT_NAME_HERE');
const report = AdsApp.report(
'SELECT campaign.name, metrics.clicks, metrics.impressions, metrics.cost_micros ' +
'FROM campaign ' +
'WHERE metrics.impressions < 10 ' +
' AND segments.date DURING LAST_30_DAYS');
report.exportToSheet(spreadsheet.getActiveSheet());
}
סנן יישויות לפי תווית
function filterReportByLabelIds() {
const label = AdsApp.labels().withCondition(
"label.name = 'High performance campaigns'").get().next();
const query = `SELECT campaign.name, metrics.clicks, metrics.impressions, metrics.cost_micros from ` +
`campaign WHERE campaign.labels CONTAINS ANY ` +
`[${label.getResourceName()}] AND segments.date DURING THIS_MONTH';
const report = AdsApp.report(query);
for (const row of report.rows()) {
const campaignName = row['campaign.name'];
const clicks = row['metrics.clicks'];
const impressions = row['metrics.impressions'];
const cost = row['metrics.cost_micros'];
Logger.log(`${campaignName}, ${clicks}, ${impressions}, ${cost}`);
}
}
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-09-10 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2024-09-10 (שעון UTC)."],[[["This script showcases Google Ads reporting capabilities to extract campaign performance data like clicks, impressions, and cost."],["It provides examples of creating text and spreadsheet reports based on specified criteria like low impressions within the last 30 days."],["The script demonstrates filtering campaign data using labels, focusing on entities marked as \"High performance campaigns\" in the current month."],["The provided code uses Google Ads Query Language (GAQL) to define the data structure and parameters for reports."]]],[]]