حداکثر عملکرد برای اهداف سفر

کمپین‌های حداکثر عملکرد برای اهداف سفر به شما امکان می‌دهند برای املاک هتل تبلیغاتی ایجاد کنید که در کانال‌های Google مانند جستجو، نمایش، ویدیو و کشف ارائه می‌شوند. مزایا همچنین شامل تخصیص خودکار بودجه در بین کانال‌ها، گسترش URL نهایی، افزایش پوشش تبلیغاتی در جستجو و پیشنهادهایی برای ایجاد دارایی به عنوان گروه دارایی برای هر ملک هتل است.

برخلاف تبلیغات هتل ، برای استفاده از Performance Max برای اهداف سفر، نیازی به دسترسی به حساب مرکز هتل ندارید.

یک کمپین حداکثر عملکرد برای اهداف سفر ایجاد کنید

مراحل ایجاد یک کمپین حداکثر عملکرد برای اهداف سفر به شرح زیر است:

  1. یک مجموعه دارایی، دارایی برای همه دارایی های هتل خود، و دارایی های مجموعه دارایی ایجاد کنید تا مجموعه دارایی ایجاد شده و دارایی ها را به هم پیوند دهید .
  2. (توصیه می شود) دارایی های پیشنهادی را دریافت کنید که می توانید از آنها برای ایجاد یک گروه دارایی استفاده کنید .
  3. با استفاده از مجموعه دارایی و دارایی های پیشنهادی، یک کمپین حداکثر عملکرد ایجاد کنید .

