מילות מפתח שליליות
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
הוסף מילת מפתח שלילית לקמפיין
function addNegativeKeywordToCampaign(keyword, campaignName) {
const campaignIterator = AdsApp.campaigns()
.withCondition(`campaign.name = "${campaignName}"`)
.get();
if (campaignIterator.hasNext()) {
const campaign = campaignIterator.next();
campaign.createNegativeKeyword(keyword);
} else {
throw new Error(`Cannot find campaign with the name '${campaignName}'`);
}
}
אחזר מילות מפתח שליליות בקמפיין
function getNegativeKeywordsForCampaign(campaignName) {
const campaignIterator = AdsApp.campaigns()
.withCondition(`campaign.name = "${campaignName}"`)
.get();
if (campaignIterator.hasNext()) {
const campaign = campaignIterator.next();
const negativeKeywordIterator = campaign.negativeKeywords().get();
console.log(`Found ${negativeKeywordIterator.totalNumEntities()} negative keywords.`);
return negativeKeywordIterator;
} else {
throw new Error(`Cannot find campaign with the name '${campaignName}'`);
}
}
הוסף מילת מפתח שלילית לקבוצת מודעות
function addNegativeKeywordToAdGroup(keyword, adGroupName) {
const adGroupIterator = AdsApp.adGroups()
.withCondition(`ad_group.name = "${adGroupName}"`)
.get();
if (!adGroupIterator.hasNext()) {
throw new Error(`Cannot find ad group with the name '${adGroupName}'`);
}
if (adGroupIterator.totalNumEntities() > 1) {
console.warn(`Found more than one ad group named '${adGroupName}', using the first one.`);
}
const adGroup = adGroupIterator.next();
adGroup.createNegativeKeyword(keyword);
}
אחזר מילות מפתח שליליות בקבוצת מודעות
function getNegativeKeywordsForAdGroup(adGroupName) {
const adGroupIterator = AdsApp.adGroups()
.withCondition(`ad_group.name = "${adGroupName}"`)
.get();
if (!adGroupIterator.hasNext()) {
throw new Error(`Cannot find ad group with the name '${adGroupName}'`);
}
if (adGroupIterator.totalNumEntities() > 1) {
console.warn(`Found more than one ad group named '${adGroupName}', using the first one.`);
}
const adGroup = adGroupIterator.next();
const negativeKeywordIterator = adGroup.negativeKeywords().get();
if (negativeKeywordIterator.hasNext()) {
const negativeKeyword = negativeKeywordIterator.next();
console.log(`Found ${negativeKeywordIterator.totalNumEntities()} negative keywords.`);
return negativeKeywordIterator;
}
}
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-09-12 (שעון UTC).
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"חסרים לי מידע או פרטים"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"התוכן מורכב מדי או עם יותר מדי שלבים"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"התוכן לא עדכני"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"בעיה בתרגום"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"בעיה בדוגמאות/בקוד"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"סיבה אחרת"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"התוכן קל להבנה"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"התוכן עזר לי לפתור בעיה"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"סיבה אחרת"
}]
{"lastModified": "\u05e2\u05d3\u05db\u05d5\u05df \u05d0\u05d7\u05e8\u05d5\u05df: 2024-09-12 (\u05e9\u05e2\u05d5\u05df 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-12 (שעון UTC)."]]