یک کمپین Performance Max ایجاد کنید

با داشتن دارایی‌ها و بودجه‌ی پیش‌نیاز، اکنون می‌توان کمپین را ایجاد کرد.

کمپین‌های Performance Max دارای AdvertisingChannelType با PERFORMANCE_MAX هستند. هیچ AdvertisingChannelSubType نباید تنظیم شود.

تنها استراتژی‌های پیشنهاد قیمت پشتیبانی‌شده عبارتند از:

استراتژی‌های پیشنهاد قیمت سبد سرمایه‌گذاری که با استفاده از سرویس BiddingStrategyService ایجاد می‌شوند، توسط کمپین‌های Performance Max پشتیبانی نمی‌شوند. به جای ایجاد چندین کمپین در یک استراتژی پیشنهاد قیمت سبد سرمایه‌گذاری، از کمپین‌های کمتر و گروه‌های دارایی بیشتری استفاده کنید.

جاوا

/** Creates a MutateOperation that creates a new Performance Max campaign. */
private MutateOperation createPerformanceMaxCampaignOperation(
    long customerId, boolean brandGuidelinesEnabled) {
  Campaign performanceMaxCampaign =
      Campaign.newBuilder()
          .setName("Performance Max campaign #" + getPrintableDateTime())
          // Sets the campaign status as PAUSED. The campaign is the only entity in
          // the mutate request that should have its status set.
          .setStatus(CampaignStatus.PAUSED)
          // All Performance Max campaigns have an advertising_channel_type of
          // PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
          .setAdvertisingChannelType(AdvertisingChannelType.PERFORMANCE_MAX)
          // Bidding strategy must be set directly on the campaign.
          // Setting a portfolio bidding strategy by resource name is not supported.
          // Max Conversion and Maximize Conversion Value are the only strategies
          // supported for Performance Max campaigns.
          // An optional ROAS (Return on Advertising Spend) can be set for
          // maximize_conversion_value. The ROAS value must be specified as a ratio in
          // the API. It is calculated by dividing "total value" by "total spend".
          // For more information on Maximize Conversion Value, see the support
          // article: http://support.google.com/google-ads/answer/7684216.
          // A targetRoas of 3.5 corresponds to a 350% return on ad spend.
          .setMaximizeConversionValue(
              MaximizeConversionValue.newBuilder().setTargetRoas(3.5).build())
          // Sets if the campaign is enabled for brand guidelines. For more information on brand
          // guidelines, see https://support.google.com/google-ads/answer/14934472.
          .setBrandGuidelinesEnabled(brandGuidelinesEnabled)
          // Assigns the resource name with a temporary ID.
          .setResourceName(
              ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID))
          // Sets the budget using the given budget resource name.
          .setCampaignBudget(ResourceNames.campaignBudget(customerId, BUDGET_TEMPORARY_ID))
          // Declares whether this campaign serves political ads targeting the EU.
          .setContainsEuPoliticalAdvertising(DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING)
          // Optional fields.
          .setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd"))
          .setEndDate(new DateTime().plusDays(365).toString("yyyyMMdd"))
          // Configures the optional opt-in/out status for asset automation settings.
          .addAllAssetAutomationSettings(ImmutableList.of(
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_IMAGE_EXTRACTION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(
                      AssetAutomationType.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.TEXT_ASSET_AUTOMATION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_ENHANCED_YOUTUBE_VIDEOS)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_IMAGE_ENHANCEMENT)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build()))
          .build();

  return MutateOperation.newBuilder()
      .setCampaignOperation(
          CampaignOperation.newBuilder().setCreate(performanceMaxCampaign).build())
      .build();
}

      

سی شارپ

/// Creates a MutateOperation that creates a new Performance Max campaign.
/// <param name="campaignResourceName">The campaign resource name.</param>
/// <param name="campaignBudgetResourceName">The campaign budget resource name.</param>
/// <param name="brandGuidelinesEnabled">Whether or not to enable brand guidelines.</param>
/// <returns>A MutateOperations that will create this new campaign.</returns>
private MutateOperation CreatePerformanceMaxCampaignOperation(
    string campaignResourceName,
    string campaignBudgetResourceName,
    bool brandGuidelinesEnabled)
{
    Campaign campaign = new Campaign()
    {
        Name = "Performance Max campaign #" + ExampleUtilities.GetRandomString(),

        // Set the campaign status as PAUSED. The campaign is the only entity in
        // the mutate request that should have its status set.
        Status = CampaignStatus.Paused,

        // All Performance Max campaigns have an AdvertisingChannelType of
        // PerformanceMax. The AdvertisingChannelSubType should not be set.
        AdvertisingChannelType = AdvertisingChannelType.PerformanceMax,

        // Bidding strategy must be set directly on the campaign. Setting a
        // portfolio bidding strategy by resource name is not supported. Max
        // Conversion and Maximize Conversion Value are the only strategies
        // supported for Performance Max campaigns. BiddingStrategyType is
        // read-only and cannot be set by the API. An optional ROAS (Return on
        // Advertising Spend) can be set to enable the MaximizeConversionValue
        // bidding strategy. The ROAS value must be specified as a ratio in the API.
        // It is calculated by dividing "total value" by "total spend".
        //
        // For more information on Maximize Conversion Value, see the support
        // article:
        // http://support.google.com/google-ads/answer/7684216.
        //
        // A target_roas of 3.5 corresponds to a 350% return on ad spend.
        MaximizeConversionValue = new MaximizeConversionValue()
        {
            TargetRoas = 3.5
        },

        // Use the temporary resource name created earlier
        ResourceName = campaignResourceName,

        // Set the budget using the given budget resource name.
        CampaignBudget = campaignBudgetResourceName,

        // Set if the campaign is enabled for brand guidelines. For more information
        // on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
        BrandGuidelinesEnabled = brandGuidelinesEnabled,

        // Declare whether or not this campaign contains political ads targeting the EU.
        ContainsEuPoliticalAdvertising = EuPoliticalAdvertisingStatus.DoesNotContainEuPoliticalAdvertising,

        // Optional fields
        StartDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"),
        EndDate = DateTime.Now.AddDays(365).ToString("yyyyMMdd")
    };

    campaign.AssetAutomationSettings.AddRange(new[]{
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateImageExtraction,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.FinalUrlExpansionTextAssetAutomation,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.TextAssetAutomation,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateEnhancedYoutubeVideos,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateImageEnhancement,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
    });

    MutateOperation operation = new MutateOperation()
    {
        CampaignOperation = new CampaignOperation()
        {
            Create = campaign
        }
    };

    return operation;
}

      

پی اچ پی