برای املاک هتل خود موجودیت های دارایی ایجاد کنید

  1. با تنظیم AssetSet.type روی AssetSetType.HOTEL_PROPERTY ، یک مجموعه دارایی دارایی هتل از نوع HOTEL_PROPERTY ایجاد کنید. در مراحل بعدی از نام منبع مجموعه دارایی ایجاد شده استفاده خواهید کرد.

    جاوا

    private String createHotelAssetSet(GoogleAdsClient googleAdsClient, long customerId) {
      // Creates an asset set operation for a hotel property asset set.
      AssetSetOperation assetSetOperation =
          AssetSetOperation.newBuilder()
              .setCreate(
                  AssetSet.newBuilder()
                      .setName(
                          "My Hotel propery asset set #" + CodeSampleHelper.getPrintableDateTime())
                      .setType(AssetSetType.HOTEL_PROPERTY))
              .build();
      try (AssetSetServiceClient assetSetServiceClient =
          googleAdsClient.getLatestVersion().createAssetSetServiceClient()) {
        MutateAssetSetsResponse mutateAssetSetsResponse =
            assetSetServiceClient.mutateAssetSets(
                Long.toString(customerId), ImmutableList.of(assetSetOperation));
        String assetSetResourceName = mutateAssetSetsResponse.getResults(0).getResourceName();
        System.out.printf("Created an asset set with resource name: '%s'%n", assetSetResourceName);
        return assetSetResourceName;
      }
    }
          

    سی شارپ

    private string CreateHotelAssetSet(GoogleAdsClient client, long customerId)
    {
        AssetSetOperation operation = new AssetSetOperation()
        {
            Create = new AssetSet {
                Name = "My Hotel property asset set #" + ExampleUtilities.GetRandomString(),
                Type = AssetSetType.HotelProperty
            }
        };
    
        AssetSetServiceClient assetSetService = client.GetService(Services.V16.AssetSetService);
    
        MutateAssetSetsResponse response = assetSetService.MutateAssetSets(
            customerId.ToString(),
            new List<AssetSetOperation> { operation }
        );
    
        string assetResourceName = response.Results[0].ResourceName;
        Console.WriteLine($"Created an asset set with resource name: {assetResourceName}");
        return assetResourceName;
    }
          

    PHP

    private static function createHotelAssetSet(
        GoogleAdsClient $googleAdsClient,
        int $customerId
    ): string {
        // Creates an asset set operation for a hotel property asset set.
        $assetSetOperation = new AssetSetOperation([
            // Creates a hotel property asset set.
            'create' => new AssetSet([
                'name' => 'My Hotel propery asset set #' . Helper::getPrintableDatetime(),
                'type' => AssetSetType::HOTEL_PROPERTY
            ])
        ]);
    
        // Issues a mutate request to add a hotel asset set and prints its information.
        $assetSetServiceClient = $googleAdsClient->getAssetSetServiceClient();
        $response = $assetSetServiceClient->mutateAssetSets(
            MutateAssetSetsRequest::build($customerId, [$assetSetOperation])
        );
        $assetSetResourceName = $response->getResults()[0]->getResourceName();
        printf("Created an asset set with resource name: '%s'.%s", $assetSetResourceName, PHP_EOL);
        return $assetSetResourceName;
    }
          

    پایتون

    def create_hotel_asset_set(client, customer_id):
        """Creates a hotel property asset set.
    
        Args:
            client: an initialized GoogleAdsClient instance.
            customer_id: a client customer ID.
    
        Returns:
            the created hotel property asset set's resource name.
        """
        # Creates an asset set operation for a hotel property asset set.
        operation = client.get_type("AssetSetOperation")
        # Creates a hotel property asset set.
        asset_set = operation.create
        asset_set.name = f"My hotel property asset set #{get_printable_datetime()}"
        asset_set.type_ = client.enums.AssetSetTypeEnum.HOTEL_PROPERTY
    
        # Issues a mutate request to add a hotel asset set.
        asset_set_service = client.get_service("AssetSetService")
        response = asset_set_service.mutate_asset_sets(
            customer_id=customer_id, operations=[operation]
        )
        resource_name = response.results[0].resource_name
        print(f"Created an asset set with resource name: '{resource_name}'")
    
        return resource_name
          

    روبی

    # Creates a hotel property asset set.
    def create_hotel_asset_set(client, customer_id)
      operation =
        client.operation.create_resource.asset_set do |asset_set|
          asset_set.name = "My Hotel propery asset set #{Time.now}"
          asset_set.type = :HOTEL_PROPERTY
        end
    
      # Sends the mutate request.
      response =
        client.service.asset_set.mutate_asset_sets(
          customer_id: customer_id,
          operations: [operation]
        )
    
      # Prints some information about the response.
      response.results.first.resource_name
    end
          

    پرل

    sub create_hotel_asset_set {
      my ($api_client, $customer_id) = @_;
    
      my $asset_set_operation =
        Google::Ads::GoogleAds::V16::Services::AssetSetService::AssetSetOperation->
        new({
          # Creates a hotel property asset set.
          create => Google::Ads::GoogleAds::V16::Resources::AssetSet->new({
              name => 'My Hotel propery asset set #' . uniqid(),
              type => HOTEL_PROPERTY
            })});
      # Issues a mutate request to add a hotel asset set and prints its information.
      my $response = $api_client->AssetSetService()->mutate({
          customerId => $customer_id,
          operations => [$asset_set_operation]});
    
      my $asset_set_resource_name = $response->{results}[0]{resourceName};
      printf "Created an asset set with resource name: '%s'.\n",
        $asset_set_resource_name;
    
      return $asset_set_resource_name;
    }
          

  2. برای هر یک از هتل های خود موارد زیر را انجام دهید:

    1. با تنظیم Asset.hotel_property_asset به یک شی از HotelPropertyAsset ، یک دارایی ایجاد کنید.

      برای سادگی، مثال کد ما تنها یک دارایی دارایی هتل را ایجاد می کند.

    2. place_id شیء ایجاد شده HotelPropertyAsset را به شناسه مکان ملک هتل تنظیم کنید. شناسه مکان یک شناسه منحصر به فرد است که مکان را در Google Maps شناسایی می کند. می توانید با شناسه مکان یاب ملک خود را جستجو کنید.

    3. یک دارایی مجموعه دارایی ایجاد کنید تا مجموعه دارایی فوق را با دارایی با ایجاد یک AssetSetAsset جدید و تنظیم asset_set آن بر روی نام منبع مجموعه دارایی ایجاد شده و asset با نام منبع دارایی دارایی هتل ایجاد شده ایجاد کنید.

    جاوا

    private String createHotelAsset(
        GoogleAdsClient googleAdsClient,
        long customerId,
        String placeId,
        String hotelPropertyAssetSetResourceName) {
      // Uses the GoogleAdService to create an asset and asset set asset in a single request.
      List<MutateOperation> mutateOperations = new ArrayList<>();
      String assetResourceName = ResourceNames.asset(customerId, ASSET_TEMPORARY_ID);
      // Creates a mutate operation for a hotel property asset.
      Asset hotelPropertyAsset =
          Asset.newBuilder()
              .setResourceName(assetResourceName)
              .setHotelPropertyAsset(HotelPropertyAsset.newBuilder().setPlaceId(placeId))
              .build();
      mutateOperations.add(
          MutateOperation.newBuilder()
              .setAssetOperation(AssetOperation.newBuilder().setCreate(hotelPropertyAsset))
              .build());
    
      // Creates a mutate operation for an asset set asset.
      AssetSetAsset assetSetAsset =
          AssetSetAsset.newBuilder()
              .setAsset(assetResourceName)
              .setAssetSet(hotelPropertyAssetSetResourceName)
              .build();
      mutateOperations.add(
          MutateOperation.newBuilder()
              .setAssetSetAssetOperation(AssetSetAssetOperation.newBuilder().setCreate(assetSetAsset))
              .build());
      // Issues a mutate request to create all entities.
      try (GoogleAdsServiceClient googleAdsServiceClient =
          googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
        MutateGoogleAdsResponse mutateGoogleAdsResponse =
            googleAdsServiceClient.mutate(Long.toString(customerId), mutateOperations);
        System.out.println("Created the following entities for the hotel asset:");
        printResponseDetails(mutateGoogleAdsResponse);
        // Returns the created asset resource name, which will be used later to create an asset
        // group. Other resource names are not used later.
        return mutateGoogleAdsResponse
            .getMutateOperationResponses(0)
            .getAssetResult()
            .getResourceName();
      }
    }
          

    سی شارپ

    private string CreateHotelAsset(
        GoogleAdsClient client, long customerId, string placeId,
        string hotelPropertyAssetSetResourceName)
    {
        // Uses the GoogleAdService to create an asset and asset set asset in a single request.
        List<MutateOperation> mutateOperations = new List<MutateOperation>();
        string assetResourceName = ResourceNames.Asset(customerId, ASSET_TEMPORARY_ID);
    
        // Creates a mutate operation for a hotel property asset.
        Asset hotelPropertyAsset = new Asset()
        {
            ResourceName = assetResourceName,
            HotelPropertyAsset = new HotelPropertyAsset
            {
                PlaceId = placeId
            }
        };
        mutateOperations.Add(new MutateOperation
        {
            AssetOperation = new AssetOperation
            {
               Create = hotelPropertyAsset
            }
        });
    
        // Creates a mutate operation for an asset set asset.
        AssetSetAsset assetSetAsset = new AssetSetAsset
        {
            Asset = assetResourceName,
            AssetSet = hotelPropertyAssetSetResourceName
        };
        mutateOperations.Add(new MutateOperation
        {
            AssetSetAssetOperation = new AssetSetAssetOperation
            {
                Create = assetSetAsset
            }
        });
    
        // Issues a mutate request to create all entities.
        GoogleAdsServiceClient googleAdsServiceClient =
            client.GetService(Services.V16.GoogleAdsService);
    
        MutateGoogleAdsResponse response =
            googleAdsServiceClient.Mutate(customerId.ToString(), mutateOperations);
        Console.WriteLine("Created the following entities for the hotel asset:");
        PrintResponseDetails(response);
    
        return response.MutateOperationResponses[0].AssetResult.ResourceName;
    }
          

    PHP

    private static function createHotelAsset(
        GoogleAdsClient $googleAdsClient,
        int $customerId,
        string $placeId,
        string $assetSetResourceName
    ): string {
        // We use the GoogleAdService to create an asset and asset set asset in a single
        // request.
        $operations = [];
        $assetResourceName =
            ResourceNames::forAsset($customerId, self::ASSET_TEMPORARY_ID);
        // Creates a mutate operation for a hotel property asset.
        $operations[] = new MutateOperation([
            'asset_operation' => new AssetOperation([
                // Creates a hotel property asset.
                'create' => new Asset([
                    'resource_name' => $assetResourceName,
                    // Creates a hotel property asset for the place ID.
                    'hotel_property_asset' => new HotelPropertyAsset(['place_id' => $placeId]),
                ])
            ])
        ]);
        // Creates a mutate operation for an asset set asset.
        $operations[] = new MutateOperation([
            'asset_set_asset_operation' => new AssetSetAssetOperation([
                // Creates an asset set asset.
                'create' => new AssetSetAsset([
                    'asset' => $assetResourceName,
                    'asset_set' => $assetSetResourceName
                ])
            ])
        ]);
    
        // Issues a mutate request to create all entities.
        $googleAdsService = $googleAdsClient->getGoogleAdsServiceClient();
        /** @var MutateGoogleAdsResponse $mutateGoogleAdsResponse */
        $mutateGoogleAdsResponse =
            $googleAdsService->mutate(MutateGoogleAdsRequest::build($customerId, $operations));
        print "Created the following entities for the hotel asset:" . PHP_EOL;
        self::printResponseDetails($mutateGoogleAdsResponse);
    
        // Returns the created asset resource name, which will be used later to create an asset
        // group. Other resource names are not used later.
        return $mutateGoogleAdsResponse->getMutateOperationResponses()[0]->getAssetResult()
            ->getResourceName();
    }
          

    پایتون

    def create_hotel_asset(client, customer_id, place_id, asset_set_resource_name):
        """Creates a hotel property asset using the specified place ID.
    
        The place ID must belong to a hotel property. Then, links it to the
        specified asset set.
    
        Args:
            client: an initialized GoogleAdsClient instance.
            customer_id: a client customer ID.
            place_id: a place ID identifying a place in the Google Places database.
            asset_set_resource_name: an asset set resource name
    
        Returns:
            the created hotel property asset's resource name.
        """
        # We use the GoogleAdService to create an asset and asset set asset in a
        # single request.
        googleads_service = client.get_service("GoogleAdsService")
        asset_resource_name = googleads_service.asset_path(
            customer_id, ASSET_TEMPORARY_ID
        )
    
        # Creates a mutate operation for a hotel property asset.
        asset_mutate_operation = client.get_type("MutateOperation")
        # Creates a hotel property asset.
        asset = asset_mutate_operation.asset_operation.create
        asset.resource_name = asset_resource_name
        # Creates a hotel property asset for the place ID.
        asset.hotel_property_asset.place_id = place_id
    
        # Creates a mutate operation for an asset set asset.
        asset_set_asset_mutate_operation = client.get_type("MutateOperation")
        # Creates an asset set asset.
        asset_set_asset = (
            asset_set_asset_mutate_operation.asset_set_asset_operation.create
        )
        asset_set_asset.asset = asset_resource_name
        asset_set_asset.asset_set = asset_set_resource_name
    
        # Issues a mutate request to create all entities.
        response = googleads_service.mutate(
            customer_id=customer_id,
            mutate_operations=[
                asset_mutate_operation,
                asset_set_asset_mutate_operation,
            ],
        )
        print("Created the following entities for the hotel asset:")
        print_response_details(response)
    
        return response.mutate_operation_responses[0].asset_result.resource_name
          

    روبی

    # Creates a hotel property asset using the specified place ID.
    # The place ID must belong to a hotel property. Then, links it to the
    # specified asset set.
    # See https://developers.google.com/places/web-service/place-id to search for a
    # hotel place ID.
    def create_hotel_asset(
      client,
      customer_id,
      place_id,
      hotel_property_asset_set_resource_name
    )
      asset_operation =
        client.operation.create_resource.asset do |asset|
          asset.name = 'Ad Media Bundle'
          asset.hotel_property_asset =
            client.resource.hotel_property_asset do |hotel_asset|
              hotel_asset.place_id = place_id
            end
        end
    
      # Send the mutate request.
      response =
        client.service.asset.mutate_assets(
          customer_id: customer_id,
          operations: [asset_operation]
        )
    
      asset_resource_name = response.results.first.resource_name
    
      # Creates a mutate operation for an asset set asset.
      asset_set_asset_operation =
        client.operation.create_resource.asset_set_asset do |asa|
          asa.asset = asset_resource_name
          asa.asset_set = hotel_property_asset_set_resource_name
        end
    
      # Sends the mutate request.
      response =
        client.service.asset_set_asset.mutate_asset_set_assets(
          customer_id: customer_id,
          operations: [asset_set_asset_operation]
        )
    
      asset_resource_name
    end
          

    پرل

    sub create_hotel_asset {
      my ($api_client, $customer_id, $place_id, $asset_set_resource_name) = @_;
    
      # We use the GoogleAdService to create an asset and asset set asset in a single request.
      my $operations = [];
      my $asset_resource_name =
        Google::Ads::GoogleAds::V16::Utils::ResourceNames::asset($customer_id,
        ASSET_TEMPORARY_ID);
    
      # Create a mutate operation for a hotel property asset.
      push @$operations,
        Google::Ads::GoogleAds::V16::Services::GoogleAdsService::MutateOperation->
        new({
          assetOperation =>
            Google::Ads::GoogleAds::V16::Services::AssetService::AssetOperation->
            new({
              create => Google::Ads::GoogleAds::V16::Resources::Asset->new({
                  resourceName       => $asset_resource_name,
                  hotelPropertyAsset =>
                    Google::Ads::GoogleAds::V16::Common::HotelPropertyAsset->new({
                      placeId => $place_id
                    })})})});
    
      # Create a mutate operation for an asset set asset.
      push @$operations,
        Google::Ads::GoogleAds::V16::Services::GoogleAdsService::MutateOperation->
        new({
          assetSetAssetOperation =>
            Google::Ads::GoogleAds::V16::Services::AssetSetAssetService::AssetSetAssetOperation
            ->new({
              create => Google::Ads::GoogleAds::V16::Resources::AssetSetAsset->new({
                  asset    => $asset_resource_name,
                  assetSet => $asset_set_resource_name
                })})});
    
      # Issue a mutate request to create all entities.
      my $mutate_google_ads_response = $api_client->GoogleAdsService()->mutate({
        customerId       => $customer_id,
        mutateOperations => $operations
      });
    
      printf "Created the following entities for the hotel asset:\n";
      print_response_details($mutate_google_ads_response);
    
      # Return the created asset resource name, which will be used later to create an asset
      # group. Other resource names are not used later.
      return $mutate_google_ads_response->{mutateOperationResponses}[0]
        {assetResult}{resourceName};
    }
          

