สร้างเกณฑ์ของแคมเปญ

แคมเปญ Performance Max รองรับเกณฑ์ประเภทต่อไปนี้

คุณใช้ได้ทั้งเกณฑ์เชิงบวกและเชิงลบ ยกเว้นประเภทเกณฑ์ BRAND และ KEYWORD ซึ่งใช้ได้เฉพาะในเชิงลบเพื่อยกเว้นแบรนด์ และคีย์เวิร์ดจากการกำหนดเป้าหมาย

สําหรับการกําหนดสถานที่เป้าหมาย แคมเปญที่ไม่มีการระบุสถานที่หรือกลุ่มสถานที่ตั้งจะรวมทุกภูมิภาคโดยค่าเริ่มต้น

แคมเปญ Performance Max มีคีย์เวิร์ดเชิงลบได้สูงสุด 10,000 รายการ

คุณใช้เกณฑ์เชิงลบWEBPAGEเพื่อยกเว้น URL ที่เฉพาะเจาะจงจากFinal URL Expansion ได้ ดูข้อมูลเพิ่มเติมเกี่ยวกับ Final URL Expansion และ การยกเว้น URL

Java

/** Creates a list of MutateOperations that create new campaign criteria. */
private List<MutateOperation> createCampaignCriterionOperations(long customerId) {
  String campaignResourceName =
      ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID);
  List<CampaignCriterion> campaignCriteria = new ArrayList<>();
  // Sets the LOCATION campaign criteria.
  // Targets all of New York City except Brooklyn.
  // Location IDs are listed here:
  // https://developers.google.com/google-ads/api/reference/data/geotargets
  // and they can also be retrieved using the GeoTargetConstantService as shown
  // here: https://developers.google.com/google-ads/api/docs/targeting/location-targeting
  //
  // We will add one positive location target for New York City (ID=1023191)
  // and one negative location target for Brooklyn (ID=1022762).
  // First, adds the positive (negative = False) for New York City.
  campaignCriteria.add(
      CampaignCriterion.newBuilder()
          .setCampaign(campaignResourceName)
          .setLocation(
              LocationInfo.newBuilder()
                  .setGeoTargetConstant(ResourceNames.geoTargetConstant(1023191))
                  .build())
          .setNegative(false)
          .build());
  // Next adds the negative target for Brooklyn.
  campaignCriteria.add(
      CampaignCriterion.newBuilder()
          .setCampaign(campaignResourceName)
          .setLocation(
              LocationInfo.newBuilder()
                  .setGeoTargetConstant(ResourceNames.geoTargetConstant(1022762))
                  .build())
          .setNegative(true)
          .build());
  // Sets the LANGUAGE campaign criterion.
  campaignCriteria.add(
      CampaignCriterion.newBuilder()
          .setCampaign(campaignResourceName)
          // Sets the language.
          // For a list of all language codes, see:
          // https://developers.google.com/google-ads/api/reference/data/codes-formats#expandable-7
          .setLanguage(
              LanguageInfo.newBuilder()
                  .setLanguageConstant(ResourceNames.languageConstant(1000)) // English
                  .build())
          .build());
  // Returns a list of mutate operations with one operation per criterion.
  return campaignCriteria.stream()
      .map(
          criterion ->
              MutateOperation.newBuilder()
                  .setCampaignCriterionOperation(
                      CampaignCriterionOperation.newBuilder().setCreate(criterion).build())
                  .build())
      .collect(Collectors.toList());
}

      

C#

