กลุ่มชิ้นงาน Performance Max

กลุ่มชิ้นงานของ Performance Max คือชุดชิ้นงาน เช่น รูปภาพ บรรทัดแรก คำอธิบาย และ วิดีโอ ซึ่งเน้นที่ธีมหรือเกี่ยวข้องกับกลุ่มเป้าหมายที่คุณเพิ่มเมื่อ สร้างแคมเปญ Performance Max กลุ่มชิ้นงานใช้สําหรับประกอบโฆษณาทั้งหมด และสร้างพื้นที่โฆษณาสำหรับรูปแบบโฆษณาที่เกี่ยวข้องทั้งหมดเพื่อวัตถุประสงค์การโฆษณา ระบบจะเลือกและรวมชิ้นงานอย่างชาญฉลาดเพื่อให้เหมาะสมกับช่อง Google Ads ที่เฉพาะเจาะจง (เช่น YouTube, Gmail หรือ Search) ที่โฆษณาจะแสดง เพื่อเพิ่มประสิทธิภาพของโฆษณา ดูข้อมูลเพิ่มเติม เกี่ยวกับกลุ่มชิ้นงาน

คุณไม่สามารถแชร์กลุ่มชิ้นงานระหว่างแคมเปญได้ แต่ละแคมเปญต้องมีกลุ่มชิ้นงานอย่างน้อย 1 กลุ่ม และมีกลุ่มชิ้นงานได้สูงสุด 100 กลุ่มต่อแคมเปญ

กลุ่มชิ้นงานมี URL สุดท้ายอย่างน้อย 1 รายการ โดยต้องมี URL สุดท้ายอย่างน้อย 1 รายการ ใช้ URL ที่เกี่ยวข้องมากที่สุดกับเส้นทาง Conversion สําหรับกลุ่มชิ้นงานและวัตถุประสงค์ของแคมเปญที่ระบุ คุณไม่สามารถยกเว้น URL สุดท้ายของกลุ่มชิ้นงานจาก WEBPAGE เกณฑ์แคมเปญได้

คุณลิงก์ AssetGroup กับ Asset ได้โดยการสร้าง AssetGroupAsset ใหม่และระบุข้อมูลต่อไปนี้

  • ชื่อทรัพยากรของ AssetGroup
  • ชื่อทรัพยากรของ Asset
  • AssetFieldType ของ Asset ใน AssetGroup

AssetGroup สามารถลิงก์กับออบเจ็กต์ Asset หลายรายการได้ Asset สามารถลิงก์กับกลุ่มชิ้นงานหลายกลุ่มได้ Asset รายการหนึ่งอาจมีประเภทฟิลด์ที่แตกต่างกันใน ออบเจ็กต์ AssetGroup ที่แตกต่างกัน

ดูรายละเอียดเกี่ยวกับการใช้รหัสชั่วคราวและการจัดลําดับออบเจ็กต์ AssetOperation, AssetGroupOperation และ AssetGroupAssetOperation ในคําขอเปลี่ยนแปลงข้อมูลในเซิร์ฟเวอร์จํานวนมากได้ในคู่มือคําขอโครงสร้าง

ข้อจำกัด:

  • คําขอ AssetGroupOperation ต้องเป็นแบบอะตอมมิก ระบบไม่รองรับการล้มเหลว บางส่วน
  • คุณไม่สามารถแก้ไขแหล่งข้อมูลกลุ่มชิ้นงานในกระบวนการแบบเป็นชุด โดยใช้ AssetGroupOperationได้ ให้ใช้ GoogleAdsService.Mutate มาตรฐานกับ AssetGroupService เพื่อแก้ไขแหล่งข้อมูลกลุ่มชิ้นงานในกระบวนการแบบเป็นชุดแทน
  • คุณสามารถใช้ AssetGroupAssetOperation ภายใน BatchJobService เพื่อลิงก์หรือยกเลิกการลิงก์ชิ้นงานกับกลุ่มชิ้นงาน