دارایی های پیشنهادی را دریافت کنید که می توانید از آنها برای ایجاد گروه دارایی استفاده کنید

می توانید از TravelAssetSugestionService.SuggestTravelAssets برای دریافت دارایی های پیشنهادی برای املاک هتل خود استفاده کنید. پس از دریافت پیشنهادات، می توانید از آنها برای ایجاد دارایی در گروه دارایی در مرحله بعد استفاده کنید.

جاوا

private HotelAssetSuggestion getHotelAssetSuggestion(
    GoogleAdsClient googleAdsClient, long customerId, String placeId) {

  try (TravelAssetSuggestionServiceClient travelAssetSuggestionServiceClient =
      googleAdsClient.getLatestVersion().createTravelAssetSuggestionServiceClient()) {
    // Sends a request to suggest assets to be created as an asset group for the Performance Max
    // for travel goals campaign.
    SuggestTravelAssetsResponse suggestTravelAssetsResponse =
        travelAssetSuggestionServiceClient.suggestTravelAssets(
            SuggestTravelAssetsRequest.newBuilder()
                .setCustomerId(Long.toString(customerId))
                // Uses 'en-US' as an example. It can be any language specifications in BCP 47
                // format.
                .setLanguageOption("en-US")
                // The service accepts several place IDs. We use only one here for demonstration.
                .addPlaceIds(placeId)
                .build());
    System.out.printf("Fetched a hotel asset suggestion for the place ID '%s'.%n", placeId);
    return suggestTravelAssetsResponse.getHotelAssetSuggestions(0);
  }
}
      