private static function createPerformanceMaxCampaignOperation(
    int $customerId,
    bool $brandGuidelinesEnabled
): MutateOperation {
    // Creates a mutate operation that creates a campaign operation.
    return new MutateOperation([
        'campaign_operation' => new CampaignOperation([
            'create' => new Campaign([
                'name' => 'Performance Max campaign #' . Helper::getPrintableDatetime(),
                // Assigns the resource name with a temporary ID.
                'resource_name' => ResourceNames::forCampaign(
                    $customerId,
                    self::PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
                // Sets the budget using the given budget resource name.
                'campaign_budget' => ResourceNames::forCampaignBudget(
                    $customerId,
                    self::BUDGET_TEMPORARY_ID
                ),
                // The campaign is the only entity in the mutate request that should have its
                // status set.
                // Recommendation: Set the campaign to PAUSED when creating it to prevent
                // the ads from immediately serving.
                'status' => CampaignStatus::PAUSED,
                // All Performance Max campaigns have an advertising_channel_type of
                // PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
                'advertising_channel_type' => AdvertisingChannelType::PERFORMANCE_MAX,

                // Bidding strategy must be set directly on the campaign.
                // Setting a portfolio bidding strategy by resource name is not supported.
                // Max Conversion and Maximize Conversion Value are the only strategies
                // supported for Performance Max campaigns.
                // An optional ROAS (Return on Advertising Spend) can be set for
                // maximize_conversion_value. The ROAS value must be specified as a ratio in
                // the API. It is calculated by dividing "total value" by "total spend".
                // For more information on Maximize Conversion Value, see the support
                // article: http://support.google.com/google-ads/answer/7684216.
                // A target_roas of 3.5 corresponds to a 350% return on ad spend.
                'maximize_conversion_value' => new MaximizeConversionValue([
                    'target_roas' => 3.5
                ]),

                // Sets the Final URL expansion opt out. This flag is specific to
                // Performance Max campaigns. If opted out (true), only the final URLs in
                // the asset group or URLs specified in the advertiser's Google Merchant
                // Center or business data feeds are targeted.
                // If opted in (false), the entire domain will be targeted. For best
                // results, set this value to false to opt in and allow URL expansions. You
                // can optionally add exclusions to limit traffic to parts of your website.
                'url_expansion_opt_out' => false,

                // Sets if the campaign is enabled for brand guidelines. For more information
                // on brand guidelines, see
                // https://support.google.com/google-ads/answer/14934472.
                'brand_guidelines_enabled' => $brandGuidelinesEnabled,

                // Declare whether or not this campaign serves political ads targeting the EU.
                'contains_eu_political_advertising' =>
                    EuPoliticalAdvertisingStatus::DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING,

                // Optional fields.
                'start_date' => date('Ymd', strtotime('+1 day')),
                'end_date' => date('Ymd', strtotime('+365 days'))
            ])
        ])
    ]);
}
      

پایتون

def create_performance_max_campaign_operation(
    client: GoogleAdsClient,
    customer_id: str,
    brand_guidelines_enabled: bool,
) -> MutateOperation:
    """Creates a MutateOperation that creates a new Performance Max campaign.

    A temporary ID will be assigned to this campaign so that it can
    be referenced by other objects being created in the same Mutate request.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a client customer ID.
        brand_guidelines_enabled: a boolean value indicating if the campaign is
          enabled for brand guidelines.

    Returns:
        a MutateOperation that creates a campaign.
    """
    mutate_operation: MutateOperation = client.get_type("MutateOperation")
    campaign: Campaign = mutate_operation.campaign_operation.create
    campaign.name = f"Performance Max campaign #{uuid4()}"
    # Set the campaign status as PAUSED. The campaign is the only entity in
    # the mutate request that should have its status set.
    campaign.status = client.enums.CampaignStatusEnum.PAUSED
    # All Performance Max campaigns have an advertising_channel_type of
    # PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
    campaign.advertising_channel_type = (
        client.enums.AdvertisingChannelTypeEnum.PERFORMANCE_MAX
    )
    # Bidding strategy must be set directly on the campaign.
    # Setting a portfolio bidding strategy by resource name is not supported.
    # Max Conversion and Maximize Conversion Value are the only strategies
    # supported for Performance Max campaigns.
    # An optional ROAS (Return on Advertising Spend) can be set for
    # maximize_conversion_value. The ROAS value must be specified as a ratio in
    # the API. It is calculated by dividing "total value" by "total spend".
    # For more information on Maximize Conversion Value, see the support
    # article: http://support.google.com/google-ads/answer/7684216.
    # A target_roas of 3.5 corresponds to a 350% return on ad spend.
    campaign.bidding_strategy_type = (
        client.enums.BiddingStrategyTypeEnum.MAXIMIZE_CONVERSION_VALUE
    )
    campaign.maximize_conversion_value.target_roas = 3.5

    # Set if the campaign is enabled for brand guidelines. For more information
    # on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
    campaign.brand_guidelines_enabled = brand_guidelines_enabled

    # Assign the resource name with a temporary ID.
    campaign_service: CampaignServiceClient = client.get_service(
        "CampaignService"
    )
    campaign.resource_name = campaign_service.campaign_path(
        customer_id, _PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
    )
    # Set the budget using the given budget resource name.
    campaign.campaign_budget = campaign_service.campaign_budget_path(
        customer_id, _BUDGET_TEMPORARY_ID
    )

    # Declare whether or not this campaign serves political ads targeting the
    # EU. Valid values are:
    #   CONTAINS_EU_POLITICAL_ADVERTISING
    #   DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
    campaign.contains_eu_political_advertising = (
        client.enums.EuPoliticalAdvertisingStatusEnum.DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
    )

    # Optional fields
    campaign.start_date = (datetime.now() + timedelta(1)).strftime("%Y%m%d")
    campaign.end_date = (datetime.now() + timedelta(365)).strftime("%Y%m%d")

    # Configures the optional opt-in/out status for asset automation settings.
    for asset_automation_type_enum in [
        client.enums.AssetAutomationTypeEnum.GENERATE_IMAGE_EXTRACTION,
        client.enums.AssetAutomationTypeEnum.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
        client.enums.AssetAutomationTypeEnum.TEXT_ASSET_AUTOMATION,
        client.enums.AssetAutomationTypeEnum.GENERATE_ENHANCED_YOUTUBE_VIDEOS,
        client.enums.AssetAutomationTypeEnum.GENERATE_IMAGE_ENHANCEMENT
    ]:
        asset_automattion_setting: Campaign.AssetAutomationSetting = client.get_type("Campaign").AssetAutomationSetting()
        asset_automattion_setting.asset_automation_type = asset_automation_type_enum
        asset_automattion_setting.asset_automation_status = client.enums.AssetAutomationStatusEnum.OPTED_IN
        campaign.asset_automation_settings.append(asset_automattion_setting)

    return mutate_operation
      

روبی

# Creates a MutateOperation that creates a new Performance Max campaign.
#
# A temporary ID will be assigned to this campaign so that it can
# be referenced by other objects being created in the same Mutate request.
def create_performance_max_campaign_operation(
    client,
    customer_id,
    brand_guidelines_enabled)
  client.operation.mutate do |m|
    m.campaign_operation = client.operation.create_resource.campaign do |c|
      c.name = "Performance Max campaign #{SecureRandom.uuid}"
      # Set the campaign status as PAUSED. The campaign is the only entity in
      # the mutate request that should have its status set.
      c.status = :PAUSED
      # All Performance Max campaigns have an advertising_channel_type of
      # PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
      c.advertising_channel_type = :PERFORMANCE_MAX
      # Bidding strategy must be set directly on the campaign.
      # Setting a portfolio bidding strategy by resource name is not supported.
      # Max Conversion and Maximize Conversion Value are the only strategies
      # supported for Performance Max campaigns.
      # An optional ROAS (Return on Advertising Spend) can be set for
      # maximize_conversion_value. The ROAS value must be specified as a ratio in
      # the API. It is calculated by dividing "total value" by "total spend".
      # For more information on Maximize Conversion Value, see the support
      # article: http://support.google.com/google-ads/answer/7684216.
      # A target_roas of 3.5 corresponds to a 350% return on ad spend.
      c.bidding_strategy_type = :MAXIMIZE_CONVERSION_VALUE
      c.maximize_conversion_value = client.resource.maximize_conversion_value do |mcv|
        mcv.target_roas = 3.5
      end

      # Configures the optional opt-in/out status for asset automation settings.
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_IMAGE_EXTRACTION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :TEXT_ASSET_AUTOMATION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_ENHANCED_YOUTUBE_VIDEOS
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_IMAGE_ENHANCEMENT
        aas.asset_automation_status = :OPTED_IN
      end

      # Set if the campaign is enabled for brand guidelines. For more
      # information on brand guidelines, see
      # https://support.google.com/google-ads/answer/14934472.
      c.brand_guidelines_enabled = brand_guidelines_enabled

      # Assign the resource name with a temporary ID.
      c.resource_name = client.path.campaign(customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID)
      # Set the budget using the given budget resource name.
      c.campaign_budget = client.path.campaign_budget(customer_id, BUDGET_TEMPORARY_ID)

      # Declare whether or not this campaign serves political ads targeting the EU.
      # Valid values are CONTAINS_EU_POLITICAL_ADVERTISING and
      # DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING.
      c.contains_eu_political_advertising = :DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING

      # Optional fields
      c.start_date = DateTime.parse((Date.today + 1).to_s).strftime('%Y%m%d')
      c.end_date = DateTime.parse(Date.today.next_year.to_s).strftime('%Y%m%d')
    end
  end
end
      

پرل

sub create_performance_max_campaign_operation {
  my ($customer_id, $brand_guidelines_enabled) = @_;
  # Configures the optional opt-in/out status for asset automation settings.
  # When we create the campaign object, we set campaign->{assetAutomationSettings}
  # equal to $asset_automation_settings.
  my $asset_automation_settings = [];
  my $asset_automation_types    = [
    GENERATE_IMAGE_EXTRACTION, FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
    TEXT_ASSET_AUTOMATION,     GENERATE_ENHANCED_YOUTUBE_VIDEOS,
    GENERATE_IMAGE_ENHANCEMENT
  ];
  foreach my $asset_automation_type (@$asset_automation_types) {
    push @$asset_automation_settings,
      Google::Ads::GoogleAds::V22::Resources::AssetAutomationSetting->new({
        assetAutomationStatus => OPTED_IN,
        assetAutomationType   => $asset_automation_type
      });
  }

  # Create a mutate operation that creates a campaign operation.
  return
    Google::Ads::GoogleAds::V22::Services::GoogleAdsService::MutateOperation->
    new({
      campaignOperation =>
        Google::Ads::GoogleAds::V22::Services::CampaignService::CampaignOperation
        ->new({
          create => Google::Ads::GoogleAds::V22::Resources::Campaign->new({
              # Assign the resource name with a temporary ID.
              resourceName =>
                Google::Ads::GoogleAds::V22::Utils::ResourceNames::campaign(
                $customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
              name => "Performance Max campaign #" . uniqid(),
              # Set the budget using the given budget resource name.
              campaignBudget =>
                Google::Ads::GoogleAds::V22::Utils::ResourceNames::campaign_budget(
                $customer_id, BUDGET_TEMPORARY_ID
                ),
              # Set the campaign status as PAUSED. The campaign is the only entity in
              # the mutate request that should have its status set.
              status =>
                Google::Ads::GoogleAds::V22::Enums::CampaignStatusEnum::PAUSED,
              # All Performance Max campaigns have an advertisingChannelType of
              # PERFORMANCE_MAX. The advertisingChannelSubType should not be set.
              advertisingChannelType => PERFORMANCE_MAX,

              # Bidding strategy must be set directly on the campaign.
              # Setting a portfolio bidding strategy by resource name is not supported.
              # Max Conversion and Maximize Conversion Value are the only strategies
              # supported for Performance Max campaigns.
              # An optional ROAS (Return on Advertising Spend) can be set for
              # maximizeConversionValue. The ROAS value must be specified as a ratio in
              # the API. It is calculated by dividing "total value" by "total spend".
              # For more information on Maximize Conversion Value, see the support
              # article: http://support.google.com/google-ads/answer/7684216.
              # A targetRoas of 3.5 corresponds to a 350% return on ad spend.
              maximizeConversionValue =>
                Google::Ads::GoogleAds::V22::Common::MaximizeConversionValue->
                new({
                  targetRoas => 3.5
                }
                ),

              # Set if the campaign is enabled for brand guidelines. For more information
              # on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
              brandGuidelinesEnabled => $brand_guidelines_enabled,

              # Configures the optional opt-in/out status for asset automation settings.
              assetAutomationSettings => $asset_automation_settings,

              # Optional fields.
              startDate => strftime("%Y%m%d", localtime(time + 60 * 60 * 24)),
              endDate   =>
                strftime("%Y%m%d", localtime(time + 60 * 60 * 24 * 365)),

              # Declare whether or not this campaign serves political ads targeting the EU.
              # Valid values are CONTAINS_EU_POLITICAL_ADVERTISING and
              # DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING.
              containsEuPoliticalAdvertising =>
                DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
            })})});
}
      

توصیه‌های مناقصه

API گوگل ادز دو نوع پیشنهاد برای کمک به شما در بهینه‌سازی پیشنهاد قیمت کمپین Performance Max ارائه می‌دهد:

  • MAXIMIZE_CONVERSION_VALUE_OPT_IN توصیه می‌کند از استراتژی پیشنهاد قیمت حداکثرسازی ارزش تبدیل برای کمپین‌های خود استفاده کنید.
  • MAXIMIZE_CONVERSIONS_OPT_IN استفاده از استراتژی پیشنهاد قیمت برای کمپین‌های شما را توصیه می‌کند و مبلغ بودجه پیشنهادی را ارائه می‌دهد.

برای اطلاعات بیشتر در مورد استفاده از توصیه‌ها، به راهنمای امتیاز بهینه‌سازی و توصیه‌ها مراجعه کنید.

دستورالعمل‌های برند

دستورالعمل‌های برند، نحوه نمایش برند شما را در دارایی‌ها یا قالب‌های خودکار کمپین Performance Max شما کنترل می‌کنند. از API نسخه ۲۱ گوگل ادز، کمپین‌های Performance Max به طور خودکار دستورالعمل‌های برند را در تمام کمپین‌های جدید Performance Max برای فروش آنلاین یا تولید سرنخ (استاندارد) و Performance Max برای فروش آنلاین با فید محصول (خرده‌فروشی) فعال می‌کنند. اگر نمی‌خواهید دستورالعمل‌های برند را در کمپین‌های جدید خود فعال کنید، هنگام ایجاد کمپین جدید Performance Max، Campaign.brand_guidelines_enabled را روی false تنظیم کنید.

کمپین‌های Performance Max با فعال بودن دستورالعمل‌های برند، از دارایی‌های سطح کمپین برای انواع فیلد دارایی برند ( BUSINESS_NAME ، LOGO و LANDSCAPE_LOGO ) استفاده می‌کنند. شما باید دارایی‌های برند را با استفاده از CampaignAsset به کمپین پیوند دهید و کمپین باید موارد زیر را داشته باشد:

  • دقیقاً یک دارایی BUSINESS_NAME
  • حداقل یک دارایی LOGO و حداکثر چهار دارایی لوگوی اضافی اختیاری از نوع LOGO یا LANDSCAPE_LOGO

دستورالعمل‌های اختیاری رنگ و فونت برای کمپین را می‌توان با استفاده از فیلد Campaign.brand_guidelines تنظیم کرد:

  • main_color رنگ اصلی را تنظیم می‌کند. رنگ باید به صورت یک رشته کد هگز (مثلاً #00ff00) ارائه شود.
  • accent_color رنگ ثانویه را تنظیم می‌کند. این رنگ باید به صورت یک رشته کد هگز (مثلاً #00ff00) ارائه شود.
  • برای تنظیم فونت predefined_font_family استفاده کنید. مقدار باید یکی از فونت‌های گوگل زیر باشد (به حروف کوچک و بزرگ حساس است): Open Sans ، Roboto ، Montserrat ، Poppins ، Lato ، Oswald ، Playfair Display ، Roboto Slab .

مثال زیر نحوه ایجاد دارایی‌های BUSINESS_NAME و LOGO و اتصال آنها به کمپین در صورت فعال بودن دستورالعمل‌های برند یا به AssetGroup در صورت غیرفعال بودن دستورالعمل‌های برند را نشان می‌دهد. برای اطلاعات بیشتر در مورد گروه‌های دارایی، به راهنمای تنظیم گروه دارایی مراجعه کنید.

جاوا

/** Creates a list of MutateOperations that create linked brand assets. */
List<MutateOperation> createAndLinkBrandAssets(
    long customerId,
    boolean brandGuidelinesEnabled,
    String businessName,
    String logoUrl,
    String logoName)
    throws IOException {
  List<MutateOperation> mutateOperations = new ArrayList<>();

  // Creates the brand name text asset.
  String businessNameAssetResourceName = ResourceNames.asset(customerId, getNextTemporaryId());
  Asset businessNameAsset =
      Asset.newBuilder()
          .setResourceName(businessNameAssetResourceName)
          .setTextAsset(TextAsset.newBuilder().setText(businessName).build())
          .build();
  AssetOperation businessNameAssetOperation =
      AssetOperation.newBuilder().setCreate(businessNameAsset).build();
  mutateOperations.add(
      MutateOperation.newBuilder().setAssetOperation(businessNameAssetOperation).build());

  // Creates the logo image asset.
  String logoAssetResourceName = ResourceNames.asset(customerId, getNextTemporaryId());
  // Creates a media file.
  byte[] logoBytes = ByteStreams.toByteArray(new URL(logoUrl).openStream());
  Asset logoAsset =
      Asset.newBuilder()
          .setResourceName(logoAssetResourceName)
          .setImageAsset(ImageAsset.newBuilder().setData(ByteString.copyFrom(logoBytes)).build())
          // Provides a unique friendly name to identify your asset. When there is an existing
          // image asset with the same content but a different name, the new name will be dropped
          // silently.
          .setName(logoName)
          .build();
  AssetOperation logoImageAssetOperation =
      AssetOperation.newBuilder().setCreate(logoAsset).build();
  mutateOperations.add(
      MutateOperation.newBuilder().setAssetOperation(logoImageAssetOperation).build());

  if (brandGuidelinesEnabled) {
    // Creates CampaignAsset resources to link the Asset resources to the Campaign.
    mutateOperations.add(
        createCampaignAssetMutateOperation(
            customerId, AssetFieldType.BUSINESS_NAME, businessNameAssetResourceName));
    mutateOperations.add(
        createCampaignAssetMutateOperation(
            customerId, AssetFieldType.LOGO, logoAssetResourceName));
  } else {
    // Creates an AssetGroupAsset to link the Asset to the AssetGroup.
    mutateOperations.add(
        createAssetGroupAssetMutateOperation(
            AssetFieldType.BUSINESS_NAME,
            businessNameAssetResourceName,
            ResourceNames.assetGroup(customerId, ASSET_GROUP_TEMPORARY_ID)));
    mutateOperations.add(
        createAssetGroupAssetMutateOperation(
            AssetFieldType.LOGO,
            logoAssetResourceName,
            ResourceNames.assetGroup(customerId, ASSET_GROUP_TEMPORARY_ID)));
  }

  return mutateOperations;
}

/** Creates a MutateOperation to add an AssetGroupAsset. */
MutateOperation createAssetGroupAssetMutateOperation(
    AssetFieldType fieldType, String assetResourceName, String assetGroupResourceName) {
  AssetGroupAsset assetGroupAsset =
      AssetGroupAsset.newBuilder()
          .setFieldType(fieldType)
          .setAssetGroup(assetGroupResourceName)
          .setAsset(assetResourceName)
          .build();
  AssetGroupAssetOperation assetGroupAssetOperation =
      AssetGroupAssetOperation.newBuilder().setCreate(assetGroupAsset).build();
  return MutateOperation.newBuilder()
      .setAssetGroupAssetOperation(assetGroupAssetOperation)
      .build();
}

/** Creates a MutateOperation to add a CampaignAsset. */
MutateOperation createCampaignAssetMutateOperation(
    long customerId, AssetFieldType fieldType, String assetResourceName) {
  CampaignAsset campaignAsset =
      CampaignAsset.newBuilder()
          .setFieldType(fieldType)
          .setCampaign(ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID))
          .setAsset(assetResourceName)
          .build();
  CampaignAssetOperation campaignAssetOperation =
      CampaignAssetOperation.newBuilder().setCreate(campaignAsset).build();
  return MutateOperation.newBuilder().setCampaignAssetOperation(campaignAssetOperation).build();
}
      

سی شارپ

This example is not yet available in C#; you can take a look at the other languages.
    

پی اچ پی

This example is not yet available in PHP; you can take a look at the other languages.
    

پایتون

This example is not yet available in Python; you can take a look at the other languages.
    

روبی

This example is not yet available in Ruby; you can take a look at the other languages.
    

پرل

This example is not yet available in Perl; you can take a look at the other languages.
    

مهاجرت خودکار

از اول ژوئن ۲۰۲۵، ما به طور خودکار دستورالعمل‌های برند را برای کمپین‌های Performance Max که از دارایی‌های برند یکسان ( BUSINESS_NAME ، LOGO و LANDSCAPE_LOGO ) در تمام گروه‌های دارایی استفاده می‌کنند، فعال خواهیم کرد. تمام کمپین‌هایی که می‌توانند به طور خودکار منتقل شوند، تا ۳۰ اکتبر ۲۰۲۵ منتقل خواهند شد.

  • مهاجرت خودکار فقط برای کمپین‌هایی انجام می‌شود که از نام و لوگوی تجاری ثابتی در هر گروه دارایی استفاده می‌کنند. اگر کمپین شما در این دارایی‌ها تنوع داشته باشد، به طور خودکار منتقل نخواهد شد.
  • تمام کمپین‌های واجد شرایط Performance Max تحت یک شناسه مشتری به طور همزمان منتقل خواهند شد.
  • پس از مهاجرت، هر کمپین منتقل‌شده، مجموعه‌ای از دارایی‌های برند خود را خواهد داشت که با استفاده از CampaignAsset در سطح کمپین ذخیره می‌شوند.

با بررسی فیلد Campaign.brand_guidelines_enabled می‌توانید متوجه شوید که آیا یک کمپین منتقل شده است یا خیر.

مهاجرت دستی

کمپین‌هایی که واجد شرایط مهاجرت خودکار نیستند، برای فعال کردن دستورالعمل‌های برند، نیاز به مهاجرت دستی دارند.

Campaign.brand_guidelines_enabled نشان می‌دهد که آیا یک کمپین موجود برای دستورالعمل‌های برند فعال است یا خیر. برای فعال کردن دستی دستورالعمل‌های برند برای یک کمپین موجود، به جای به‌روزرسانی مستقیم فیلد brand_guidelines_enabled ، از CampaignService.EnablePMaxBrandGuidelines استفاده کنید، زیرا این فیلد تغییرناپذیر است. auto_populate_brand_assets روی true تنظیم کنید تا به طور خودکار کمپین را با دارایی‌های برند با عملکرد بالا پر کند. در غیر این صورت، باید دارایی‌ها را به صورت دستی در عملیات با brand_assets ارائه دهید. غیرفعال کردن دستورالعمل‌های برند برای یک کمپین پشتیبانی نمی‌شود.

،

با داشتن دارایی‌ها و بودجه‌ی پیش‌نیاز، اکنون می‌توان کمپین را ایجاد کرد.

کمپین‌های Performance Max دارای AdvertisingChannelType با PERFORMANCE_MAX هستند. هیچ AdvertisingChannelSubType نباید تنظیم شود.

تنها استراتژی‌های پیشنهاد قیمت پشتیبانی‌شده عبارتند از:

استراتژی‌های پیشنهاد قیمت سبد سرمایه‌گذاری که با استفاده از سرویس BiddingStrategyService ایجاد می‌شوند، توسط کمپین‌های Performance Max پشتیبانی نمی‌شوند. به جای ایجاد چندین کمپین در یک استراتژی پیشنهاد قیمت سبد سرمایه‌گذاری، از کمپین‌های کمتر و گروه‌های دارایی بیشتری استفاده کنید.

جاوا

/** Creates a MutateOperation that creates a new Performance Max campaign. */
private MutateOperation createPerformanceMaxCampaignOperation(
    long customerId, boolean brandGuidelinesEnabled) {
  Campaign performanceMaxCampaign =
      Campaign.newBuilder()
          .setName("Performance Max campaign #" + getPrintableDateTime())
          // Sets the campaign status as PAUSED. The campaign is the only entity in
          // the mutate request that should have its status set.
          .setStatus(CampaignStatus.PAUSED)
          // All Performance Max campaigns have an advertising_channel_type of
          // PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
          .setAdvertisingChannelType(AdvertisingChannelType.PERFORMANCE_MAX)
          // Bidding strategy must be set directly on the campaign.
          // Setting a portfolio bidding strategy by resource name is not supported.
          // Max Conversion and Maximize Conversion Value are the only strategies
          // supported for Performance Max campaigns.
          // An optional ROAS (Return on Advertising Spend) can be set for
          // maximize_conversion_value. The ROAS value must be specified as a ratio in
          // the API. It is calculated by dividing "total value" by "total spend".
          // For more information on Maximize Conversion Value, see the support
          // article: http://support.google.com/google-ads/answer/7684216.
          // A targetRoas of 3.5 corresponds to a 350% return on ad spend.
          .setMaximizeConversionValue(
              MaximizeConversionValue.newBuilder().setTargetRoas(3.5).build())
          // Sets if the campaign is enabled for brand guidelines. For more information on brand
          // guidelines, see https://support.google.com/google-ads/answer/14934472.
          .setBrandGuidelinesEnabled(brandGuidelinesEnabled)
          // Assigns the resource name with a temporary ID.
          .setResourceName(
              ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID))
          // Sets the budget using the given budget resource name.
          .setCampaignBudget(ResourceNames.campaignBudget(customerId, BUDGET_TEMPORARY_ID))
          // Declares whether this campaign serves political ads targeting the EU.
          .setContainsEuPoliticalAdvertising(DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING)
          // Optional fields.
          .setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd"))
          .setEndDate(new DateTime().plusDays(365).toString("yyyyMMdd"))
          // Configures the optional opt-in/out status for asset automation settings.
          .addAllAssetAutomationSettings(ImmutableList.of(
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_IMAGE_EXTRACTION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(
                      AssetAutomationType.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.TEXT_ASSET_AUTOMATION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_ENHANCED_YOUTUBE_VIDEOS)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_IMAGE_ENHANCEMENT)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build()))
          .build();

  return MutateOperation.newBuilder()
      .setCampaignOperation(
          CampaignOperation.newBuilder().setCreate(performanceMaxCampaign).build())
      .build();
}

      

سی شارپ

/// Creates a MutateOperation that creates a new Performance Max campaign.
/// <param name="campaignResourceName">The campaign resource name.</param>
/// <param name="campaignBudgetResourceName">The campaign budget resource name.</param>
/// <param name="brandGuidelinesEnabled">Whether or not to enable brand guidelines.</param>
/// <returns>A MutateOperations that will create this new campaign.</returns>
private MutateOperation CreatePerformanceMaxCampaignOperation(
    string campaignResourceName,
    string campaignBudgetResourceName,
    bool brandGuidelinesEnabled)
{
    Campaign campaign = new Campaign()
    {
        Name = "Performance Max campaign #" + ExampleUtilities.GetRandomString(),

        // Set the campaign status as PAUSED. The campaign is the only entity in
        // the mutate request that should have its status set.
        Status = CampaignStatus.Paused,

        // All Performance Max campaigns have an AdvertisingChannelType of
        // PerformanceMax. The AdvertisingChannelSubType should not be set.
        AdvertisingChannelType = AdvertisingChannelType.PerformanceMax,

        // Bidding strategy must be set directly on the campaign. Setting a
        // portfolio bidding strategy by resource name is not supported. Max
        // Conversion and Maximize Conversion Value are the only strategies
        // supported for Performance Max campaigns. BiddingStrategyType is
        // read-only and cannot be set by the API. An optional ROAS (Return on
        // Advertising Spend) can be set to enable the MaximizeConversionValue
        // bidding strategy. The ROAS value must be specified as a ratio in the API.
        // It is calculated by dividing "total value" by "total spend".
        //
        // For more information on Maximize Conversion Value, see the support
        // article:
        // http://support.google.com/google-ads/answer/7684216.
        //
        // A target_roas of 3.5 corresponds to a 350% return on ad spend.
        MaximizeConversionValue = new MaximizeConversionValue()
        {
            TargetRoas = 3.5
        },

        // Use the temporary resource name created earlier
        ResourceName = campaignResourceName,

        // Set the budget using the given budget resource name.
        CampaignBudget = campaignBudgetResourceName,

        // Set if the campaign is enabled for brand guidelines. For more information
        // on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
        BrandGuidelinesEnabled = brandGuidelinesEnabled,

        // Declare whether or not this campaign contains political ads targeting the EU.
        ContainsEuPoliticalAdvertising = EuPoliticalAdvertisingStatus.DoesNotContainEuPoliticalAdvertising,

        // Optional fields
        StartDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"),
        EndDate = DateTime.Now.AddDays(365).ToString("yyyyMMdd")
    };

    campaign.AssetAutomationSettings.AddRange(new[]{
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateImageExtraction,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.FinalUrlExpansionTextAssetAutomation,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.TextAssetAutomation,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateEnhancedYoutubeVideos,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateImageEnhancement,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
    });

    MutateOperation operation = new MutateOperation()
    {
        CampaignOperation = new CampaignOperation()
        {
            Create = campaign
        }
    };

    return operation;
}

      

پی اچ پی

private static function createPerformanceMaxCampaignOperation(
    int $customerId,
    bool $brandGuidelinesEnabled
): MutateOperation {
    // Creates a mutate operation that creates a campaign operation.
    return new MutateOperation([
        'campaign_operation' => new CampaignOperation([
            'create' => new Campaign([
                'name' => 'Performance Max campaign #' . Helper::getPrintableDatetime(),
                // Assigns the resource name with a temporary ID.
                'resource_name' => ResourceNames::forCampaign(
                    $customerId,
                    self::PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
                // Sets the budget using the given budget resource name.
                'campaign_budget' => ResourceNames::forCampaignBudget(
                    $customerId,
                    self::BUDGET_TEMPORARY_ID
                ),
                // The campaign is the only entity in the mutate request that should have its
                // status set.
                // Recommendation: Set the campaign to PAUSED when creating it to prevent
                // the ads from immediately serving.
                'status' => CampaignStatus::PAUSED,
                // All Performance Max campaigns have an advertising_channel_type of
                // PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
                'advertising_channel_type' => AdvertisingChannelType::PERFORMANCE_MAX,

                // Bidding strategy must be set directly on the campaign.
                // Setting a portfolio bidding strategy by resource name is not supported.
                // Max Conversion and Maximize Conversion Value are the only strategies
                // supported for Performance Max campaigns.
                // An optional ROAS (Return on Advertising Spend) can be set for
                // maximize_conversion_value. The ROAS value must be specified as a ratio in
                // the API. It is calculated by dividing "total value" by "total spend".
                // For more information on Maximize Conversion Value, see the support
                // article: http://support.google.com/google-ads/answer/7684216.
                // A target_roas of 3.5 corresponds to a 350% return on ad spend.
                'maximize_conversion_value' => new MaximizeConversionValue([
                    'target_roas' => 3.5
                ]),

                // Sets the Final URL expansion opt out. This flag is specific to
                // Performance Max campaigns. If opted out (true), only the final URLs in
                // the asset group or URLs specified in the advertiser's Google Merchant
                // Center or business data feeds are targeted.
                // If opted in (false), the entire domain will be targeted. For best
                // results, set this value to false to opt in and allow URL expansions. You
                // can optionally add exclusions to limit traffic to parts of your website.
                'url_expansion_opt_out' => false,

                // Sets if the campaign is enabled for brand guidelines. For more information
                // on brand guidelines, see
                // https://support.google.com/google-ads/answer/14934472.
                'brand_guidelines_enabled' => $brandGuidelinesEnabled,

                // Declare whether or not this campaign serves political ads targeting the EU.
                'contains_eu_political_advertising' =>
                    EuPoliticalAdvertisingStatus::DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING,

                // Optional fields.
                'start_date' => date('Ymd', strtotime('+1 day')),
                'end_date' => date('Ymd', strtotime('+365 days'))
            ])
        ])
    ]);
}
      

پایتون

def create_performance_max_campaign_operation(
    client: GoogleAdsClient,
    customer_id: str,
    brand_guidelines_enabled: bool,
) -> MutateOperation:
    """Creates a MutateOperation that creates a new Performance Max campaign.

    A temporary ID will be assigned to this campaign so that it can
    be referenced by other objects being created in the same Mutate request.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a client customer ID.
        brand_guidelines_enabled: a boolean value indicating if the campaign is
          enabled for brand guidelines.

    Returns:
        a MutateOperation that creates a campaign.
    """
    mutate_operation: MutateOperation = client.get_type("MutateOperation")
    campaign: Campaign = mutate_operation.campaign_operation.create
    campaign.name = f"Performance Max campaign #{uuid4()}"
    # Set the campaign status as PAUSED. The campaign is the only entity in
    # the mutate request that should have its status set.
    campaign.status = client.enums.CampaignStatusEnum.PAUSED
    # All Performance Max campaigns have an advertising_channel_type of
    # PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
    campaign.advertising_channel_type = (
        client.enums.AdvertisingChannelTypeEnum.PERFORMANCE_MAX
    )
    # Bidding strategy must be set directly on the campaign.
    # Setting a portfolio bidding strategy by resource name is not supported.
    # Max Conversion and Maximize Conversion Value are the only strategies
    # supported for Performance Max campaigns.
    # An optional ROAS (Return on Advertising Spend) can be set for
    # maximize_conversion_value. The ROAS value must be specified as a ratio in
    # the API. It is calculated by dividing "total value" by "total spend".
    # For more information on Maximize Conversion Value, see the support
    # article: http://support.google.com/google-ads/answer/7684216.
    # A target_roas of 3.5 corresponds to a 350% return on ad spend.
    campaign.bidding_strategy_type = (
        client.enums.BiddingStrategyTypeEnum.MAXIMIZE_CONVERSION_VALUE
    )
    campaign.maximize_conversion_value.target_roas = 3.5

    # Set if the campaign is enabled for brand guidelines. For more information
    # on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
    campaign.brand_guidelines_enabled = brand_guidelines_enabled

    # Assign the resource name with a temporary ID.
    campaign_service: CampaignServiceClient = client.get_service(
        "CampaignService"
    )
    campaign.resource_name = campaign_service.campaign_path(
        customer_id, _PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
    )
    # Set the budget using the given budget resource name.
    campaign.campaign_budget = campaign_service.campaign_budget_path(
        customer_id, _BUDGET_TEMPORARY_ID
    )

    # Declare whether or not this campaign serves political ads targeting the
    # EU. Valid values are:
    #   CONTAINS_EU_POLITICAL_ADVERTISING
    #   DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
    campaign.contains_eu_political_advertising = (
        client.enums.EuPoliticalAdvertisingStatusEnum.DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
    )

    # Optional fields
    campaign.start_date = (datetime.now() + timedelta(1)).strftime("%Y%m%d")
    campaign.end_date = (datetime.now() + timedelta(365)).strftime("%Y%m%d")

    # Configures the optional opt-in/out status for asset automation settings.
    for asset_automation_type_enum in [
        client.enums.AssetAutomationTypeEnum.GENERATE_IMAGE_EXTRACTION,
        client.enums.AssetAutomationTypeEnum.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
        client.enums.AssetAutomationTypeEnum.TEXT_ASSET_AUTOMATION,
        client.enums.AssetAutomationTypeEnum.GENERATE_ENHANCED_YOUTUBE_VIDEOS,
        client.enums.AssetAutomationTypeEnum.GENERATE_IMAGE_ENHANCEMENT
    ]:
        asset_automattion_setting: Campaign.AssetAutomationSetting = client.get_type("Campaign").AssetAutomationSetting()
        asset_automattion_setting.asset_automation_type = asset_automation_type_enum
        asset_automattion_setting.asset_automation_status = client.enums.AssetAutomationStatusEnum.OPTED_IN
        campaign.asset_automation_settings.append(asset_automattion_setting)

    return mutate_operation
      

روبی

# Creates a MutateOperation that creates a new Performance Max campaign.
#
# A temporary ID will be assigned to this campaign so that it can
# be referenced by other objects being created in the same Mutate request.
def create_performance_max_campaign_operation(
    client,
    customer_id,
    brand_guidelines_enabled)
  client.operation.mutate do |m|
    m.campaign_operation = client.operation.create_resource.campaign do |c|
      c.name = "Performance Max campaign #{SecureRandom.uuid}"
      # Set the campaign status as PAUSED. The campaign is the only entity in
      # the mutate request that should have its status set.
      c.status = :PAUSED
      # All Performance Max campaigns have an advertising_channel_type of
      # PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
      c.advertising_channel_type = :PERFORMANCE_MAX
      # Bidding strategy must be set directly on the campaign.
      # Setting a portfolio bidding strategy by resource name is not supported.
      # Max Conversion and Maximize Conversion Value are the only strategies
      # supported for Performance Max campaigns.
      # An optional ROAS (Return on Advertising Spend) can be set for
      # maximize_conversion_value. The ROAS value must be specified as a ratio in
      # the API. It is calculated by dividing "total value" by "total spend".
      # For more information on Maximize Conversion Value, see the support
      # article: http://support.google.com/google-ads/answer/7684216.
      # A target_roas of 3.5 corresponds to a 350% return on ad spend.
      c.bidding_strategy_type = :MAXIMIZE_CONVERSION_VALUE
      c.maximize_conversion_value = client.resource.maximize_conversion_value do |mcv|
        mcv.target_roas = 3.5
      end

      # Configures the optional opt-in/out status for asset automation settings.
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_IMAGE_EXTRACTION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :TEXT_ASSET_AUTOMATION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_ENHANCED_YOUTUBE_VIDEOS
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_IMAGE_ENHANCEMENT
        aas.asset_automation_status = :OPTED_IN
      end

      # Set if the campaign is enabled for brand guidelines. For more
      # information on brand guidelines, see
      # https://support.google.com/google-ads/answer/14934472.
      c.brand_guidelines_enabled = brand_guidelines_enabled

      # Assign the resource name with a temporary ID.
      c.resource_name = client.path.campaign(customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID)
      # Set the budget using the given budget resource name.
      c.campaign_budget = client.path.campaign_budget(customer_id, BUDGET_TEMPORARY_ID)

      # Declare whether or not this campaign serves political ads targeting the EU.
      # Valid values are CONTAINS_EU_POLITICAL_ADVERTISING and
      # DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING.
      c.contains_eu_political_advertising = :DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING

      # Optional fields
      c.start_date = DateTime.parse((Date.today + 1).to_s).strftime('%Y%m%d')
      c.end_date = DateTime.parse(Date.today.next_year.to_s).strftime('%Y%m%d')
    end
  end
end
      

پرل

sub create_performance_max_campaign_operation {
  my ($customer_id, $brand_guidelines_enabled) = @_;
  # Configures the optional opt-in/out status for asset automation settings.
  # When we create the campaign object, we set campaign->{assetAutomationSettings}
  # equal to $asset_automation_settings.
  my $asset_automation_settings = [];
  my $asset_automation_types    = [
    GENERATE_IMAGE_EXTRACTION, FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
    TEXT_ASSET_AUTOMATION,     GENERATE_ENHANCED_YOUTUBE_VIDEOS,
    GENERATE_IMAGE_ENHANCEMENT
  ];
  foreach my $asset_automation_type (@$asset_automation_types) {
    push @$asset_automation_settings,
      Google::Ads::GoogleAds::V22::Resources::AssetAutomationSetting->new({
        assetAutomationStatus => OPTED_IN,
        assetAutomationType   => $asset_automation_type
      });
  }

  # Create a mutate operation that creates a campaign operation.
  return
    Google::Ads::GoogleAds::V22::Services::GoogleAdsService::MutateOperation->
    new({
      campaignOperation =>
        Google::Ads::GoogleAds::V22::Services::CampaignService::CampaignOperation
        ->new({
          create => Google::Ads::GoogleAds::V22::Resources::Campaign->new({
              # Assign the resource name with a temporary ID.
              resourceName =>
                Google::Ads::GoogleAds::V22::Utils::ResourceNames::campaign(
                $customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
              name => "Performance Max campaign #" . uniqid(),
              # Set the budget using the given budget resource name.
              campaignBudget =>
                Google::Ads::GoogleAds::V22::Utils::ResourceNames::campaign_budget(
                $customer_id, BUDGET_TEMPORARY_ID
                ),
              # Set the campaign status as PAUSED. The campaign is the only entity in
              # the mutate request that should have its status set.
              status =>
                Google::Ads::GoogleAds::V22::Enums::CampaignStatusEnum::PAUSED,
              # All Performance Max campaigns have an advertisingChannelType of
              # PERFORMANCE_MAX. The advertisingChannelSubType should not be set.
              advertisingChannelType => PERFORMANCE_MAX,

              # Bidding strategy must be set directly on the campaign.
              # Setting a portfolio bidding strategy by resource name is not supported.
              # Max Conversion and Maximize Conversion Value are the only strategies
              # supported for Performance Max campaigns.
              # An optional ROAS (Return on Advertising Spend) can be set for
              # maximizeConversionValue. The ROAS value must be specified as a ratio in
              # the API. It is calculated by dividing "total value" by "total spend".
              # For more information on Maximize Conversion Value, see the support
              # article: http://support.google.com/google-ads/answer/7684216.
              # A targetRoas of 3.5 corresponds to a 350% return on ad spend.
              maximizeConversionValue =>
                Google::Ads::GoogleAds::V22::Common::MaximizeConversionValue->
                new({
                  targetRoas => 3.5
                }
                ),

              # Set if the campaign is enabled for brand guidelines. For more information
              # on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
              brandGuidelinesEnabled => $brand_guidelines_enabled,

              # Configures the optional opt-in/out status for asset automation settings.
              assetAutomationSettings => $asset_automation_settings,

              # Optional fields.
              startDate => strftime("%Y%m%d", localtime(time + 60 * 60 * 24)),
              endDate   =>
                strftime("%Y%m%d", localtime(time + 60 * 60 * 24 * 365)),

              # Declare whether or not this campaign serves political ads targeting the EU.
              # Valid values are CONTAINS_EU_POLITICAL_ADVERTISING and
              # DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING.
              containsEuPoliticalAdvertising =>
                DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
            })})});
}
      

توصیه‌های مناقصه

API گوگل ادز دو نوع پیشنهاد برای کمک به شما در بهینه‌سازی پیشنهاد قیمت کمپین Performance Max ارائه می‌دهد:

  • MAXIMIZE_CONVERSION_VALUE_OPT_IN توصیه می‌کند از استراتژی پیشنهاد قیمت حداکثرسازی ارزش تبدیل برای کمپین‌های خود استفاده کنید.
  • MAXIMIZE_CONVERSIONS_OPT_IN استفاده از استراتژی پیشنهاد قیمت برای کمپین‌های شما را توصیه می‌کند و مبلغ بودجه پیشنهادی را ارائه می‌دهد.

برای اطلاعات بیشتر در مورد استفاده از توصیه‌ها، به راهنمای امتیاز بهینه‌سازی و توصیه‌ها مراجعه کنید.

دستورالعمل‌های برند

دستورالعمل‌های برند، نحوه نمایش برند شما را در دارایی‌ها یا قالب‌های خودکار کمپین Performance Max شما کنترل می‌کنند. از API نسخه ۲۱ گوگل ادز، کمپین‌های Performance Max به طور خودکار دستورالعمل‌های برند را در تمام کمپین‌های جدید Performance Max برای فروش آنلاین یا تولید سرنخ (استاندارد) و Performance Max برای فروش آنلاین با فید محصول (خرده‌فروشی) فعال می‌کنند. اگر نمی‌خواهید دستورالعمل‌های برند را در کمپین‌های جدید خود فعال کنید، هنگام ایجاد کمپین جدید Performance Max، Campaign.brand_guidelines_enabled را روی false تنظیم کنید.

کمپین‌های Performance Max با فعال بودن دستورالعمل‌های برند، از دارایی‌های سطح کمپین برای انواع فیلد دارایی برند ( BUSINESS_NAME ، LOGO و LANDSCAPE_LOGO ) استفاده می‌کنند. شما باید دارایی‌های برند را با استفاده از CampaignAsset به کمپین پیوند دهید و کمپین باید موارد زیر را داشته باشد:

  • دقیقاً یک دارایی BUSINESS_NAME
  • حداقل یک دارایی LOGO و حداکثر چهار دارایی لوگوی اضافی اختیاری از نوع LOGO یا LANDSCAPE_LOGO

دستورالعمل‌های اختیاری رنگ و فونت برای کمپین را می‌توان با استفاده از فیلد Campaign.brand_guidelines تنظیم کرد:

  • main_color رنگ اصلی را تنظیم می‌کند. رنگ باید به صورت یک رشته کد هگز (مثلاً #00ff00) ارائه شود.
  • accent_color رنگ ثانویه را تنظیم می‌کند. این رنگ باید به صورت یک رشته کد هگز (مثلاً #00ff00) ارائه شود.
  • برای تنظیم فونت predefined_font_family استفاده کنید. مقدار باید یکی از فونت‌های گوگل زیر باشد (به حروف کوچک و بزرگ حساس است): Open Sans ، Roboto ، Montserrat ، Poppins ، Lato ، Oswald ، Playfair Display ، Roboto Slab .

مثال زیر نحوه ایجاد دارایی‌های BUSINESS_NAME و LOGO و اتصال آنها به کمپین در صورت فعال بودن دستورالعمل‌های برند یا به AssetGroup در صورت غیرفعال بودن دستورالعمل‌های برند را نشان می‌دهد. برای اطلاعات بیشتر در مورد گروه‌های دارایی، به راهنمای تنظیم گروه دارایی مراجعه کنید.

جاوا

/** Creates a list of MutateOperations that create linked brand assets. */
List<MutateOperation> createAndLinkBrandAssets(
    long customerId,
    boolean brandGuidelinesEnabled,
    String businessName,
    String logoUrl,
    String logoName)
    throws IOException {
  List<MutateOperation> mutateOperations = new ArrayList<>();

  // Creates the brand name text asset.
  String businessNameAssetResourceName = ResourceNames.asset(customerId, getNextTemporaryId());
  Asset businessNameAsset =
      Asset.newBuilder()
          .setResourceName(businessNameAssetResourceName)
          .setTextAsset(TextAsset.newBuilder().setText(businessName).build())
          .build();
  AssetOperation businessNameAssetOperation =
      AssetOperation.newBuilder().setCreate(businessNameAsset).build();
  mutateOperations.add(
      MutateOperation.newBuilder().setAssetOperation(businessNameAssetOperation).build());

  // Creates the logo image asset.
  String logoAssetResourceName = ResourceNames.asset(customerId, getNextTemporaryId());
  // Creates a media file.
  byte[] logoBytes = ByteStreams.toByteArray(new URL(logoUrl).openStream());
  Asset logoAsset =
      Asset.newBuilder()
          .setResourceName(logoAssetResourceName)
          .setImageAsset(ImageAsset.newBuilder().setData(ByteString.copyFrom(logoBytes)).build())
          // Provides a unique friendly name to identify your asset. When there is an existing
          // image asset with the same content but a different name, the new name will be dropped
          // silently.
          .setName(logoName)
          .build();
  AssetOperation logoImageAssetOperation =
      AssetOperation.newBuilder().setCreate(logoAsset).build();
  mutateOperations.add(
      MutateOperation.newBuilder().setAssetOperation(logoImageAssetOperation).build());

  if (brandGuidelinesEnabled) {
    // Creates CampaignAsset resources to link the Asset resources to the Campaign.
    mutateOperations.add(
        createCampaignAssetMutateOperation(
            customerId, AssetFieldType.BUSINESS_NAME, businessNameAssetResourceName));
    mutateOperations.add(
        createCampaignAssetMutateOperation(
            customerId, AssetFieldType.LOGO, logoAssetResourceName));
  } else {
    // Creates an AssetGroupAsset to link the Asset to the AssetGroup.
    mutateOperations.add(
        createAssetGroupAssetMutateOperation(
            AssetFieldType.BUSINESS_NAME,
            businessNameAssetResourceName,
            ResourceNames.assetGroup(customerId, ASSET_GROUP_TEMPORARY_ID)));
    mutateOperations.add(
        createAssetGroupAssetMutateOperation(
            AssetFieldType.LOGO,
            logoAssetResourceName,
            ResourceNames.assetGroup(customerId, ASSET_GROUP_TEMPORARY_ID)));
  }

  return mutateOperations;
}

/** Creates a MutateOperation to add an AssetGroupAsset. */
MutateOperation createAssetGroupAssetMutateOperation(
    AssetFieldType fieldType, String assetResourceName, String assetGroupResourceName) {
  AssetGroupAsset assetGroupAsset =
      AssetGroupAsset.newBuilder()
          .setFieldType(fieldType)
          .setAssetGroup(assetGroupResourceName)
          .setAsset(assetResourceName)
          .build();
  AssetGroupAssetOperation assetGroupAssetOperation =
      AssetGroupAssetOperation.newBuilder().setCreate(assetGroupAsset).build();
  return MutateOperation.newBuilder()
      .setAssetGroupAssetOperation(assetGroupAssetOperation)
      .build();
}

/** Creates a MutateOperation to add a CampaignAsset. */
MutateOperation createCampaignAssetMutateOperation(
    long customerId, AssetFieldType fieldType, String assetResourceName) {
  CampaignAsset campaignAsset =
      CampaignAsset.newBuilder()
          .setFieldType(fieldType)
          .setCampaign(ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID))
          .setAsset(assetResourceName)
          .build();
  CampaignAssetOperation campaignAssetOperation =
      CampaignAssetOperation.newBuilder().setCreate(campaignAsset).build();
  return MutateOperation.newBuilder().setCampaignAssetOperation(campaignAssetOperation).build();
}
      

سی شارپ

This example is not yet available in C#; you can take a look at the other languages.
    

پی اچ پی

This example is not yet available in PHP; you can take a look at the other languages.
    

پایتون

This example is not yet available in Python; you can take a look at the other languages.
    

روبی

This example is not yet available in Ruby; you can take a look at the other languages.
    

پرل

This example is not yet available in Perl; you can take a look at the other languages.
    

مهاجرت خودکار

از اول ژوئن ۲۰۲۵، ما به طور خودکار دستورالعمل‌های برند را برای کمپین‌های Performance Max که از دارایی‌های برند یکسان ( BUSINESS_NAME ، LOGO و LANDSCAPE_LOGO ) در تمام گروه‌های دارایی استفاده می‌کنند، فعال خواهیم کرد. تمام کمپین‌هایی که می‌توانند به طور خودکار منتقل شوند، تا ۳۰ اکتبر ۲۰۲۵ منتقل خواهند شد.

  • مهاجرت خودکار فقط برای کمپین‌هایی انجام می‌شود که از نام و لوگوی تجاری ثابتی در هر گروه دارایی استفاده می‌کنند. اگر کمپین شما در این دارایی‌ها تنوع داشته باشد، به طور خودکار منتقل نخواهد شد.
  • تمام کمپین‌های واجد شرایط Performance Max تحت یک شناسه مشتری به طور همزمان منتقل خواهند شد.
  • پس از مهاجرت، هر کمپین منتقل‌شده، مجموعه‌ای از دارایی‌های برند خود را خواهد داشت که با استفاده از CampaignAsset در سطح کمپین ذخیره می‌شوند.

با بررسی فیلد Campaign.brand_guidelines_enabled می‌توانید متوجه شوید که آیا یک کمپین منتقل شده است یا خیر.

مهاجرت دستی

کمپین‌هایی که واجد شرایط مهاجرت خودکار نیستند، برای فعال کردن دستورالعمل‌های برند، نیاز به مهاجرت دستی دارند.

Campaign.brand_guidelines_enabled نشان می‌دهد که آیا یک کمپین موجود برای دستورالعمل‌های برند فعال است یا خیر. برای فعال کردن دستی دستورالعمل‌های برند برای یک کمپین موجود، به جای به‌روزرسانی مستقیم فیلد brand_guidelines_enabled ، از CampaignService.EnablePMaxBrandGuidelines استفاده کنید، زیرا این فیلد تغییرناپذیر است. auto_populate_brand_assets روی true تنظیم کنید تا به طور خودکار کمپین را با دارایی‌های برند با عملکرد بالا پر کند. در غیر این صورت، باید دارایی‌ها را به صورت دستی در عملیات با brand_assets ارائه دهید. غیرفعال کردن دستورالعمل‌های برند برای یک کمپین پشتیبانی نمی‌شود.

،

با داشتن دارایی‌ها و بودجه‌ی پیش‌نیاز، اکنون می‌توان کمپین را ایجاد کرد.

کمپین‌های Performance Max دارای AdvertisingChannelType با PERFORMANCE_MAX هستند. هیچ AdvertisingChannelSubType نباید تنظیم شود.

تنها استراتژی‌های پیشنهاد قیمت پشتیبانی‌شده عبارتند از:

استراتژی‌های پیشنهاد قیمت سبد سرمایه‌گذاری که با استفاده از سرویس BiddingStrategyService ایجاد می‌شوند، توسط کمپین‌های Performance Max پشتیبانی نمی‌شوند. به جای ایجاد چندین کمپین در یک استراتژی پیشنهاد قیمت سبد سرمایه‌گذاری، از کمپین‌های کمتر و گروه‌های دارایی بیشتری استفاده کنید.

جاوا

/** Creates a MutateOperation that creates a new Performance Max campaign. */
private MutateOperation createPerformanceMaxCampaignOperation(
    long customerId, boolean brandGuidelinesEnabled) {
  Campaign performanceMaxCampaign =
      Campaign.newBuilder()
          .setName("Performance Max campaign #" + getPrintableDateTime())
          // Sets the campaign status as PAUSED. The campaign is the only entity in
          // the mutate request that should have its status set.
          .setStatus(CampaignStatus.PAUSED)
          // All Performance Max campaigns have an advertising_channel_type of
          // PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
          .setAdvertisingChannelType(AdvertisingChannelType.PERFORMANCE_MAX)
          // Bidding strategy must be set directly on the campaign.
          // Setting a portfolio bidding strategy by resource name is not supported.
          // Max Conversion and Maximize Conversion Value are the only strategies
          // supported for Performance Max campaigns.
          // An optional ROAS (Return on Advertising Spend) can be set for
          // maximize_conversion_value. The ROAS value must be specified as a ratio in
          // the API. It is calculated by dividing "total value" by "total spend".
          // For more information on Maximize Conversion Value, see the support
          // article: http://support.google.com/google-ads/answer/7684216.
          // A targetRoas of 3.5 corresponds to a 350% return on ad spend.
          .setMaximizeConversionValue(
              MaximizeConversionValue.newBuilder().setTargetRoas(3.5).build())
          // Sets if the campaign is enabled for brand guidelines. For more information on brand
          // guidelines, see https://support.google.com/google-ads/answer/14934472.
          .setBrandGuidelinesEnabled(brandGuidelinesEnabled)
          // Assigns the resource name with a temporary ID.
          .setResourceName(
              ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID))
          // Sets the budget using the given budget resource name.
          .setCampaignBudget(ResourceNames.campaignBudget(customerId, BUDGET_TEMPORARY_ID))
          // Declares whether this campaign serves political ads targeting the EU.
          .setContainsEuPoliticalAdvertising(DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING)
          // Optional fields.
          .setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd"))
          .setEndDate(new DateTime().plusDays(365).toString("yyyyMMdd"))
          // Configures the optional opt-in/out status for asset automation settings.
          .addAllAssetAutomationSettings(ImmutableList.of(
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_IMAGE_EXTRACTION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(
                      AssetAutomationType.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.TEXT_ASSET_AUTOMATION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_ENHANCED_YOUTUBE_VIDEOS)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_IMAGE_ENHANCEMENT)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build()))
          .build();

  return MutateOperation.newBuilder()
      .setCampaignOperation(
          CampaignOperation.newBuilder().setCreate(performanceMaxCampaign).build())
      .build();
}

      

سی شارپ

/// Creates a MutateOperation that creates a new Performance Max campaign.
/// <param name="campaignResourceName">The campaign resource name.</param>
/// <param name="campaignBudgetResourceName">The campaign budget resource name.</param>
/// <param name="brandGuidelinesEnabled">Whether or not to enable brand guidelines.</param>
/// <returns>A MutateOperations that will create this new campaign.</returns>
private MutateOperation CreatePerformanceMaxCampaignOperation(
    string campaignResourceName,
    string campaignBudgetResourceName,
    bool brandGuidelinesEnabled)
{
    Campaign campaign = new Campaign()
    {
        Name = "Performance Max campaign #" + ExampleUtilities.GetRandomString(),

        // Set the campaign status as PAUSED. The campaign is the only entity in
        // the mutate request that should have its status set.
        Status = CampaignStatus.Paused,

        // All Performance Max campaigns have an AdvertisingChannelType of
        // PerformanceMax. The AdvertisingChannelSubType should not be set.
        AdvertisingChannelType = AdvertisingChannelType.PerformanceMax,

        // Bidding strategy must be set directly on the campaign. Setting a
        // portfolio bidding strategy by resource name is not supported. Max
        // Conversion and Maximize Conversion Value are the only strategies
        // supported for Performance Max campaigns. BiddingStrategyType is
        // read-only and cannot be set by the API. An optional ROAS (Return on
        // Advertising Spend) can be set to enable the MaximizeConversionValue
        // bidding strategy. The ROAS value must be specified as a ratio in the API.
        // It is calculated by dividing "total value" by "total spend".
        //
        // For more information on Maximize Conversion Value, see the support
        // article:
        // http://support.google.com/google-ads/answer/7684216.
        //
        // A target_roas of 3.5 corresponds to a 350% return on ad spend.
        MaximizeConversionValue = new MaximizeConversionValue()
        {
            TargetRoas = 3.5
        },

        // Use the temporary resource name created earlier
        ResourceName = campaignResourceName,

        // Set the budget using the given budget resource name.
        CampaignBudget = campaignBudgetResourceName,

        // Set if the campaign is enabled for brand guidelines. For more information
        // on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
        BrandGuidelinesEnabled = brandGuidelinesEnabled,

        // Declare whether or not this campaign contains political ads targeting the EU.
        ContainsEuPoliticalAdvertising = EuPoliticalAdvertisingStatus.DoesNotContainEuPoliticalAdvertising,

        // Optional fields
        StartDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"),
        EndDate = DateTime.Now.AddDays(365).ToString("yyyyMMdd")
    };

    campaign.AssetAutomationSettings.AddRange(new[]{
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateImageExtraction,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.FinalUrlExpansionTextAssetAutomation,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.TextAssetAutomation,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateEnhancedYoutubeVideos,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateImageEnhancement,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
    });

    MutateOperation operation = new MutateOperation()
    {
        CampaignOperation = new CampaignOperation()
        {
            Create = campaign
        }
    };

    return operation;
}

      

پی اچ پی

private static function createPerformanceMaxCampaignOperation(
    int $customerId,
    bool $brandGuidelinesEnabled
): MutateOperation {
    // Creates a mutate operation that creates a campaign operation.
    return new MutateOperation([
        'campaign_operation' => new CampaignOperation([
            'create' => new Campaign([
                'name' => 'Performance Max campaign #' . Helper::getPrintableDatetime(),
                // Assigns the resource name with a temporary ID.
                'resource_name' => ResourceNames::forCampaign(
                    $customerId,
                    self::PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
                // Sets the budget using the given budget resource name.
                'campaign_budget' => ResourceNames::forCampaignBudget(
                    $customerId,
                    self::BUDGET_TEMPORARY_ID
                ),
                // The campaign is the only entity in the mutate request that should have its
                // status set.
                // Recommendation: Set the campaign to PAUSED when creating it to prevent
                // the ads from immediately serving.
                'status' => CampaignStatus::PAUSED,
                // All Performance Max campaigns have an advertising_channel_type of
                // PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
                'advertising_channel_type' => AdvertisingChannelType::PERFORMANCE_MAX,

                // Bidding strategy must be set directly on the campaign.
                // Setting a portfolio bidding strategy by resource name is not supported.
                // Max Conversion and Maximize Conversion Value are the only strategies
                // supported for Performance Max campaigns.
                // An optional ROAS (Return on Advertising Spend) can be set for
                // maximize_conversion_value. The ROAS value must be specified as a ratio in
                // the API. It is calculated by dividing "total value" by "total spend".
                // For more information on Maximize Conversion Value, see the support
                // article: http://support.google.com/google-ads/answer/7684216.
                // A target_roas of 3.5 corresponds to a 350% return on ad spend.
                'maximize_conversion_value' => new MaximizeConversionValue([
                    'target_roas' => 3.5
                ]),

                // Sets the Final URL expansion opt out. This flag is specific to
                // Performance Max campaigns. If opted out (true), only the final URLs in
                // the asset group or URLs specified in the advertiser's Google Merchant
                // Center or business data feeds are targeted.
                // If opted in (false), the entire domain will be targeted. For best
                // results, set this value to false to opt in and allow URL expansions. You
                // can optionally add exclusions to limit traffic to parts of your website.
                'url_expansion_opt_out' => false,

                // Sets if the campaign is enabled for brand guidelines. For more information
                // on brand guidelines, see
                // https://support.google.com/google-ads/answer/14934472.
                'brand_guidelines_enabled' => $brandGuidelinesEnabled,

                // Declare whether or not this campaign serves political ads targeting the EU.
                'contains_eu_political_advertising' =>
                    EuPoliticalAdvertisingStatus::DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING,

                // Optional fields.
                'start_date' => date('Ymd', strtotime('+1 day')),
                'end_date' => date('Ymd', strtotime('+365 days'))
            ])
        ])
    ]);
}
      

پایتون

def create_performance_max_campaign_operation(
    client: GoogleAdsClient,
    customer_id: str,
    brand_guidelines_enabled: bool,
) -> MutateOperation:
    """Creates a MutateOperation that creates a new Performance Max campaign.

    A temporary ID will be assigned to this campaign so that it can
    be referenced by other objects being created in the same Mutate request.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a client customer ID.
        brand_guidelines_enabled: a boolean value indicating if the campaign is
          enabled for brand guidelines.

    Returns:
        a MutateOperation that creates a campaign.
    """
    mutate_operation: MutateOperation = client.get_type("MutateOperation")
    campaign: Campaign = mutate_operation.campaign_operation.create
    campaign.name = f"Performance Max campaign #{uuid4()}"
    # Set the campaign status as PAUSED. The campaign is the only entity in
    # the mutate request that should have its status set.
    campaign.status = client.enums.CampaignStatusEnum.PAUSED
    # All Performance Max campaigns have an advertising_channel_type of
    # PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
    campaign.advertising_channel_type = (
        client.enums.AdvertisingChannelTypeEnum.PERFORMANCE_MAX
    )
    # Bidding strategy must be set directly on the campaign.
    # Setting a portfolio bidding strategy by resource name is not supported.
    # Max Conversion and Maximize Conversion Value are the only strategies
    # supported for Performance Max campaigns.
    # An optional ROAS (Return on Advertising Spend) can be set for
    # maximize_conversion_value. The ROAS value must be specified as a ratio in
    # the API. It is calculated by dividing "total value" by "total spend".
    # For more information on Maximize Conversion Value, see the support
    # article: http://support.google.com/google-ads/answer/7684216.
    # A target_roas of 3.5 corresponds to a 350% return on ad spend.
    campaign.bidding_strategy_type = (
        client.enums.BiddingStrategyTypeEnum.MAXIMIZE_CONVERSION_VALUE
    )
    campaign.maximize_conversion_value.target_roas = 3.5

    # Set if the campaign is enabled for brand guidelines. For more information
    # on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
    campaign.brand_guidelines_enabled = brand_guidelines_enabled

    # Assign the resource name with a temporary ID.
    campaign_service: CampaignServiceClient = client.get_service(
        "CampaignService"
    )
    campaign.resource_name = campaign_service.campaign_path(
        customer_id, _PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
    )
    # Set the budget using the given budget resource name.
    campaign.campaign_budget = campaign_service.campaign_budget_path(
        customer_id, _BUDGET_TEMPORARY_ID
    )

    # Declare whether or not this campaign serves political ads targeting the
    # EU. Valid values are:
    #   CONTAINS_EU_POLITICAL_ADVERTISING
    #   DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
    campaign.contains_eu_political_advertising = (
        client.enums.EuPoliticalAdvertisingStatusEnum.DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
    )

    # Optional fields
    campaign.start_date = (datetime.now() + timedelta(1)).strftime("%Y%m%d")
    campaign.end_date = (datetime.now() + timedelta(365)).strftime("%Y%m%d")

    # Configures the optional opt-in/out status for asset automation settings.
    for asset_automation_type_enum in [
        client.enums.AssetAutomationTypeEnum.GENERATE_IMAGE_EXTRACTION,
        client.enums.AssetAutomationTypeEnum.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
        client.enums.AssetAutomationTypeEnum.TEXT_ASSET_AUTOMATION,
        client.enums.AssetAutomationTypeEnum.GENERATE_ENHANCED_YOUTUBE_VIDEOS,
        client.enums.AssetAutomationTypeEnum.GENERATE_IMAGE_ENHANCEMENT
    ]:
        asset_automattion_setting: Campaign.AssetAutomationSetting = client.get_type("Campaign").AssetAutomationSetting()
        asset_automattion_setting.asset_automation_type = asset_automation_type_enum
        asset_automattion_setting.asset_automation_status = client.enums.AssetAutomationStatusEnum.OPTED_IN
        campaign.asset_automation_settings.append(asset_automattion_setting)

    return mutate_operation
      

روبی

# Creates a MutateOperation that creates a new Performance Max campaign.
#
# A temporary ID will be assigned to this campaign so that it can
# be referenced by other objects being created in the same Mutate request.
def create_performance_max_campaign_operation(
    client,
    customer_id,
    brand_guidelines_enabled)
  client.operation.mutate do |m|
    m.campaign_operation = client.operation.create_resource.campaign do |c|
      c.name = "Performance Max campaign #{SecureRandom.uuid}"
      # Set the campaign status as PAUSED. The campaign is the only entity in
      # the mutate request that should have its status set.
      c.status = :PAUSED
      # All Performance Max campaigns have an advertising_channel_type of
      # PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
      c.advertising_channel_type = :PERFORMANCE_MAX
      # Bidding strategy must be set directly on the campaign.
      # Setting a portfolio bidding strategy by resource name is not supported.
      # Max Conversion and Maximize Conversion Value are the only strategies
      # supported for Performance Max campaigns.
      # An optional ROAS (Return on Advertising Spend) can be set for
      # maximize_conversion_value. The ROAS value must be specified as a ratio in
      # the API. It is calculated by dividing "total value" by "total spend".
      # For more information on Maximize Conversion Value, see the support
      # article: http://support.google.com/google-ads/answer/7684216.
      # A target_roas of 3.5 corresponds to a 350% return on ad spend.
      c.bidding_strategy_type = :MAXIMIZE_CONVERSION_VALUE
      c.maximize_conversion_value = client.resource.maximize_conversion_value do |mcv|
        mcv.target_roas = 3.5
      end

      # Configures the optional opt-in/out status for asset automation settings.
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_IMAGE_EXTRACTION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :TEXT_ASSET_AUTOMATION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_ENHANCED_YOUTUBE_VIDEOS
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_IMAGE_ENHANCEMENT
        aas.asset_automation_status = :OPTED_IN
      end

      # Set if the campaign is enabled for brand guidelines. For more
      # information on brand guidelines, see
      # https://support.google.com/google-ads/answer/14934472.
      c.brand_guidelines_enabled = brand_guidelines_enabled

      # Assign the resource name with a temporary ID.
      c.resource_name = client.path.campaign(customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID)
      # Set the budget using the given budget resource name.
      c.campaign_budget = client.path.campaign_budget(customer_id, BUDGET_TEMPORARY_ID)

      # Declare whether or not this campaign serves political ads targeting the EU.
      # Valid values are CONTAINS_EU_POLITICAL_ADVERTISING and
      # DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING.
      c.contains_eu_political_advertising = :DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING

      # Optional fields
      c.start_date = DateTime.parse((Date.today + 1).to_s).strftime('%Y%m%d')
      c.end_date = DateTime.parse(Date.today.next_year.to_s).strftime('%Y%m%d')
    end
  end
end
      

پرل

sub create_performance_max_campaign_operation {
  my ($customer_id, $brand_guidelines_enabled) = @_;
  # Configures the optional opt-in/out status for asset automation settings.
  # When we create the campaign object, we set campaign->{assetAutomationSettings}
  # equal to $asset_automation_settings.
  my $asset_automation_settings = [];
  my $asset_automation_types    = [
    GENERATE_IMAGE_EXTRACTION, FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
    TEXT_ASSET_AUTOMATION,     GENERATE_ENHANCED_YOUTUBE_VIDEOS,
    GENERATE_IMAGE_ENHANCEMENT
  ];
  foreach my $asset_automation_type (@$asset_automation_types) {
    push @$asset_automation_settings,
      Google::Ads::GoogleAds::V22::Resources::AssetAutomationSetting->new({
        assetAutomationStatus => OPTED_IN,
        assetAutomationType   => $asset_automation_type
      });
  }

  # Create a mutate operation that creates a campaign operation.
  return
    Google::Ads::GoogleAds::V22::Services::GoogleAdsService::MutateOperation->
    new({
      campaignOperation =>
        Google::Ads::GoogleAds::V22::Services::CampaignService::CampaignOperation
        ->new({
          create => Google::Ads::GoogleAds::V22::Resources::Campaign->new({
              # Assign the resource name with a temporary ID.
              resourceName =>
                Google::Ads::GoogleAds::V22::Utils::ResourceNames::campaign(
                $customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
              name => "Performance Max campaign #" . uniqid(),
              # Set the budget using the given budget resource name.
              campaignBudget =>
                Google::Ads::GoogleAds::V22::Utils::ResourceNames::campaign_budget(
                $customer_id, BUDGET_TEMPORARY_ID
                ),
              # Set the campaign status as PAUSED. The campaign is the only entity in
              # the mutate request that should have its status set.
              status =>
                Google::Ads::GoogleAds::V22::Enums::CampaignStatusEnum::PAUSED,
              # All Performance Max campaigns have an advertisingChannelType of
              # PERFORMANCE_MAX. The advertisingChannelSubType should not be set.
              advertisingChannelType => PERFORMANCE_MAX,

              # Bidding strategy must be set directly on the campaign.
              # Setting a portfolio bidding strategy by resource name is not supported.
              # Max Conversion and Maximize Conversion Value are the only strategies
              # supported for Performance Max campaigns.
              # An optional ROAS (Return on Advertising Spend) can be set for
              # maximizeConversionValue. The ROAS value must be specified as a ratio in
              # the API. It is calculated by dividing "total value" by "total spend".
              # For more information on Maximize Conversion Value, see the support
              # article: http://support.google.com/google-ads/answer/7684216.
              # A targetRoas of 3.5 corresponds to a 350% return on ad spend.
              maximizeConversionValue =>
                Google::Ads::GoogleAds::V22::Common::MaximizeConversionValue->
                new({
                  targetRoas => 3.5
                }
                ),

              # Set if the campaign is enabled for brand guidelines. For more information
              # on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
              brandGuidelinesEnabled => $brand_guidelines_enabled,

              # Configures the optional opt-in/out status for asset automation settings.
              assetAutomationSettings => $asset_automation_settings,

              # Optional fields.
              startDate => strftime("%Y%m%d", localtime(time + 60 * 60 * 24)),
              endDate   =>
                strftime("%Y%m%d", localtime(time + 60 * 60 * 24 * 365)),

              # Declare whether or not this campaign serves political ads targeting the EU.
              # Valid values are CONTAINS_EU_POLITICAL_ADVERTISING and
              # DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING.
              containsEuPoliticalAdvertising =>
                DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
            })})});
}
      

توصیه‌های مناقصه

API گوگل ادز دو نوع پیشنهاد برای کمک به شما در بهینه‌سازی پیشنهاد قیمت کمپین Performance Max ارائه می‌دهد:

  • MAXIMIZE_CONVERSION_VALUE_OPT_IN توصیه می‌کند از استراتژی پیشنهاد قیمت حداکثرسازی ارزش تبدیل برای کمپین‌های خود استفاده کنید.
  • MAXIMIZE_CONVERSIONS_OPT_IN استفاده از استراتژی پیشنهاد قیمت برای کمپین‌های شما را توصیه می‌کند و مبلغ بودجه پیشنهادی را ارائه می‌دهد.

برای اطلاعات بیشتر در مورد استفاده از توصیه‌ها، به راهنمای امتیاز بهینه‌سازی و توصیه‌ها مراجعه کنید.

دستورالعمل‌های برند

دستورالعمل‌های برند، نحوه نمایش برند شما را در دارایی‌ها یا قالب‌های خودکار کمپین Performance Max شما کنترل می‌کنند. از API نسخه ۲۱ گوگل ادز، کمپین‌های Performance Max به طور خودکار دستورالعمل‌های برند را در تمام کمپین‌های جدید Performance Max برای فروش آنلاین یا تولید سرنخ (استاندارد) و Performance Max برای فروش آنلاین با فید محصول (خرده‌فروشی) فعال می‌کنند. اگر نمی‌خواهید دستورالعمل‌های برند را در کمپین‌های جدید خود فعال کنید، هنگام ایجاد کمپین جدید Performance Max، Campaign.brand_guidelines_enabled را روی false تنظیم کنید.

کمپین‌های Performance Max با فعال بودن دستورالعمل‌های برند، از دارایی‌های سطح کمپین برای انواع فیلد دارایی برند ( BUSINESS_NAME ، LOGO و LANDSCAPE_LOGO ) استفاده می‌کنند. شما باید دارایی‌های برند را با استفاده از CampaignAsset به کمپین پیوند دهید و کمپین باید موارد زیر را داشته باشد:

  • دقیقاً یک دارایی BUSINESS_NAME
  • حداقل یک دارایی LOGO و حداکثر چهار دارایی لوگوی اضافی اختیاری از نوع LOGO یا LANDSCAPE_LOGO

دستورالعمل‌های اختیاری رنگ و فونت برای کمپین را می‌توان با استفاده از فیلد Campaign.brand_guidelines تنظیم کرد:

  • main_color رنگ اصلی را تنظیم می‌کند. رنگ باید به صورت یک رشته کد هگز (مثلاً #00ff00) ارائه شود.
  • accent_color رنگ ثانویه را تنظیم می‌کند. این رنگ باید به صورت یک رشته کد هگز (مثلاً #00ff00) ارائه شود.
  • برای تنظیم فونت predefined_font_family استفاده کنید. مقدار باید یکی از فونت‌های گوگل زیر باشد (به حروف کوچک و بزرگ حساس است): Open Sans ، Roboto ، Montserrat ، Poppins ، Lato ، Oswald ، Playfair Display ، Roboto Slab .

مثال زیر نحوه ایجاد دارایی‌های BUSINESS_NAME و LOGO و اتصال آنها به کمپین در صورت فعال بودن دستورالعمل‌های برند یا به AssetGroup در صورت غیرفعال بودن دستورالعمل‌های برند را نشان می‌دهد. برای اطلاعات بیشتر در مورد گروه‌های دارایی، به راهنمای تنظیم گروه دارایی مراجعه کنید.

جاوا

/** Creates a list of MutateOperations that create linked brand assets. */
List<MutateOperation> createAndLinkBrandAssets(
    long customerId,
    boolean brandGuidelinesEnabled,
    String businessName,
    String logoUrl,
    String logoName)
    throws IOException {
  List<MutateOperation> mutateOperations = new ArrayList<>();

  // Creates the brand name text asset.
  String businessNameAssetResourceName = ResourceNames.asset(customerId, getNextTemporaryId());
  Asset businessNameAsset =
      Asset.newBuilder()
          .setResourceName(businessNameAssetResourceName)
          .setTextAsset(TextAsset.newBuilder().setText(businessName).build())
          .build();
  AssetOperation businessNameAssetOperation =
      AssetOperation.newBuilder().setCreate(businessNameAsset).build();
  mutateOperations.add(
      MutateOperation.newBuilder().setAssetOperation(businessNameAssetOperation).build());

  // Creates the logo image asset.
  String logoAssetResourceName = ResourceNames.asset(customerId, getNextTemporaryId());
  // Creates a media file.
  byte[] logoBytes = ByteStreams.toByteArray(new URL(logoUrl).openStream());
  Asset logoAsset =
      Asset.newBuilder()
          .setResourceName(logoAssetResourceName)
          .setImageAsset(ImageAsset.newBuilder().setData(ByteString.copyFrom(logoBytes)).build())
          // Provides a unique friendly name to identify your asset. When there is an existing
          // image asset with the same content but a different name, the new name will be dropped
          // silently.
          .setName(logoName)
          .build();
  AssetOperation logoImageAssetOperation =
      AssetOperation.newBuilder().setCreate(logoAsset).build();
  mutateOperations.add(
      MutateOperation.newBuilder().setAssetOperation(logoImageAssetOperation).build());

  if (brandGuidelinesEnabled) {
    // Creates CampaignAsset resources to link the Asset resources to the Campaign.
    mutateOperations.add(
        createCampaignAssetMutateOperation(
            customerId, AssetFieldType.BUSINESS_NAME, businessNameAssetResourceName));
    mutateOperations.add(
        createCampaignAssetMutateOperation(
            customerId, AssetFieldType.LOGO, logoAssetResourceName));
  } else {
    // Creates an AssetGroupAsset to link the Asset to the AssetGroup.
    mutateOperations.add(
        createAssetGroupAssetMutateOperation(
            AssetFieldType.BUSINESS_NAME,
            businessNameAssetResourceName,
            ResourceNames.assetGroup(customerId, ASSET_GROUP_TEMPORARY_ID)));
    mutateOperations.add(
        createAssetGroupAssetMutateOperation(
            AssetFieldType.LOGO,
            logoAssetResourceName,
            ResourceNames.assetGroup(customerId, ASSET_GROUP_TEMPORARY_ID)));
  }

  return mutateOperations;
}

/** Creates a MutateOperation to add an AssetGroupAsset. */
MutateOperation createAssetGroupAssetMutateOperation(
    AssetFieldType fieldType, String assetResourceName, String assetGroupResourceName) {
  AssetGroupAsset assetGroupAsset =
      AssetGroupAsset.newBuilder()
          .setFieldType(fieldType)
          .setAssetGroup(assetGroupResourceName)
          .setAsset(assetResourceName)
          .build();
  AssetGroupAssetOperation assetGroupAssetOperation =
      AssetGroupAssetOperation.newBuilder().setCreate(assetGroupAsset).build();
  return MutateOperation.newBuilder()
      .setAssetGroupAssetOperation(assetGroupAssetOperation)
      .build();
}

/** Creates a MutateOperation to add a CampaignAsset. */
MutateOperation createCampaignAssetMutateOperation(
    long customerId, AssetFieldType fieldType, String assetResourceName) {
  CampaignAsset campaignAsset =
      CampaignAsset.newBuilder()
          .setFieldType(fieldType)
          .setCampaign(ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID))
          .setAsset(assetResourceName)
          .build();
  CampaignAssetOperation campaignAssetOperation =
      CampaignAssetOperation.newBuilder().setCreate(campaignAsset).build();
  return MutateOperation.newBuilder().setCampaignAssetOperation(campaignAssetOperation).build();
}
      

سی شارپ

This example is not yet available in C#; you can take a look at the other languages.
    

پی اچ پی

This example is not yet available in PHP; you can take a look at the other languages.
    

پایتون

This example is not yet available in Python; you can take a look at the other languages.
    

روبی

This example is not yet available in Ruby; you can take a look at the other languages.
    

پرل

This example is not yet available in Perl; you can take a look at the other languages.
    

مهاجرت خودکار

از اول ژوئن ۲۰۲۵، ما به طور خودکار دستورالعمل‌های برند را برای کمپین‌های Performance Max که از دارایی‌های برند یکسان ( BUSINESS_NAME ، LOGO و LANDSCAPE_LOGO ) در تمام گروه‌های دارایی استفاده می‌کنند، فعال خواهیم کرد. تمام کمپین‌هایی که می‌توانند به طور خودکار منتقل شوند، تا ۳۰ اکتبر ۲۰۲۵ منتقل خواهند شد.

  • مهاجرت خودکار فقط برای کمپین‌هایی انجام می‌شود که از نام و لوگوی تجاری ثابتی در هر گروه دارایی استفاده می‌کنند. اگر کمپین شما در این دارایی‌ها تنوع داشته باشد، به طور خودکار منتقل نخواهد شد.
  • تمام کمپین‌های واجد شرایط Performance Max تحت یک شناسه مشتری به طور همزمان منتقل خواهند شد.
  • پس از مهاجرت، هر کمپین منتقل‌شده، مجموعه‌ای از دارایی‌های برند خود را خواهد داشت که با استفاده از CampaignAsset در سطح کمپین ذخیره می‌شوند.

با بررسی فیلد Campaign.brand_guidelines_enabled می‌توانید متوجه شوید که آیا یک کمپین منتقل شده است یا خیر.

مهاجرت دستی

کمپین‌هایی که واجد شرایط مهاجرت خودکار نیستند، برای فعال کردن دستورالعمل‌های برند، نیاز به مهاجرت دستی دارند.

Campaign.brand_guidelines_enabled نشان می‌دهد که آیا یک کمپین موجود برای دستورالعمل‌های برند فعال است یا خیر. برای فعال کردن دستی دستورالعمل‌های برند برای یک کمپین موجود، به جای به‌روزرسانی مستقیم فیلد brand_guidelines_enabled ، از CampaignService.EnablePMaxBrandGuidelines استفاده کنید، زیرا این فیلد تغییرناپذیر است. auto_populate_brand_assets روی true تنظیم کنید تا به طور خودکار کمپین را با دارایی‌های برند با عملکرد بالا پر کند. در غیر این صورت، باید دارایی‌ها را به صورت دستی در عملیات با brand_assets ارائه دهید. غیرفعال کردن دستورالعمل‌های برند برای یک کمپین پشتیبانی نمی‌شود.

،

با داشتن دارایی‌ها و بودجه‌ی پیش‌نیاز، اکنون می‌توان کمپین را ایجاد کرد.

کمپین‌های Performance Max دارای AdvertisingChannelType با PERFORMANCE_MAX هستند. هیچ AdvertisingChannelSubType نباید تنظیم شود.

تنها استراتژی‌های پیشنهاد قیمت پشتیبانی‌شده عبارتند از:

استراتژی‌های پیشنهاد قیمت سبد سرمایه‌گذاری که با استفاده از سرویس BiddingStrategyService ایجاد می‌شوند، توسط کمپین‌های Performance Max پشتیبانی نمی‌شوند. به جای ایجاد چندین کمپین در یک استراتژی پیشنهاد قیمت سبد سرمایه‌گذاری، از کمپین‌های کمتر و گروه‌های دارایی بیشتری استفاده کنید.

جاوا

/** Creates a MutateOperation that creates a new Performance Max campaign. */
private MutateOperation createPerformanceMaxCampaignOperation(
    long customerId, boolean brandGuidelinesEnabled) {
  Campaign performanceMaxCampaign =
      Campaign.newBuilder()
          .setName("Performance Max campaign #" + getPrintableDateTime())
          // Sets the campaign status as PAUSED. The campaign is the only entity in
          // the mutate request that should have its status set.
          .setStatus(CampaignStatus.PAUSED)
          // All Performance Max campaigns have an advertising_channel_type of
          // PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
          .setAdvertisingChannelType(AdvertisingChannelType.PERFORMANCE_MAX)
          // Bidding strategy must be set directly on the campaign.
          // Setting a portfolio bidding strategy by resource name is not supported.
          // Max Conversion and Maximize Conversion Value are the only strategies
          // supported for Performance Max campaigns.
          // An optional ROAS (Return on Advertising Spend) can be set for
          // maximize_conversion_value. The ROAS value must be specified as a ratio in
          // the API. It is calculated by dividing "total value" by "total spend".
          // For more information on Maximize Conversion Value, see the support
          // article: http://support.google.com/google-ads/answer/7684216.
          // A targetRoas of 3.5 corresponds to a 350% return on ad spend.
          .setMaximizeConversionValue(
              MaximizeConversionValue.newBuilder().setTargetRoas(3.5).build())
          // Sets if the campaign is enabled for brand guidelines. For more information on brand
          // guidelines, see https://support.google.com/google-ads/answer/14934472.
          .setBrandGuidelinesEnabled(brandGuidelinesEnabled)
          // Assigns the resource name with a temporary ID.
          .setResourceName(
              ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID))
          // Sets the budget using the given budget resource name.
          .setCampaignBudget(ResourceNames.campaignBudget(customerId, BUDGET_TEMPORARY_ID))
          // Declares whether this campaign serves political ads targeting the EU.
          .setContainsEuPoliticalAdvertising(DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING)
          // Optional fields.
          .setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd"))
          .setEndDate(new DateTime().plusDays(365).toString("yyyyMMdd"))
          // Configures the optional opt-in/out status for asset automation settings.
          .addAllAssetAutomationSettings(ImmutableList.of(
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_IMAGE_EXTRACTION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(
                      AssetAutomationType.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.TEXT_ASSET_AUTOMATION)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_ENHANCED_YOUTUBE_VIDEOS)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
              AssetAutomationSetting.newBuilder()
                  .setAssetAutomationType(AssetAutomationType.GENERATE_IMAGE_ENHANCEMENT)
                  .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build()))
          .build();

  return MutateOperation.newBuilder()
      .setCampaignOperation(
          CampaignOperation.newBuilder().setCreate(performanceMaxCampaign).build())
      .build();
}

      

سی شارپ

/// Creates a MutateOperation that creates a new Performance Max campaign.
/// <param name="campaignResourceName">The campaign resource name.</param>
/// <param name="campaignBudgetResourceName">The campaign budget resource name.</param>
/// <param name="brandGuidelinesEnabled">Whether or not to enable brand guidelines.</param>
/// <returns>A MutateOperations that will create this new campaign.</returns>
private MutateOperation CreatePerformanceMaxCampaignOperation(
    string campaignResourceName,
    string campaignBudgetResourceName,
    bool brandGuidelinesEnabled)
{
    Campaign campaign = new Campaign()
    {
        Name = "Performance Max campaign #" + ExampleUtilities.GetRandomString(),

        // Set the campaign status as PAUSED. The campaign is the only entity in
        // the mutate request that should have its status set.
        Status = CampaignStatus.Paused,

        // All Performance Max campaigns have an AdvertisingChannelType of
        // PerformanceMax. The AdvertisingChannelSubType should not be set.
        AdvertisingChannelType = AdvertisingChannelType.PerformanceMax,

        // Bidding strategy must be set directly on the campaign. Setting a
        // portfolio bidding strategy by resource name is not supported. Max
        // Conversion and Maximize Conversion Value are the only strategies
        // supported for Performance Max campaigns. BiddingStrategyType is
        // read-only and cannot be set by the API. An optional ROAS (Return on
        // Advertising Spend) can be set to enable the MaximizeConversionValue
        // bidding strategy. The ROAS value must be specified as a ratio in the API.
        // It is calculated by dividing "total value" by "total spend".
        //
        // For more information on Maximize Conversion Value, see the support
        // article:
        // http://support.google.com/google-ads/answer/7684216.
        //
        // A target_roas of 3.5 corresponds to a 350% return on ad spend.
        MaximizeConversionValue = new MaximizeConversionValue()
        {
            TargetRoas = 3.5
        },

        // Use the temporary resource name created earlier
        ResourceName = campaignResourceName,

        // Set the budget using the given budget resource name.
        CampaignBudget = campaignBudgetResourceName,

        // Set if the campaign is enabled for brand guidelines. For more information
        // on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
        BrandGuidelinesEnabled = brandGuidelinesEnabled,

        // Declare whether or not this campaign contains political ads targeting the EU.
        ContainsEuPoliticalAdvertising = EuPoliticalAdvertisingStatus.DoesNotContainEuPoliticalAdvertising,

        // Optional fields
        StartDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"),
        EndDate = DateTime.Now.AddDays(365).ToString("yyyyMMdd")
    };

    campaign.AssetAutomationSettings.AddRange(new[]{
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateImageExtraction,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.FinalUrlExpansionTextAssetAutomation,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.TextAssetAutomation,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateEnhancedYoutubeVideos,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
        new Campaign.Types.AssetAutomationSetting
        {
            AssetAutomationType = AssetAutomationType.GenerateImageEnhancement,
            AssetAutomationStatus = AssetAutomationStatus.OptedIn
        },
    });

    MutateOperation operation = new MutateOperation()
    {
        CampaignOperation = new CampaignOperation()
        {
            Create = campaign
        }
    };

    return operation;
}

      

پی اچ پی

private static function createPerformanceMaxCampaignOperation(
    int $customerId,
    bool $brandGuidelinesEnabled
): MutateOperation {
    // Creates a mutate operation that creates a campaign operation.
    return new MutateOperation([
        'campaign_operation' => new CampaignOperation([
            'create' => new Campaign([
                'name' => 'Performance Max campaign #' . Helper::getPrintableDatetime(),
                // Assigns the resource name with a temporary ID.
                'resource_name' => ResourceNames::forCampaign(
                    $customerId,
                    self::PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
                // Sets the budget using the given budget resource name.
                'campaign_budget' => ResourceNames::forCampaignBudget(
                    $customerId,
                    self::BUDGET_TEMPORARY_ID
                ),
                // The campaign is the only entity in the mutate request that should have its
                // status set.
                // Recommendation: Set the campaign to PAUSED when creating it to prevent
                // the ads from immediately serving.
                'status' => CampaignStatus::PAUSED,
                // All Performance Max campaigns have an advertising_channel_type of
                // PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
                'advertising_channel_type' => AdvertisingChannelType::PERFORMANCE_MAX,

                // Bidding strategy must be set directly on the campaign.
                // Setting a portfolio bidding strategy by resource name is not supported.
                // Max Conversion and Maximize Conversion Value are the only strategies
                // supported for Performance Max campaigns.
                // An optional ROAS (Return on Advertising Spend) can be set for
                // maximize_conversion_value. The ROAS value must be specified as a ratio in
                // the API. It is calculated by dividing "total value" by "total spend".
                // For more information on Maximize Conversion Value, see the support
                // article: http://support.google.com/google-ads/answer/7684216.
                // A target_roas of 3.5 corresponds to a 350% return on ad spend.
                'maximize_conversion_value' => new MaximizeConversionValue([
                    'target_roas' => 3.5
                ]),

                // Sets the Final URL expansion opt out. This flag is specific to
                // Performance Max campaigns. If opted out (true), only the final URLs in
                // the asset group or URLs specified in the advertiser's Google Merchant
                // Center or business data feeds are targeted.
                // If opted in (false), the entire domain will be targeted. For best
                // results, set this value to false to opt in and allow URL expansions. You
                // can optionally add exclusions to limit traffic to parts of your website.
                'url_expansion_opt_out' => false,

                // Sets if the campaign is enabled for brand guidelines. For more information
                // on brand guidelines, see
                // https://support.google.com/google-ads/answer/14934472.
                'brand_guidelines_enabled' => $brandGuidelinesEnabled,

                // Declare whether or not this campaign serves political ads targeting the EU.
                'contains_eu_political_advertising' =>
                    EuPoliticalAdvertisingStatus::DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING,

                // Optional fields.
                'start_date' => date('Ymd', strtotime('+1 day')),
                'end_date' => date('Ymd', strtotime('+365 days'))
            ])
        ])
    ]);
}
      

پایتون

def create_performance_max_campaign_operation(
    client: GoogleAdsClient,
    customer_id: str,
    brand_guidelines_enabled: bool,
) -> MutateOperation:
    """Creates a MutateOperation that creates a new Performance Max campaign.

    A temporary ID will be assigned to this campaign so that it can
    be referenced by other objects being created in the same Mutate request.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a client customer ID.
        brand_guidelines_enabled: a boolean value indicating if the campaign is
          enabled for brand guidelines.

    Returns:
        a MutateOperation that creates a campaign.
    """
    mutate_operation: MutateOperation = client.get_type("MutateOperation")
    campaign: Campaign = mutate_operation.campaign_operation.create
    campaign.name = f"Performance Max campaign #{uuid4()}"
    # Set the campaign status as PAUSED. The campaign is the only entity in
    # the mutate request that should have its status set.
    campaign.status = client.enums.CampaignStatusEnum.PAUSED
    # All Performance Max campaigns have an advertising_channel_type of
    # PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
    campaign.advertising_channel_type = (
        client.enums.AdvertisingChannelTypeEnum.PERFORMANCE_MAX
    )
    # Bidding strategy must be set directly on the campaign.
    # Setting a portfolio bidding strategy by resource name is not supported.
    # Max Conversion and Maximize Conversion Value are the only strategies
    # supported for Performance Max campaigns.
    # An optional ROAS (Return on Advertising Spend) can be set for
    # maximize_conversion_value. The ROAS value must be specified as a ratio in
    # the API. It is calculated by dividing "total value" by "total spend".
    # For more information on Maximize Conversion Value, see the support
    # article: http://support.google.com/google-ads/answer/7684216.
    # A target_roas of 3.5 corresponds to a 350% return on ad spend.
    campaign.bidding_strategy_type = (
        client.enums.BiddingStrategyTypeEnum.MAXIMIZE_CONVERSION_VALUE
    )
    campaign.maximize_conversion_value.target_roas = 3.5

    # Set if the campaign is enabled for brand guidelines. For more information
    # on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
    campaign.brand_guidelines_enabled = brand_guidelines_enabled

    # Assign the resource name with a temporary ID.
    campaign_service: CampaignServiceClient = client.get_service(
        "CampaignService"
    )
    campaign.resource_name = campaign_service.campaign_path(
        customer_id, _PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
    )
    # Set the budget using the given budget resource name.
    campaign.campaign_budget = campaign_service.campaign_budget_path(
        customer_id, _BUDGET_TEMPORARY_ID
    )

    # Declare whether or not this campaign serves political ads targeting the
    # EU. Valid values are:
    #   CONTAINS_EU_POLITICAL_ADVERTISING
    #   DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
    campaign.contains_eu_political_advertising = (
        client.enums.EuPoliticalAdvertisingStatusEnum.DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
    )

    # Optional fields
    campaign.start_date = (datetime.now() + timedelta(1)).strftime("%Y%m%d")
    campaign.end_date = (datetime.now() + timedelta(365)).strftime("%Y%m%d")

    # Configures the optional opt-in/out status for asset automation settings.
    for asset_automation_type_enum in [
        client.enums.AssetAutomationTypeEnum.GENERATE_IMAGE_EXTRACTION,
        client.enums.AssetAutomationTypeEnum.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
        client.enums.AssetAutomationTypeEnum.TEXT_ASSET_AUTOMATION,
        client.enums.AssetAutomationTypeEnum.GENERATE_ENHANCED_YOUTUBE_VIDEOS,
        client.enums.AssetAutomationTypeEnum.GENERATE_IMAGE_ENHANCEMENT
    ]:
        asset_automattion_setting: Campaign.AssetAutomationSetting = client.get_type("Campaign").AssetAutomationSetting()
        asset_automattion_setting.asset_automation_type = asset_automation_type_enum
        asset_automattion_setting.asset_automation_status = client.enums.AssetAutomationStatusEnum.OPTED_IN
        campaign.asset_automation_settings.append(asset_automattion_setting)

    return mutate_operation
      

روبی

# Creates a MutateOperation that creates a new Performance Max campaign.
#
# A temporary ID will be assigned to this campaign so that it can
# be referenced by other objects being created in the same Mutate request.
def create_performance_max_campaign_operation(
    client,
    customer_id,
    brand_guidelines_enabled)
  client.operation.mutate do |m|
    m.campaign_operation = client.operation.create_resource.campaign do |c|
      c.name = "Performance Max campaign #{SecureRandom.uuid}"
      # Set the campaign status as PAUSED. The campaign is the only entity in
      # the mutate request that should have its status set.
      c.status = :PAUSED
      # All Performance Max campaigns have an advertising_channel_type of
      # PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
      c.advertising_channel_type = :PERFORMANCE_MAX
      # Bidding strategy must be set directly on the campaign.
      # Setting a portfolio bidding strategy by resource name is not supported.
      # Max Conversion and Maximize Conversion Value are the only strategies
      # supported for Performance Max campaigns.
      # An optional ROAS (Return on Advertising Spend) can be set for
      # maximize_conversion_value. The ROAS value must be specified as a ratio in
      # the API. It is calculated by dividing "total value" by "total spend".
      # For more information on Maximize Conversion Value, see the support
      # article: http://support.google.com/google-ads/answer/7684216.
      # A target_roas of 3.5 corresponds to a 350% return on ad spend.
      c.bidding_strategy_type = :MAXIMIZE_CONVERSION_VALUE
      c.maximize_conversion_value = client.resource.maximize_conversion_value do |mcv|
        mcv.target_roas = 3.5
      end

      # Configures the optional opt-in/out status for asset automation settings.
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_IMAGE_EXTRACTION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :TEXT_ASSET_AUTOMATION
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_ENHANCED_YOUTUBE_VIDEOS
        aas.asset_automation_status = :OPTED_IN
      end
      c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
        aas.asset_automation_type = :GENERATE_IMAGE_ENHANCEMENT
        aas.asset_automation_status = :OPTED_IN
      end

      # Set if the campaign is enabled for brand guidelines. For more
      # information on brand guidelines, see
      # https://support.google.com/google-ads/answer/14934472.
      c.brand_guidelines_enabled = brand_guidelines_enabled

      # Assign the resource name with a temporary ID.
      c.resource_name = client.path.campaign(customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID)
      # Set the budget using the given budget resource name.
      c.campaign_budget = client.path.campaign_budget(customer_id, BUDGET_TEMPORARY_ID)

      # Declare whether or not this campaign serves political ads targeting the EU.
      # Valid values are CONTAINS_EU_POLITICAL_ADVERTISING and
      # DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING.
      c.contains_eu_political_advertising = :DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING

      # Optional fields
      c.start_date = DateTime.parse((Date.today + 1).to_s).strftime('%Y%m%d')
      c.end_date = DateTime.parse(Date.today.next_year.to_s).strftime('%Y%m%d')
    end
  end
end
      

پرل

sub create_performance_max_campaign_operation {
  my ($customer_id, $brand_guidelines_enabled) = @_;
  # Configures the optional opt-in/out status for asset automation settings.
  # When we create the campaign object, we set campaign->{assetAutomationSettings}
  # equal to $asset_automation_settings.
  my $asset_automation_settings = [];
  my $asset_automation_types    = [
    GENERATE_IMAGE_EXTRACTION, FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
    TEXT_ASSET_AUTOMATION,     GENERATE_ENHANCED_YOUTUBE_VIDEOS,
    GENERATE_IMAGE_ENHANCEMENT
  ];
  foreach my $asset_automation_type (@$asset_automation_types) {
    push @$asset_automation_settings,
      Google::Ads::GoogleAds::V22::Resources::AssetAutomationSetting->new({
        assetAutomationStatus => OPTED_IN,
        assetAutomationType   => $asset_automation_type
      });
  }

  # Create a mutate operation that creates a campaign operation.
  return
    Google::Ads::GoogleAds::V22::Services::GoogleAdsService::MutateOperation->
    new({
      campaignOperation =>
        Google::Ads::GoogleAds::V22::Services::CampaignService::CampaignOperation
        ->new({
          create => Google::Ads::GoogleAds::V22::Resources::Campaign->new({
              # Assign the resource name with a temporary ID.
              resourceName =>
                Google::Ads::GoogleAds::V22::Utils::ResourceNames::campaign(
                $customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
              name => "Performance Max campaign #" . uniqid(),
              # Set the budget using the given budget resource name.
              campaignBudget =>
                Google::Ads::GoogleAds::V22::Utils::ResourceNames::campaign_budget(
                $customer_id, BUDGET_TEMPORARY_ID
                ),
              # Set the campaign status as PAUSED. The campaign is the only entity in
              # the mutate request that should have its status set.
              status =>
                Google::Ads::GoogleAds::V22::Enums::CampaignStatusEnum::PAUSED,
              # All Performance Max campaigns have an advertisingChannelType of
              # PERFORMANCE_MAX. The advertisingChannelSubType should not be set.
              advertisingChannelType => PERFORMANCE_MAX,

              # Bidding strategy must be set directly on the campaign.
              # Setting a portfolio bidding strategy by resource name is not supported.
              # Max Conversion and Maximize Conversion Value are the only strategies
              # supported for Performance Max campaigns.
              # An optional ROAS (Return on Advertising Spend) can be set for
              # maximizeConversionValue. The ROAS value must be specified as a ratio in
              # the API. It is calculated by dividing "total value" by "total spend".
              # For more information on Maximize Conversion Value, see the support
              # article: http://support.google.com/google-ads/answer/7684216.
              # A targetRoas of 3.5 corresponds to a 350% return on ad spend.
              maximizeConversionValue =>
                Google::Ads::GoogleAds::V22::Common::MaximizeConversionValue->
                new({
                  targetRoas => 3.5
                }
                ),

              # Set if the campaign is enabled for brand guidelines. For more information
              # on brand guidelines, see https://support.google.com/google-ads/answer/14934472.
              brandGuidelinesEnabled => $brand_guidelines_enabled,

              # Configures the optional opt-in/out status for asset automation settings.
              assetAutomationSettings => $asset_automation_settings,

              # Optional fields.
              startDate => strftime("%Y%m%d", localtime(time + 60 * 60 * 24)),
              endDate   =>
                strftime("%Y%m%d", localtime(time + 60 * 60 * 24 * 365)),

              # Declare whether or not this campaign serves political ads targeting the EU.
              # Valid values are CONTAINS_EU_POLITICAL_ADVERTISING and
              # DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING.
              containsEuPoliticalAdvertising =>
                DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING
            })})});
}
      

توصیه‌های مناقصه

API گوگل ادز دو نوع پیشنهاد برای کمک به شما در بهینه‌سازی پیشنهاد قیمت کمپین Performance Max ارائه می‌دهد:

  • MAXIMIZE_CONVERSION_VALUE_OPT_IN توصیه می‌کند از استراتژی پیشنهاد قیمت حداکثرسازی ارزش تبدیل برای کمپین‌های خود استفاده کنید.
  • MAXIMIZE_CONVERSIONS_OPT_IN استفاده از استراتژی پیشنهاد قیمت برای کمپین‌های شما را توصیه می‌کند و مبلغ بودجه پیشنهادی را ارائه می‌دهد.

برای اطلاعات بیشتر در مورد استفاده از توصیه‌ها، به راهنمای امتیاز بهینه‌سازی و توصیه‌ها مراجعه کنید.

دستورالعمل‌های برند

دستورالعمل‌های برند، نحوه نمایش برند شما را در دارایی‌ها یا قالب‌های خودکار کمپین Performance Max شما کنترل می‌کنند. از API نسخه ۲۱ گوگل ادز، کمپین‌های Performance Max به طور خودکار دستورالعمل‌های برند را در تمام کمپین‌های جدید Performance Max برای فروش آنلاین یا تولید سرنخ (استاندارد) و Performance Max برای فروش آنلاین با فید محصول (خرده‌فروشی) فعال می‌کنند. اگر نمی‌خواهید دستورالعمل‌های برند را در کمپین‌های جدید خود فعال کنید، هنگام ایجاد کمپین جدید Performance Max، Campaign.brand_guidelines_enabled را روی false تنظیم کنید.

کمپین‌های Performance Max با فعال بودن دستورالعمل‌های برند، از دارایی‌های سطح کمپین برای انواع فیلد دارایی برند ( BUSINESS_NAME ، LOGO و LANDSCAPE_LOGO ) استفاده می‌کنند. شما باید دارایی‌های برند را با استفاده از CampaignAsset به کمپین پیوند دهید و کمپین باید موارد زیر را داشته باشد:

  • دقیقاً یک دارایی BUSINESS_NAME
  • حداقل یک دارایی LOGO و حداکثر چهار دارایی لوگوی اضافی اختیاری از نوع LOGO یا LANDSCAPE_LOGO

دستورالعمل‌های اختیاری رنگ و فونت برای کمپین را می‌توان با استفاده از فیلد Campaign.brand_guidelines تنظیم کرد:

  • main_color رنگ اصلی را تنظیم می‌کند. رنگ باید به صورت یک رشته کد هگز (مثلاً #00ff00) ارائه شود.
  • accent_color رنگ ثانویه را تنظیم می‌کند. این رنگ باید به صورت یک رشته کد هگز (مثلاً #00ff00) ارائه شود.
  • برای تنظیم فونت predefined_font_family استفاده کنید. مقدار باید یکی از فونت‌های گوگل زیر باشد (به حروف کوچک و بزرگ حساس است): Open Sans ، Roboto ، Montserrat ، Poppins ، Lato ، Oswald ، Playfair Display ، Roboto Slab .

مثال زیر نحوه ایجاد دارایی‌های BUSINESS_NAME و LOGO و اتصال آنها به کمپین در صورت فعال بودن دستورالعمل‌های برند یا به AssetGroup در صورت غیرفعال بودن دستورالعمل‌های برند را نشان می‌دهد. برای اطلاعات بیشتر در مورد گروه‌های دارایی، به راهنمای تنظیم گروه دارایی مراجعه کنید.

جاوا

/** Creates a list of MutateOperations that create linked brand assets. */
List<MutateOperation> createAndLinkBrandAssets(
    long customerId,
    boolean brandGuidelinesEnabled,
    String businessName,
    String logoUrl,
    String logoName)
    throws IOException {
  List<MutateOperation> mutateOperations = new ArrayList<>();

  // Creates the brand name text asset.
  String businessNameAssetResourceName = ResourceNames.asset(customerId, getNextTemporaryId());
  Asset businessNameAsset =
      Asset.newBuilder()
          .setResourceName(businessNameAssetResourceName)
          .setTextAsset(TextAsset.newBuilder().setText(businessName).build())
          .build();
  AssetOperation businessNameAssetOperation =
      AssetOperation.newBuilder().setCreate(businessNameAsset).build();
  mutateOperations.add(
      MutateOperation.newBuilder().setAssetOperation(businessNameAssetOperation).build());

  // Creates the logo image asset.
  String logoAssetResourceName = ResourceNames.asset(customerId, getNextTemporaryId());
  // Creates a media file.
  byte[] logoBytes = ByteStreams.toByteArray(new URL(logoUrl).openStream());
  Asset logoAsset =
      Asset.newBuilder()
          .setResourceName(logoAssetResourceName)
          .setImageAsset(ImageAsset.newBuilder().setData(ByteString.copyFrom(logoBytes)).build())
          // Provides a unique friendly name to identify your asset. When there is an existing
          // image asset with the same content but a different name, the new name will be dropped
          // silently.
          .setName(logoName)
          .build();
  AssetOperation logoImageAssetOperation =
      AssetOperation.newBuilder().setCreate(logoAsset).build();
  mutateOperations.add(
      MutateOperation.newBuilder().setAssetOperation(logoImageAssetOperation).build());

  if (brandGuidelinesEnabled) {
    // Creates CampaignAsset resources to link the Asset resources to the Campaign.
    mutateOperations.add(
        createCampaignAssetMutateOperation(
            customerId, AssetFieldType.BUSINESS_NAME, businessNameAssetResourceName));
    mutateOperations.add(
        createCampaignAssetMutateOperation(
            customerId, AssetFieldType.LOGO, logoAssetResourceName));
  } else {
    // Creates an AssetGroupAsset to link the Asset to the AssetGroup.
    mutateOperations.add(
        createAssetGroupAssetMutateOperation(
            AssetFieldType.BUSINESS_NAME,
            businessNameAssetResourceName,
            ResourceNames.assetGroup(customerId, ASSET_GROUP_TEMPORARY_ID)));
    mutateOperations.add(
        createAssetGroupAssetMutateOperation(
            AssetFieldType.LOGO,
            logoAssetResourceName,
            ResourceNames.assetGroup(customerId, ASSET_GROUP_TEMPORARY_ID)));
  }

  return mutateOperations;
}

/** Creates a MutateOperation to add an AssetGroupAsset. */
MutateOperation createAssetGroupAssetMutateOperation(
    AssetFieldType fieldType, String assetResourceName, String assetGroupResourceName) {
  AssetGroupAsset assetGroupAsset =
      AssetGroupAsset.newBuilder()
          .setFieldType(fieldType)
          .setAssetGroup(assetGroupResourceName)
          .setAsset(assetResourceName)
          .build();
  AssetGroupAssetOperation assetGroupAssetOperation =
      AssetGroupAssetOperation.newBuilder().setCreate(assetGroupAsset).build();
  return MutateOperation.newBuilder()
      .setAssetGroupAssetOperation(assetGroupAssetOperation)
      .build();
}

/** Creates a MutateOperation to add a CampaignAsset. */
MutateOperation createCampaignAssetMutateOperation(
    long customerId, AssetFieldType fieldType, String assetResourceName) {
  CampaignAsset campaignAsset =
      CampaignAsset.newBuilder()
          .setFieldType(fieldType)
          .setCampaign(ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID))
          .setAsset(assetResourceName)
          .build();
  CampaignAssetOperation campaignAssetOperation =
      CampaignAssetOperation.newBuilder().setCreate(campaignAsset).build();
  return MutateOperation.newBuilder().setCampaignAssetOperation(campaignAssetOperation).build();
}
      

سی شارپ

This example is not yet available in C#; you can take a look at the other languages.
    

پی اچ پی

This example is not yet available in PHP; you can take a look at the other languages.
    

پایتون

This example is not yet available in Python; you can take a look at the other languages.
    

روبی

This example is not yet available in Ruby; you can take a look at the other languages.
    

پرل

This example is not yet available in Perl; you can take a look at the other languages.
    

مهاجرت خودکار

از اول ژوئن ۲۰۲۵، ما به طور خودکار دستورالعمل‌های برند را برای کمپین‌های Performance Max که از دارایی‌های برند یکسان ( BUSINESS_NAME ، LOGO و LANDSCAPE_LOGO ) در تمام گروه‌های دارایی استفاده می‌کنند، فعال خواهیم کرد. تمام کمپین‌هایی که می‌توانند به طور خودکار منتقل شوند، تا ۳۰ اکتبر ۲۰۲۵ منتقل خواهند شد.

  • مهاجرت خودکار فقط برای کمپین‌هایی انجام می‌شود که از نام و لوگوی تجاری ثابتی در هر گروه دارایی استفاده می‌کنند. اگر کمپین شما در این دارایی‌ها تنوع داشته باشد، به طور خودکار منتقل نخواهد شد.
  • تمام کمپین‌های واجد شرایط Performance Max تحت یک شناسه مشتری به طور همزمان منتقل خواهند شد.
  • پس از مهاجرت، هر کمپین منتقل‌شده، مجموعه‌ای از دارایی‌های برند خود را خواهد داشت که با استفاده از CampaignAsset در سطح کمپین ذخیره می‌شوند.

با بررسی فیلد Campaign.brand_guidelines_enabled می‌توانید متوجه شوید که آیا یک کمپین منتقل شده است یا خیر.

مهاجرت دستی

کمپین‌هایی که واجد شرایط مهاجرت خودکار نیستند، برای فعال کردن دستورالعمل‌های برند، نیاز به مهاجرت دستی دارند.

Campaign.brand_guidelines_enabled نشان می‌دهد که آیا یک کمپین موجود برای دستورالعمل‌های برند فعال است یا خیر. برای فعال کردن دستی دستورالعمل‌های برند برای یک کمپین موجود، به جای به‌روزرسانی مستقیم فیلد brand_guidelines_enabled ، از CampaignService.EnablePMaxBrandGuidelines استفاده کنید، زیرا این فیلد تغییرناپذیر است. auto_populate_brand_assets روی true تنظیم کنید تا به طور خودکار کمپین را با دارایی‌های برند با عملکرد بالا پر کند. در غیر این صورت، باید دارایی‌ها را به صورت دستی در عملیات با brand_assets ارائه دهید. غیرفعال کردن دستورالعمل‌های برند برای یک کمپین پشتیبانی نمی‌شود.