คุณสามารถสร้างออบเจ็กต์ AssetGroup ในแคมเปญค้าปลีกของ Performance Max ได้โดยไม่ต้อง มี ชิ้นงานตามข้อกำหนดขั้นต่ำ อย่างไรก็ตาม การพยายามลิงก์ Asset กับ AssetGroup โดยใช้ AssetGroupAsset ใน แคมเปญ Performance Maxใดก็ตาม จะทําให้ข้อกําหนดด้านชิ้นงานทั้งหมด มีผล กล่าวอีกนัยหนึ่งคือ ออบเจ็กต์ AssetGroup ในแคมเปญค้าปลีกของ Performance Max จะมีได้ 2 สถานะเท่านั้น ดังนี้

  • ไม่มีออบเจ็กต์ Asset ที่ลิงก์
  • เป็นไปตามข้อกําหนด Asset ทั้งหมด

แนวทางปฏิบัติแนะนำคือให้อัปโหลดชิ้นงานเพื่อเพิ่มการเข้าถึงสูงสุดในพื้นที่โฆษณาทั้งหมดให้ได้มากที่สุด อย่างไรก็ตาม คุณต้องลิงก์ชิ้นงานโฆษณาที่จำเป็นทั้งหมดในคำขอเดียว โดยไม่ใช้ การล้มเหลวบางส่วน และคุณจะเพิ่มชิ้นงานโฆษณาลงในกลุ่มชิ้นงานทีละรายการด้วยคำขอแยกกันไม่ได้

Java

/** Creates a list of MutateOperations that create a new AssetGroup. */
private List<MutateOperation> createAssetGroupOperations(
    long customerId,
    String assetGroupResourceName,
    List<String> headlineAssetResourceNames,
    List<String> descriptionAssetResourceNames,
    boolean brandGuidelinesEnabled)
    throws IOException {
  List<MutateOperation> mutateOperations = new ArrayList<>();
  String campaignResourceName =
      ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID);
  // Creates the AssetGroup.
  AssetGroup assetGroup =
      AssetGroup.newBuilder()
          .setName("Performance Max asset group #" + getPrintableDateTime())
          .setCampaign(campaignResourceName)
          .addFinalUrls("http://www.example.com")
          .addFinalMobileUrls("http://www.example.com")
          .setStatus(AssetGroupStatus.PAUSED)
          .setResourceName(assetGroupResourceName)
          .build();
  AssetGroupOperation assetGroupOperation =
      AssetGroupOperation.newBuilder().setCreate(assetGroup).build();
  mutateOperations.add(
      MutateOperation.newBuilder().setAssetGroupOperation(assetGroupOperation).build());

  // For the list of required assets for a Performance Max campaign, see
  // https://developers.google.com/google-ads/api/docs/performance-max/assets

  // An AssetGroup is linked to an Asset by creating a new AssetGroupAsset
  // and providing:
  //   the resource name of the AssetGroup
  //   the resource name of the Asset
  //   the field_type of the Asset in this AssetGroup.

  // To learn more about AssetGroups, see
  // https://developers.google.com/google-ads/api/docs/performance-max/asset-groups

  // Links the previously created multiple text assets.

  // Links the headline assets.
  for (String resourceName : headlineAssetResourceNames) {
    mutateOperations.add(
        createAssetGroupAssetMutateOperation(
            AssetFieldType.HEADLINE, resourceName, assetGroupResourceName));
  }

  // Links the description assets.
  for (String resourceName : descriptionAssetResourceNames) {
    mutateOperations.add(
        createAssetGroupAssetMutateOperation(
            AssetFieldType.DESCRIPTION, resourceName, assetGroupResourceName));
  }

  // Creates and links the long headline text asset.
  List<MutateOperation> createAndLinkTextAssetOperations =
      createAndLinkTextAsset(customerId, "Travel the World", AssetFieldType.LONG_HEADLINE);
  mutateOperations.addAll(createAndLinkTextAssetOperations);

  // Creates and links the business name and logo assets.
  List<MutateOperation> createAndLinkBrandAssets =
      createAndLinkBrandAssets(
          customerId,
          brandGuidelinesEnabled,
          "Interplanetary Cruises",
          "https://gaagl.page.link/bjYi",
          "Marketing Logo");
  mutateOperations.addAll(createAndLinkBrandAssets);

  // Creates and links the image assets.

  // Creates and links the Marketing Image Asset.
  createAndLinkTextAssetOperations =
      createAndLinkImageAsset(
          customerId,
          "https://gaagl.page.link/Eit5",
          AssetFieldType.MARKETING_IMAGE,
          "Marketing Image");
  mutateOperations.addAll(createAndLinkTextAssetOperations);

  // Creates and links the Square Marketing Image Asset.
  createAndLinkTextAssetOperations =
      createAndLinkImageAsset(
          customerId,
          "https://gaagl.page.link/bjYi",
          AssetFieldType.SQUARE_MARKETING_IMAGE,
          "Square Marketing Image");
  mutateOperations.addAll(createAndLinkTextAssetOperations);

  return mutateOperations;
}

      