سی شارپ

private HotelAssetSuggestion GetHotelAssetSuggestion(GoogleAdsClient client,
    long customerId, string placeId)
{
    // Get the TravelAssetSuggestionService client.
    TravelAssetSuggestionServiceClient travelAssetSuggestionService =
        client.GetService(Services.V16.TravelAssetSuggestionService);

    SuggestTravelAssetsRequest request = new SuggestTravelAssetsRequest
    {
        CustomerId = customerId.ToString(),
        LanguageOption = "en-US",
    };

    request.PlaceIds.Add(placeId);

    SuggestTravelAssetsResponse response = travelAssetSuggestionService.SuggestTravelAssets(
        request
    );

    Console.WriteLine($"Fetched a hotel asset suggestion for the place ID {placeId}");
    return response.HotelAssetSuggestions[0];
}
      

PHP

private static function getHotelAssetSuggestion(
    GoogleAdsClient $googleAdsClient,
    int $customerId,
    string $placeId
): HotelAssetSuggestion {
    // Send a request to suggest assets to be created as an asset group for the Performance Max
    // for travel goals campaign.
    $travelAssetSuggestionServiceClient =
        $googleAdsClient->getTravelAssetSuggestionServiceClient();
    // Uses 'en-US' as an example. It can be any language specifications in BCP 47 format.
    $request = SuggestTravelAssetsRequest::build($customerId, 'en-US');
    // The service accepts several place IDs. We use only one here for demonstration.
    $request->setPlaceIds([$placeId]);
    $response = $travelAssetSuggestionServiceClient->suggestTravelAssets($request);
    printf("Fetched a hotel asset suggestion for the place ID '%s'.%s", $placeId, PHP_EOL);
    return $response->getHotelAssetSuggestions()[0];
}
      

