การเสนอราคา
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
รับกลยุทธ์การเสนอราคา
function getBiddingStrategies() { const bidStrategyIterator = AdsApp.biddingStrategies().get(); return bidStrategyIterator; }
รับกลยุทธ์การเสนอราคาตามชื่อ
function getBiddingStrategyIteratorByName(biddingStrategyName) { const biddingStrategiesIterator = AdsApp.biddingStrategies() .withCondition(`bidding_strategy.name = '${biddingStrategyName}'`) .get(); return biddingStrategiesIterator; }
ตั้งค่ากลยุทธ์การเสนอราคาของแคมเปญ
function setVariousBiddingStrategies() { // This example snippet assumes the user has a campaign named "Online Sales". const campaignName = 'Online Sales'; const campaignIterator = AdsApp.campaigns() .withCondition(`campaign.name = '${campaignName}'`) .get(); if (!campaignIterator.hasNext()) { throw new Error(`No Campaign found with name "${campaignName}"`); } if (campaignIterator.totalNumEntities() > 1) { console.warn( `Found ${campaignIterator.totalNumEntities()} Campaigns with name "${ campaignName}", using just one of them`); } const campaign = campaignIterator.next(); // Set the campaign's bidding strategy to Manual CPC. campaign.bidding().setStrategy('MANUAL_CPC'); // By default, the Manual CPC strategy enables Enhanced CPC bidding. The user // can disable ECPC when setting the strategy by providing an extra argument. campaign.bidding().setStrategy('MANUAL_CPC', {enhancedCpcEnabled: false}); // Some standard bidding strategies, such as Target Return on Ad Spend, // require additional arguments when setting the strategy. Setting the // strategy to Target Return on Ad Spend without providing the required // additional arguments will fail. campaign.bidding().setStrategy('TARGET_ROAS', {targetRoas: 1.3}); // Extra arguments can also be specified through the BiddingStrategyArgsBuilder. const args = campaign.bidding.argsBuilder().withTargetRoas(1.3).withCpcBidCeiling(2.5); campaign.bidding().setStrategy('TARGET_ROAS', args); // If the user has defined a flexible bidding strategy for the campaign, then // this is also valid for `setStrategy`. For this example, assume the user // has a flexible bidding strategy named "My Shared Bidding Strategy". const strategyName = 'My Shared Bidding Strategy'; const strategy = AdsApp.biddingStrategies() .withCondition(`bidding_strategy.name = '${strategyName}'`) .get() .next(); campaign.bidding().setStrategy(strategy); }
ตั้งค่าราคาเสนอ CPC เริ่มต้นของกลุ่มโฆษณา
function setAdGroupDefaultCpcBid(campaignName, adGroupName){ const adGroup = AdsApp.adGroups() .withCondition(`campaign.name = '${campaignName}'`) .withCondition(`ad_group.name = '${adGroupName}'`) .get() .next(); // This bid will only be used for auction if a corresponding cpc // bidding strategy is set to the ad group. E.g. // // adGroup.bidding().setStrategy('MANUAL_CPC'); adGroup.bidding().setCpc(3.0); }
ตั้งค่าราคาเสนอ CPC ของคำหลัก
function setKeywordCpcBid(campaignName, adGroupName, keywordText, keywordMaxCpcBid) { const keyword = AdsApp.keywords() .withCondition(`campaign.name = '${campaignName}'`) .withCondition(`ad_group.name = '${adGroupName}'`) .withCondition(`ad_group_criterion.keyword.text = '${keywordText}'`) .get() .next(); // This bid will only be used for auction if a corresponding cpc // bidding strategy is set to the parent ad group. E.g. // // adGroup.bidding().setStrategy('MANUAL_CPC'); keyword.bidding().setCpc(keywordMaxCpcBid); }
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-28 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"]],["อัปเดตล่าสุด 2025-07-28 UTC"],[[["These Google Ads scripts demonstrate how to manage bidding strategies programmatically, including retrieving, setting, and applying them to campaigns, ad groups, and keywords."],["You can retrieve existing bidding strategies and filter them by name to use or modify within your scripts."],["The scripts provide examples of setting various bidding strategies for campaigns, like Manual CPC, Target ROAS, and Enhanced CPC, while demonstrating the use of required arguments and bidding strategy builders."],["Included are examples of how to programmatically set default CPC bids for ad groups and specific CPC bids for keywords, empowering granular bid control within your Google Ads campaigns."],["Ensure the corresponding CPC bidding strategy is set at the ad group level for keyword and ad group CPC bids to be used in auctions."]]],[]]