C#

/// <summary>
/// Creates a list of MutateOperations that create a new asset_group.
/// </summary>
/// <param name="campaignResourceName">The campaign resource name.</param>
/// <param name="assetGroupResourceName">The asset group resource name.</param>
/// <param name="headlineAssetResourceNames">The headline asset resource names.</param>
/// <param name="descriptionAssetResourceNames">The description asset resource
/// names.</param>
/// <param name="resourceNameGenerator">A generator for unique temporary ID's.</param>
/// <param name="config">The Google Ads config.</param>
/// <param name="brandGuidelinesEnabled">Whether or not to enable brand guidelines.</param>
/// <returns>A list of MutateOperations that create the new asset group.</returns>
private List<MutateOperation> CreateAssetGroupOperations(
    string campaignResourceName,
    string assetGroupResourceName,
    List<string> headlineAssetResourceNames,
    List<string> descriptionAssetResourceNames,
    AssetTemporaryResourceNameGenerator resourceNameGenerator,
    GoogleAdsConfig config,
    bool brandGuidelinesEnabled)
{
    List<MutateOperation> operations = new List<MutateOperation>();

    // Create the AssetGroup
    operations.Add(
        new MutateOperation()
        {
            AssetGroupOperation = new AssetGroupOperation()
            {
                Create = new AssetGroup()
                {
                    Name = "Performance Max asset group #" +
                        ExampleUtilities.GetRandomString(),
                    Campaign = campaignResourceName,
                    FinalUrls = { "http://www.example.com" },
                    FinalMobileUrls = { "http://www.example.com" },
                    Status = AssetGroupStatus.Paused,
                    ResourceName = assetGroupResourceName
                }
            }
        }
    );

    // For the list of required assets for a Performance Max campaign, see
    // https://developers.google.com/google-ads/api/docs/performance-max/assets

    // An AssetGroup is linked to an Asset by creating a new AssetGroupAsset
    // and providing:
    //   the resource name of the AssetGroup
    //   the resource name of the Asset
    //   the field_type of the Asset in this AssetGroup.
    //
    // To learn more about AssetGroups, see
    // https://developers.google.com/google-ads/api/docs/performance-max/asset-groups

    // Link the previously created multiple text assets.

    // Link the headline assets.
    foreach (string resourceName in headlineAssetResourceNames)
    {
        operations.Add(
            new MutateOperation()
            {
                AssetGroupAssetOperation = new AssetGroupAssetOperation()
                {
                    Create = new AssetGroupAsset()
                    {
                        FieldType = AssetFieldType.Headline,
                        AssetGroup = assetGroupResourceName,
                        Asset = resourceName
                    }
                }
            }
        );
    }

    // Link the description assets.
    foreach (string resourceName in descriptionAssetResourceNames)
    {
        operations.Add(
            new MutateOperation()
            {
                AssetGroupAssetOperation = new AssetGroupAssetOperation()
                {
                    Create = new AssetGroupAsset()
                    {
                        FieldType = AssetFieldType.Description,
                        AssetGroup = assetGroupResourceName,
                        Asset = resourceName
                    }
                }
            }
        );
    }

    // Create and link the brand assets.
    operations.AddRange(
        CreateAndLinkBrandAssets(
            assetGroupResourceName,
            campaignResourceName,
            resourceNameGenerator,
            "Interplanetary Cruises",
            "https://gaagl.page.link/bjYi",
            "Marketing Logo",
            config,
            brandGuidelinesEnabled
        )
    );

    // Create and link the long headline text asset.
    operations.AddRange(
        CreateAndLinkTextAsset(
            assetGroupResourceName,
            resourceNameGenerator.Next(),
            "Travel the World",
            AssetFieldType.LongHeadline
        )
    );

    // Create and link the image assets.

    // Create and link the Marketing Image Asset.
    operations.AddRange(
        CreateAndLinkImageAsset(
            assetGroupResourceName,
            resourceNameGenerator.Next(),
            "https://gaagl.page.link/Eit5",
            AssetFieldType.MarketingImage,
            "Marketing Image",
            config
        )
    );

    // Create and link the Square Marketing Image Asset.
    operations.AddRange(
        CreateAndLinkImageAsset(
            assetGroupResourceName,
            resourceNameGenerator.Next(),
            "https://gaagl.page.link/bjYi",
            AssetFieldType.SquareMarketingImage,
            "Square Marketing Image",
            config
        )
    );

    return operations;
}

      