پایتون

def get_hotel_asset_suggestion(client, customer_id, place_id):
    """Returns hotel asset suggestion from TravelAssetsSuggestionService.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a client customer ID.
        place_id: a place ID identifying a place in the Google Places database.
    """
    request = client.get_type("SuggestTravelAssetsRequest")
    request.customer_id = customer_id
    # Uses 'en-US' as an example. It can be any language specifications in
    # BCP 47 format.
    request.language_option = "en-US"
    # In this example we only use a single place ID for the purpose of
    # demonstration, but it's possible to append more than one here if needed.
    request.place_ids.append(place_id)
    # Send a request to suggest assets to be created as an asset group for the
    # Performance Max for travel goals campaign.
    travel_asset_suggestion_service = client.get_service(
        "TravelAssetSuggestionService"
    )
    response = travel_asset_suggestion_service.suggest_travel_assets(
        request=request
    )
    print(f"Fetched a hotel asset suggestion for the place ID: '{place_id}'.")

    # Since we sent a single operation in the request, it's guaranteed that
    # there will only be a single item in the response.
    return response.hotel_asset_suggestions[0]
      

روبی

def get_hotel_asset_suggestion(client, customer_id, place_id)
  response =
    client.service.travel_asset_suggestion.suggest_travel_assets(
      customer_id: customer_id,
      language_option: 'en-US',
      place_ids: [place_id]
    )

  response.hotel_asset_suggestions.first