/// <summary>
/// Creates a list of MutateOperations that create new campaign criteria.
/// </summary>
/// <param name="campaignResourceName">The campaign resource name.</param>
/// <returns>A list of MutateOperations that create new campaign criteria.</returns>
private List<MutateOperation> CreateCampaignCriterionOperations(
    string campaignResourceName)
{
    List<MutateOperation> operations = new List<MutateOperation>();

    // Set the LOCATION campaign criteria.
    // Target all of New York City except Brooklyn.
    // Location IDs are listed here:
    // https://developers.google.com/google-ads/api/reference/data/geotargets
    // and they can also be retrieved using the GeoTargetConstantService as shown
    // here: https://developers.google.com/google-ads/api/docs/targeting/location-targeting
    //
    // We will add one positive location target for New York City (ID=1023191)
    // and one negative location target for Brooklyn (ID=1022762).
    // First, add the positive (negative = False) for New York City.
    MutateOperation operation1 = new MutateOperation()
    {
        CampaignCriterionOperation = new CampaignCriterionOperation()
        {
            Create = new CampaignCriterion()
            {
                Campaign = campaignResourceName,
                Location = new LocationInfo()
                {
                    GeoTargetConstant = ResourceNames.GeoTargetConstant(1023191)
                },

                Negative = false
            }
        }
    };

    operations.Add(operation1);

    // Next add the negative target for Brooklyn.
    MutateOperation operation2 = new MutateOperation()
    {
        CampaignCriterionOperation = new CampaignCriterionOperation()
        {
            Create = new CampaignCriterion()
            {
                Campaign = campaignResourceName,
                Location = new LocationInfo()
                {
                    GeoTargetConstant = ResourceNames.GeoTargetConstant(1022762)
                },

                Negative = true
            }
        }
    };

    operations.Add(operation2);

    // Set the LANGUAGE campaign criterion.
    MutateOperation operation3 = new MutateOperation()
    {
        CampaignCriterionOperation = new CampaignCriterionOperation()
        {
            Create = new CampaignCriterion()
            {
                Campaign = campaignResourceName,

                // Set the language.
                // For a list of all language codes, see:
                // https://developers.google.com/google-ads/api/reference/data/codes-formats#expandable-7
                Language = new LanguageInfo()
                {
                    LanguageConstant = ResourceNames.LanguageConstant(1000) // English
                },
            }
        }
    };

    operations.Add(operation3);

    return operations;
}

      

PHP

private static function createCampaignCriterionOperations(int $customerId): array
{
    $operations = [];
    // Set the LOCATION campaign criteria.
    // Target all of New York City except Brooklyn.
    // Location IDs are listed here:
    // https://developers.google.com/google-ads/api/reference/data/geotargets
    // and they can also be retrieved using the GeoTargetConstantService as shown
    // here: https://developers.google.com/google-ads/api/docs/targeting/location-targeting
    //
    // We will add one positive location target for New York City (ID=1023191)
    // and one negative location target for Brooklyn (ID=1022762).
    // First, adds the positive (negative = false) for New York City.
    $operations[] = new MutateOperation([
        'campaign_criterion_operation' => new CampaignCriterionOperation([
            'create' => new CampaignCriterion([
                'campaign' => ResourceNames::forCampaign(
                    $customerId,
                    self::PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
                'location' => new LocationInfo([
                    'geo_target_constant' => ResourceNames::forGeoTargetConstant(1023191)
                ]),
                'negative' => false
            ])
        ])
    ]);

    // Next adds the negative target for Brooklyn.
    $operations[] = new MutateOperation([
        'campaign_criterion_operation' => new CampaignCriterionOperation([
            'create' => new CampaignCriterion([
                'campaign' => ResourceNames::forCampaign(
                    $customerId,
                    self::PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
                'location' => new LocationInfo([
                    'geo_target_constant' => ResourceNames::forGeoTargetConstant(1022762)
                ]),
                'negative' => true
            ])
        ])
    ]);

    // Sets the LANGUAGE campaign criterion.
    $operations[] = new MutateOperation([
        'campaign_criterion_operation' => new CampaignCriterionOperation([
            'create' => new CampaignCriterion([
                'campaign' => ResourceNames::forCampaign(
                    $customerId,
                    self::PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
                // Set the language.
                // For a list of all language codes, see:
                // https://developers.google.com/google-ads/api/reference/data/codes-formats#expandable-7
                'language' => new LanguageInfo([
                    'language_constant' => ResourceNames::forLanguageConstant(1000)  // English
                ])
            ])
        ])
    ]);

    return $operations;
}