PHP

private static function createAssetGroupOperations(
    int $customerId,
    array $headlineAssetResourceNames,
    array $descriptionAssetResourceNames,
    bool $brandGuidelinesEnabled
): array {
    $operations = [];
    // Creates a new mutate operation that creates an asset group operation.
    $operations[] = new MutateOperation(
        [
        'asset_group_operation' => new AssetGroupOperation(
            [
            'create' => new AssetGroup(
                [
                'resource_name' => ResourceNames::forAssetGroup(
                    $customerId,
                    self::ASSET_GROUP_TEMPORARY_ID
                ),
                'name' => 'Performance Max asset group #' . Helper::getPrintableDatetime(),
                'campaign' => ResourceNames::forCampaign(
                    $customerId,
                    self::PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
                'final_urls' => ['http://www.example.com'],
                'final_mobile_urls' => ['http://www.example.com'],
                'status' => AssetGroupStatus::PAUSED
                ]
            )
            ]
        )
        ]
    );

    // For the list of required assets for a Performance Max campaign, see
    // https://developers.google.com/google-ads/api/docs/performance-max/assets

    // An AssetGroup is linked to an Asset by creating a new AssetGroupAsset
    // and providing:
    // -  the resource name of the AssetGroup
    // -  the resource name of the Asset
    // -  the field_type of the Asset in this AssetGroup
    //
    // To learn more about AssetGroups, see
    // https://developers.google.com/google-ads/api/docs/performance-max/asset-groups.

    // Links the previously created multiple text assets.

    // Links the headline assets.
    foreach ($headlineAssetResourceNames as $resourceName) {
        $operations[] = new MutateOperation(
            [
            'asset_group_asset_operation' => new AssetGroupAssetOperation(
                [
                'create' => new AssetGroupAsset(
                    [
                    'asset' => $resourceName,
                    'asset_group' => ResourceNames::forAssetGroup(
                        $customerId,
                        self::ASSET_GROUP_TEMPORARY_ID
                    ),
                    'field_type' => AssetFieldType::HEADLINE
                    ]
                )
                ]
            )
            ]
        );
    }
    // Links the description assets.
    foreach ($descriptionAssetResourceNames as $resourceName) {
        $operations[] = new MutateOperation(
            [
            'asset_group_asset_operation' => new AssetGroupAssetOperation(
                [
                'create' => new AssetGroupAsset(
                    [
                    'asset' => $resourceName,
                    'asset_group' => ResourceNames::forAssetGroup(
                        $customerId,
                        self::ASSET_GROUP_TEMPORARY_ID
                    ),
                    'field_type' => AssetFieldType::DESCRIPTION
                    ]
                )
                ]
            )
            ]
        );
    }

    // Creates and links the long headline text asset.
    $operations = array_merge(
        $operations,
        self::createAndLinkTextAsset(
            $customerId,
            'Travel the World',
            AssetFieldType::LONG_HEADLINE
        )
    );
    // Creates and links the business name text asset.
    $operations = array_merge(
        $operations,
        self::createAndLinkBrandAssets(
            $customerId,
            $brandGuidelinesEnabled,
            'Interplanetary Cruises',
            'https://gaagl.page.link/bjYi',
            'Marketing Logo'
        )
    );

    // Creates and links the image assets.

    // Creates and links the Marketing Image Asset.
    $operations = array_merge(
        $operations,
        self::createAndLinkImageAsset(
            $customerId,
            'https://gaagl.page.link/Eit5',
            AssetFieldType::MARKETING_IMAGE,
            'Marketing Image'
        )
    );
    // Creates and links the Square Marketing Image Asset.
    $operations = array_merge(
        $operations,
        self::createAndLinkImageAsset(
            $customerId,
            'https://gaagl.page.link/bjYi',
            AssetFieldType::SQUARE_MARKETING_IMAGE,
            'Square Marketing Image'
        )
    );

    return $operations;
}
      

Python

def create_asset_group_operation(
    client: GoogleAdsClient,
    customer_id: str,
    headline_asset_resource_names: List[str],
    description_asset_resource_names: List[str],
    brand_guidelines_enabled: bool,
) -> List[MutateOperation]:
    """Creates a list of MutateOperations that create a new asset_group.

    A temporary ID will be assigned to this asset group 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.
        headline_asset_resource_names: a list of headline resource names.
        description_asset_resource_names: a list of description resource names.
        brand_guidelines_enabled: a boolean value indicating if the campaign is
          enabled for brand guidelines.

    Returns:
        MutateOperations that create a new asset group and related assets.
    """
    asset_group_service: AssetGroupServiceClient = client.get_service(
        "AssetGroupService"
    )
    campaign_service: CampaignServiceClient = client.get_service(
        "CampaignService"
    )

    operations: List[MutateOperation] = []

    # Create the AssetGroup
    mutate_operation: MutateOperation = client.get_type("MutateOperation")
    asset_group: AssetGroup = mutate_operation.asset_group_operation.create
    asset_group.name = f"Performance Max asset group #{uuid4()}"
    asset_group.campaign = campaign_service.campaign_path(
        customer_id, _PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
    )
    asset_group.final_urls.append("http://www.example.com")
    asset_group.final_mobile_urls.append("http://www.example.com")
    asset_group.status = client.enums.AssetGroupStatusEnum.PAUSED
    asset_group.resource_name = asset_group_service.asset_group_path(
        customer_id,
        _ASSET_GROUP_TEMPORARY_ID,
    )
    operations.append(mutate_operation)

    # For the list of required assets for a Performance Max campaign, see
    # https://developers.google.com/google-ads/api/docs/performance-max/assets

    # An AssetGroup is linked to an Asset by creating a new AssetGroupAsset
    # and providing:
    #   the resource name of the AssetGroup
    #   the resource name of the Asset
    #   the field_type of the Asset in this AssetGroup.
    #
    # To learn more about AssetGroups, see
    # https://developers.google.com/google-ads/api/docs/performance-max/asset-groups

    # Link the previously created multiple text assets.

    # Link the headline assets.
    for resource_name in headline_asset_resource_names:
        mutate_operation: MutateOperation = client.get_type("MutateOperation")
        asset_group_asset: AssetGroupAsset = (
            mutate_operation.asset_group_asset_operation.create
        )
        asset_group_asset.field_type = client.enums.AssetFieldTypeEnum.HEADLINE
        asset_group_asset.asset_group = asset_group_service.asset_group_path(
            customer_id,
            _ASSET_GROUP_TEMPORARY_ID,
        )
        asset_group_asset.asset = resource_name
        operations.append(mutate_operation)

    #  Link the description assets.
    for resource_name in description_asset_resource_names:
        mutate_operation: MutateOperation = client.get_type("MutateOperation")
        asset_group_asset: AssetGroupAsset = (
            mutate_operation.asset_group_asset_operation.create
        )
        asset_group_asset.field_type = (
            client.enums.AssetFieldTypeEnum.DESCRIPTION
        )
        asset_group_asset.asset_group = asset_group_service.asset_group_path(
            customer_id,
            _ASSET_GROUP_TEMPORARY_ID,
        )
        asset_group_asset.asset = resource_name
        operations.append(mutate_operation)

    # Create and link the long headline text asset.
    mutate_operations: List[MutateOperation] = create_and_link_text_asset(
        client,
        customer_id,
        "Travel the World",
        client.enums.AssetFieldTypeEnum.LONG_HEADLINE,
    )
    operations.extend(mutate_operations)

    # Create and link the business name and logo asset.
    mutate_operations: List[MutateOperation] = create_and_link_brand_assets(
        client,
        customer_id,
        brand_guidelines_enabled,
        "Interplanetary Cruises",
        "https://gaagl.page.link/bjYi",
        "Marketing Logo",
    )
    operations.extend(mutate_operations)

    # Create and link the image assets.

    # Create and link the Marketing Image Asset.
    mutate_operations: List[MutateOperation] = create_and_link_image_asset(
        client,
        customer_id,
        "https://gaagl.page.link/Eit5",
        client.enums.AssetFieldTypeEnum.MARKETING_IMAGE,
        "Marketing Image",
    )
    operations.extend(mutate_operations)

    # Create and link the Square Marketing Image Asset.
    mutate_operations: List[MutateOperation] = create_and_link_image_asset(
        client,
        customer_id,
        "https://gaagl.page.link/bjYi",
        client.enums.AssetFieldTypeEnum.SQUARE_MARKETING_IMAGE,
        "Square Marketing Image",
    )
    operations.extend(mutate_operations)
    return operations
      

Ruby

# Creates a list of MutateOperations that create a new asset_group.
#
# A temporary ID will be assigned to this asset group so that it can
# be referenced by other objects being created in the same Mutate request.
def create_asset_group_operation(
    client,
    customer_id,
    headline_asset_resource_names,
    description_asset_resource_names,
    brand_guidelines_enabled)
  operations = []

  # Create the AssetGroup
  operations << client.operation.mutate do |m|
    m.asset_group_operation = client.operation.create_resource.asset_group do |ag|
      ag.name = "Performance Max asset group #{SecureRandom.uuid}"
      ag.campaign = client.path.campaign(
        customer_id,
        PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID)
      ag.final_urls << "http://www.example.com"
      ag.final_mobile_urls << "http://www.example.com"
      ag.status = :PAUSED
      ag.resource_name = client.path.asset_group(
        customer_id,
        ASSET_GROUP_TEMPORARY_ID)
    end
  end

  # For the list of required assets for a Performance Max campaign, see
  # https://developers.google.com/google-ads/api/docs/performance-max/assets
  #
  # An AssetGroup is linked to an Asset by creating a new AssetGroupAsset
  # and providing:
  #   the resource name of the AssetGroup
  #   the resource name of the Asset
  #   the field_type of the Asset in this AssetGroup.
  #
  # To learn more about AssetGroups, see
  # https://developers.google.com/google-ads/api/docs/performance-max/asset-groups

  # Link the previously created multiple text assets.

  # Link the headline assets.
  headline_asset_resource_names.each do |resource_name|
    operations << client.operation.mutate do |m|
      m.asset_group_asset_operation = client.operation.create_resource
          .asset_group_asset do |aga|
        aga.field_type = :HEADLINE
        aga.asset_group = client.path.asset_group(
          customer_id,
          ASSET_GROUP_TEMPORARY_ID)
        aga.asset = resource_name
      end
    end
  end

  #  Link the description assets.
  description_asset_resource_names.each do |resource_name|
    operations << client.operation.mutate do |m|
      m.asset_group_asset_operation = client.operation.create_resource
          .asset_group_asset do |aga|
        aga.field_type = :DESCRIPTION
        aga.asset_group = client.path.asset_group(
          customer_id,
          ASSET_GROUP_TEMPORARY_ID)
        aga.asset = resource_name
      end
    end
  end

  # Create and link the long headline text asset.
  operations += create_and_link_text_asset(
    client,
    customer_id,
    "Travel the World",
    :LONG_HEADLINE)

  # Create and link the business name and logo asset.
  operations += create_and_link_brand_assets(
    client,
    customer_id,
    brand_guidelines_enabled,
    "Interplanetary Cruises",
    "https://gaagl.page.link/bjYi",
    "Marketing Logo")

  # Create and link the image assets.

  # Create and link the Marketing Image Asset.
  operations += create_and_link_image_asset(
    client,
    customer_id,
    "https://gaagl.page.link/Eit5",
    :MARKETING_IMAGE,
    "Marketing Image")

  # Create and link the Square Marketing Image Asset.
  operations += create_and_link_image_asset(
    client,
    customer_id,
    "https://gaagl.page.link/bjYi",
    :SQUARE_MARKETING_IMAGE,
    "Square Marketing Image")

  operations
end
      

Perl

sub create_asset_group_operations {
  my (
    $customer_id,
    $headline_asset_resource_names,
    $description_asset_resource_names,
    $brand_guidelines_enabled
  ) = @_;

  my $operations = [];
  # Create a mutate operation that creates an asset group operation.
  push @$operations,
    Google::Ads::GoogleAds::V26::Services::GoogleAdsService::MutateOperation->
    new({
      assetGroupOperation =>
        Google::Ads::GoogleAds::V26::Services::AssetGroupService::AssetGroupOperation
        ->new({
          create => Google::Ads::GoogleAds::V26::Resources::AssetGroup->new({
              resourceName =>
                Google::Ads::GoogleAds::V26::Utils::ResourceNames::asset_group(
                $customer_id, ASSET_GROUP_TEMPORARY_ID
                ),
              name     => "Performance Max asset group #" . uniqid(),
              campaign =>
                Google::Ads::GoogleAds::V26::Utils::ResourceNames::campaign(
                $customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID
                ),
              finalUrls       => ["http://www.example.com"],
              finalMobileUrls => ["http://www.example.com"],
              status          =>
                Google::Ads::GoogleAds::V26::Enums::AssetGroupStatusEnum::PAUSED
            })})});

  # For the list of required assets for a Performance Max campaign, see
  # https://developers.google.com/google-ads/api/docs/performance-max/assets.

  # An AssetGroup is linked to an Asset by creating a new AssetGroupAsset
  # and providing:
  # - the resource name of the AssetGroup
  # - the resource name of the Asset
  # - the fieldType of the Asset in this AssetGroup
  #
  # To learn more about AssetGroups, see
  # https://developers.google.com/google-ads/api/docs/performance-max/asset-groups.

  # Link the previously created multiple text assets.

  # Link the headline assets.
  foreach my $resource_name (@$headline_asset_resource_names) {
    push @$operations,
      Google::Ads::GoogleAds::V26::Services::GoogleAdsService::MutateOperation
      ->new({
        assetGroupAssetOperation =>
          Google::Ads::GoogleAds::V26::Services::AssetGroupAssetService::AssetGroupAssetOperation
          ->new({
            create =>
              Google::Ads::GoogleAds::V26::Resources::AssetGroupAsset->new({
                asset      => $resource_name,
                assetGroup =>
                  Google::Ads::GoogleAds::V26::Utils::ResourceNames::asset_group(
                  $customer_id, ASSET_GROUP_TEMPORARY_ID
                  ),
                fieldType => HEADLINE
              })})});
  }

  # Link the description assets.
  foreach my $resource_name (@$description_asset_resource_names) {
    push @$operations,
      Google::Ads::GoogleAds::V26::Services::GoogleAdsService::MutateOperation
      ->new({
        assetGroupAssetOperation =>
          Google::Ads::GoogleAds::V26::Services::AssetGroupAssetService::AssetGroupAssetOperation
          ->new({
            create =>
              Google::Ads::GoogleAds::V26::Resources::AssetGroupAsset->new({
                asset      => $resource_name,
                assetGroup =>
                  Google::Ads::GoogleAds::V26::Utils::ResourceNames::asset_group(
                  $customer_id, ASSET_GROUP_TEMPORARY_ID
                  ),
                fieldType => DESCRIPTION
              })})});
  }

  # Create and link the long headline text asset.
  push @$operations,
    @{create_and_link_text_asset($customer_id, "Travel the World",
      LONG_HEADLINE)};

  # Create and link the business name and logo asset.
  push @$operations,
    @{
    create_and_link_brand_assets(
      $customer_id,             $brand_guidelines_enabled,
      "Interplanetary Cruises", "https://gaagl.page.link/bjYi",
      "Marketing Logo"
    )};

  # Create and link the image assets.

  # Create and link the marketing image asset.
  push @$operations,
    @{
    create_and_link_image_asset(
      $customer_id,    "https://gaagl.page.link/Eit5",
      MARKETING_IMAGE, "Marketing Image"
    )};

  # Create and link the square marketing image asset.
  push @$operations,
    @{
    create_and_link_image_asset(
      $customer_id,           "https://gaagl.page.link/bjYi",
      SQUARE_MARKETING_IMAGE, "Square Marketing Image"
    )};

  return $operations;
}
      

curl

แคมเปญ Performance Max ของบริการในพื้นที่

แคมเปญ Performance Max ของบริการในพื้นที่ (GLS PMax) ซึ่ง GLS ย่อมาจาก Google Local Services มีลักษณะเฉพาะหลายประการเกี่ยวกับกลุ่มชิ้นงาน ดังนี้

  • ข้ามข้อกําหนดด้านชิ้นงานขั้นต่ำ: แคมเปญ GLS PMax ไม่จําเป็นต้องมีชิ้นงานมาตรฐาน (เช่น บรรทัดแรก คําอธิบาย หรือรูปภาพ) เพื่อแสดงโฆษณา ซึ่งแตกต่างจากแคมเปญ Performance Max มาตรฐาน ดังนั้น คุณจึงสร้างออบเจ็กต์ AssetGroup ได้โดยไม่ต้องมีออบเจ็กต์ AssetGroupAsset ที่เชื่อมโยง
  • ข้อมูล Google Local Services: คุณสามารถกําหนดค่าข้อมูลเมตาของโฆษณาบริการในพื้นที่ ในกลุ่มชิ้นงานได้โดยการป้อนข้อมูลลงในฟิลด์ google_local_services_info ด้วยข้อความ GoogleLocalServicesInfo ดังนี้
    • category_id (สตริง เปลี่ยนแปลงไม่ได้ ไม่บังคับ): ระบุรหัสหมวดหมู่ของบริการในพื้นที่ (ในรูปแบบ XCAT เช่น xcat:service_area_business_plumber) ฟิลด์นี้เปลี่ยนแปลงไม่ได้และ จะเปลี่ยนไม่ได้หลังจากสร้าง AssetGroup แล้ว
    • callouts (ซ้ำได้ LocalServicesCallout): ป้ายกำกับคำโปรโมทที่เลือกเพื่อแสดง โดยแต่ละรายการอ้างอิง callout_idที่ถูกต้อง
      • การตรวจสอบความถูกต้อง: API จะตรวจสอบความถูกต้องฝั่งเซิร์ฟเวอร์เพื่อให้แน่ใจ ว่า callout_id ที่ระบุนั้นถูกต้องสําหรับหมวดหมู่และภาษาที่เฉพาะเจาะจงของผู้ลงโฆษณา
      • ความสามารถในการเปลี่ยนแปลงได้: แม้ว่า category_id จะเปลี่ยนแปลงไม่ได้ แต่ callouts รายการจะเปลี่ยนแปลงได้อย่างเต็มที่ คุณสามารถเพิ่ม แทนที่ หรือล้างป้ายกำกับคำโปรโมท (โดยส่งรายการว่างเปล่าหรืออินสแตนซ์เริ่มต้นไปยังมาสก์ฟิลด์ google_local_services_info.callouts) ในการดําเนินการอัปเดตในภายหลัง

ดูตัวอย่างโฆษณาสําหรับกลุ่มชิ้นงาน

เมื่อสร้างกลุ่มชิ้นงานและลิงก์ชิ้นงานกับกลุ่มชิ้นงานแล้ว คุณจะสร้างตัวอย่างที่แชร์ได้เพื่อแสดงลักษณะของโฆษณาที่สร้างจากกลุ่มชิ้นงานแต่ละกลุ่ม

เมื่อส่งรหัสกลุ่มชิ้นงานไปยัง ShareablePreviewService.GenerateShareablePreviews, คุณจะดึงข้อมูล URL ของตัวอย่างโฆษณาที่จะแชร์กับผู้ใช้ รวมถึง การประทับเวลาหมดอายุได้

กลุ่มชิ้นงานหลายกลุ่ม

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