end
      

پرل

sub get_hotel_asset_suggestion {
  my ($api_client, $customer_id, $place_id) = @_;

  # Send a request to suggest assets to be created as an asset group for the Performance Max
  # for travel goals campaign.
  my $suggest_travel_assets_response =
    $api_client->TravelAssetSuggestionService()->suggest_travel_assets({
      customerId => $customer_id,
      # Uses 'en-US' as an example. It can be any language specifications in BCP 47 format.
      languageOption => 'en-US',
      # The service accepts several place IDs. We use only one here for demonstration.
      placeIds => [$place_id],
    });

  printf "Fetched a hotel asset suggestion for the place ID '%s'.\n", $place_id;
  return $suggest_travel_assets_response->{hotelAssetSuggestions}[0];
}
      

هشدارها

  • این روش بر اساس بهترین تلاش کار می کند، بنابراین ممکن است هیچ پیشنهادی دریافت نکنید.
  • ممکن است این سرویس تمام دارایی‌های مورد نیاز را که برای ایجاد گروه دارایی نیاز دارید، برنگرداند . در آن صورت، دارایی های خود را برای برآورده کردن الزامات ایجاد کنید.

با استفاده از مجموعه دارایی و دارایی های پیشنهادی، یک کمپین حداکثر عملکرد ایجاد کنید

از آنجایی که این یک زیرگروه از کمپین حداکثر عملکرد است، دارای الزامات و محدودیت‌های اولیه حداکثر عملکرد است، مانند حداقل الزامات دارایی و شرط عدم امکان اشتراک‌گذاری بودجه کمپین .

به طور کلی، می توانید اکثر مراحل را برای ایجاد کمپین Performance Max دنبال کنید. تفاوت هایی که شایان ذکر است به شرح زیر است:

  • هنگام ایجاد یک کمپین، باید Campaign.hotel_property_asset_set نیز به نام منبع مجموعه دارایی ایجاد شده در مرحله اول مشخص کنید.

    جاوا

    private MutateOperation createCampaignOperation(
        long customerId, String hotelPropertyAssetSetResourceName) {
      Campaign performanceMaxCampaign =
          Campaign.newBuilder()
              .setName("Performance Max for travel goals 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)
              // To create a Performance Max for travel goals campaign, you need to set
              // `hotel_property_asset_set`.
              .setHotelPropertyAssetSet(hotelPropertyAssetSetResourceName)
              // 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())
              // Assigns the resource name with a temporary ID.
              .setResourceName(ResourceNames.campaign(customerId, CAMPAIGN_TEMPORARY_ID))
              // Sets the budget using the given budget resource name.
              .setCampaignBudget(ResourceNames.campaignBudget(customerId, BUDGET_TEMPORARY_ID))
              // Optional fields.
              .setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd"))
              .setEndDate(new DateTime().plusDays(365).toString("yyyyMMdd"))
              .build();
    
      return MutateOperation.newBuilder()
          .setCampaignOperation(
              CampaignOperation.newBuilder().setCreate(performanceMaxCampaign).build())
          .build();
    }
          

    سی شارپ

    private MutateOperation CreateCampaignOperation(long customerId,
        string hotelPropertyAssetSetResourceName)
    {
        Campaign performanceMaxCampaign = new Campaign
        {
            Name = "Performance Max for travel goals campaign #" +
                ExampleUtilities.GetRandomString(),
            // Sets 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 advertising_channel_type of
            // PERFORMANCE_MAX. The advertising_channel_sub_type should not be set.
            AdvertisingChannelType = AdvertisingChannelType.PerformanceMax,
            // To create a Performance Max for travel goals campaign, you need to set
            // `hotel_property_asset_set`.
            HotelPropertyAssetSet = hotelPropertyAssetSetResourceName,
            // 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.
            MaximizeConversionValue = new MaximizeConversionValue
            {
                TargetRoas = 3.5
            },
            // Assigns the resource name with a temporary ID.
            ResourceName = ResourceNames.Campaign(customerId, CAMPAIGN_TEMPORARY_ID),
            // Sets the budget using the given budget resource name.
            CampaignBudget = ResourceNames.CampaignBudget(customerId, BUDGET_TEMPORARY_ID)
        };
    
        return new MutateOperation
        {
            CampaignOperation = new CampaignOperation
            {
                Create = performanceMaxCampaign
            }
        };
    }
          

    PHP

    private static function createCampaignOperation(
        int $customerId,
        string $hotelPropertyAssetSetResourceName
    ): MutateOperation {
        // Creates a mutate operation that creates a campaign.
        return new MutateOperation([
            'campaign_operation' => new CampaignOperation([
                'create' => new Campaign([
                    'name' => 'Performance Max for travel goals campaign #'
                        . Helper::getPrintableDatetime(),
                    // Assigns the resource name with a temporary ID.
                    'resource_name' => ResourceNames::forCampaign(
                        $customerId,
                        self::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,
                    // 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,
    
                    // To create a Performance Max for travel goals campaign, you need to set
                    // `hotel_property_asset_set`.
                    'hotel_property_asset_set' => $hotelPropertyAssetSetResourceName,
    
                    // 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: https://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
                    ])
                ])
            ])
        ]);
    }
          

    پایتون

    def create_campaign_operation(
        client, customer_id, hotel_property_asset_set_resource_name
    ):
        """Creates a mutate operation that creates a new Performance Max campaign.
    
        Links the specified hotel property asset set to this campaign.
    
        A temporary ID will be assigned to this campaign budget 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.
            hotel_property_asset_set_resource_name: the resource name for a hotel
                property asset set.
    
        Returns:
            a MutateOperation message that creates a new Performance Max campaign.
        """
        googleads_service = client.get_service("GoogleAdsService")
        # Creates a mutate operation that creates a campaign.
        operation = client.get_type("MutateOperation")
        campaign = operation.campaign_operation.create
        campaign.name = (
            f"Performance Max for travel goals campaign #{get_printable_datetime}"
        )
        # Assigns the resource name with a temporary ID.
        campaign.resource_name = googleads_service.campaign_path(
            customer_id, CAMPAIGN_TEMPORARY_ID
        )
        # Sets the budget using the given budget resource name.
        campaign.campaign_budget = googleads_service.campaign_budget_path(
            customer_id, 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.
        campaign.status = client.enums.CampaignStatusEnum.PAUSED
        # 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
        )
        # To create a Performance Max for travel goals campaign, you need to set
        # the `hotel_property_asset_set` field.
        campaign.hotel_property_asset_set = hotel_property_asset_set_resource_name
        # 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: https://support.google.com/google-ads/answer/7684216.
        # A target_roas of 3.5 corresponds to a 350% return on ad spend.
        campaign.maximize_conversion_value.target_roas = 3.5
    
        return 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,
      hotel_property_asset_set_resource_name
    )
      client.operation.mutate do |m|
        m.campaign_operation =
          client.operation.create_resource.campaign do |c|
            c.name = "Performance Max for Travel Goals #{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
    
            # To create a Performance Max for travel goals campaign, you need to set hotel_property_asset_set
            c.hotel_property_asset_set = hotel_property_asset_set_resource_name
    
            # 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
    
            # 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)
          end
      end
    end
          

    پرل

    sub create_campaign_operation {
      my ($customer_id, $hotel_property_asset_set_resource_name) = @_;
    
      # Create a mutate operation that creates a campaign operation.
      return
        Google::Ads::GoogleAds::V16::Services::GoogleAdsService::MutateOperation->
        new({
          campaignOperation =>
            Google::Ads::GoogleAds::V16::Services::CampaignService::CampaignOperation
            ->new({
              create => Google::Ads::GoogleAds::V16::Resources::Campaign->new({
                  # Assign the resource name with a temporary ID.
                  resourceName =>
                    Google::Ads::GoogleAds::V16::Utils::ResourceNames::campaign(
                    $customer_id, CAMPAIGN_TEMPORARY_ID
                    ),
                  name => "Performance Max for travel goals campaign #'" . uniqid(),
                  # Set the budget using the given budget resource name.
                  campaignBudget =>
                    Google::Ads::GoogleAds::V16::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::V16::Enums::CampaignStatusEnum::PAUSED,
                  # All Performance Max campaigns have an advertisingChannelType of
                  # PERFORMANCE_MAX. The advertisingChannelSubType should not be set.
                  advertisingChannelType => PERFORMANCE_MAX,
    
                  # To create a Performance Max for travel goals campaign, you need to set
                  # `hotelPropertyAssetSet`.
                  hotelPropertyAssetSet => $hotel_property_asset_set_resource_name,
    
                  # Bidding strategy must be set directly on the campaign.
                  # Setting a portfolio bidding strategy by resource name is not supported.
                  # Max Conversion and Max 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 Max 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::V16::Common::MaximizeConversionValue->
                    new({
                      targetRoas => 3.5
                    })})})});
    }
          

  • به جای ایجاد یک گروه دارایی از ابتدا، اکنون می توانید از پیشنهاد TravelAssetSugestionService.SuggestTravelAssets هنگام ایجاد گروه دارایی استفاده کنید. اگر دارایی‌های پیشنهادی کافی نیست، باید دارایی‌های بیشتری اضافه کنید تا حداقل دارایی مورد نیاز حداکثر عملکرد را برآورده کنید.

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

    جاوا

    // Link the previously created hotel property asset to the asset group. In the real-world
    // scenario, you'd need to do this step several times for each hotel property asset.
    AssetGroupAsset hotelProperyAssetGroupAsset =
        AssetGroupAsset.newBuilder()
            .setAsset(hotelPropertyAssetResourceName)
            .setAssetGroup(assetGroupResourceName)
            .setFieldType(AssetFieldType.HOTEL_PROPERTY)
            .build();
    // Adds an operation to link the hotel property asset to the asset group.
    mutateOperations.add(
        MutateOperation.newBuilder()
            .setAssetGroupAssetOperation(
                AssetGroupAssetOperation.newBuilder().setCreate(hotelProperyAssetGroupAsset))
            .build());
          

    سی شارپ

    // Link the previously created hotel property asset to the asset group. In the
    // real-world scenario, you'd need to do this step several times for each hotel property
    // asset.
    AssetGroupAsset hotelPropertyAssetGroupAsset = new AssetGroupAsset
    {
        Asset = hotelPropertyAssetResourceName,
        AssetGroup = assetGroupResourceName,
        FieldType = AssetFieldType.HotelProperty
    };
    
    // Adds an operation to link the hotel property asset to the asset group.
    mutateOperations.Add(new MutateOperation
    {
        AssetGroupAssetOperation = new AssetGroupAssetOperation
        {
            Create = hotelPropertyAssetGroupAsset
        }
    });
          

    PHP

    // Link the previously created hotel property asset to the asset group. In the real-world
    // scenario, you'd need to do this step several times for each hotel property asset.
    $operations[] = new MutateOperation([
        'asset_group_asset_operation' => new AssetGroupAssetOperation([
            'create' => new AssetGroupAsset([
                'asset' => $hotelPropertyAssetResourceName,
                'asset_group' => $assetGroupResourceName,
                'field_type' => AssetFieldType::HOTEL_PROPERTY
            ])
        ])
    ]);
          

    پایتون

    # Link the previously created hotel property asset to the asset group. If
    # there are multiple assets, these steps to create a new operation need to
    # be performed for each asset.
    asset_group_asset_mutate_operation = client.get_type("MutateOperation")
    asset_group_asset = (
        asset_group_asset_mutate_operation.asset_group_asset_operation.create
    )
    asset_group_asset.asset = hotel_property_asset_resource_name
    asset_group_asset.asset_group = asset_group_resource_name
    asset_group_asset.field_type = (
        client.enums.AssetFieldTypeEnum.HOTEL_PROPERTY
    )
    operations.append(asset_group_asset_mutate_operation)
          

    روبی

    # Link the previously created hotel property asset to the asset group.
    # In the real-world scenario, you'd need to do this step several times for
    # each hotel property asset.
    operations << client.operation.mutate do |m|
      m.asset_group_asset_operation =
        client.operation.create_resource.asset_group_asset do |aga|
          aga.field_type = :HOTEL_PROPERTY
          aga.asset_group =
            client.path.asset_group(customer_id, ASSET_GROUP_TEMPORARY_ID)
          aga.asset = hotel_property_asset_resource_name
        end
    end
          

    پرل

    # Link the previously created hotel property asset to the asset group. In the real-world
    # scenario, you'd need to do this step several times for each hotel property asset.
    push @$operations,
      Google::Ads::GoogleAds::V16::Services::GoogleAdsService::MutateOperation->
      new({
        assetGroupAssetOperation =>
          Google::Ads::GoogleAds::V16::Services::AssetGroupAssetService::AssetGroupAssetOperation
          ->new({
            create =>
              Google::Ads::GoogleAds::V16::Resources::AssetGroupAsset->new({
                asset      => $hotel_property_asset_resource_name,
                assetGroup => $asset_group_resource_name,
                fieldType  => HOTEL_PROPERTY
              })})});