전환 액션 만들기

이 가이드에서는 Google Ads API를 사용하여 만들 수 있는 다양한 유형의 전환 액션 목록, 이러한 전환 액션이 Google Ads 웹 인터페이스에 매핑되는 방법에 대한 정보, 새 전환 액션을 만드는 방법을 보여주는 자세한 코드 예를 제공합니다.

전환을 측정하려면 추적하려는 전환 액션의 typeConversionAction를 설정하세요. 예를 들어 온라인 구매와 전화 통화는 다른 전환 액션이 필요합니다.

API에서 새 전환 액션을 설정하는 가장 좋은 방법은 아래의 전환 액션 코드 추가 예를 사용하는 것입니다. 이 샘플은 모든 백그라운드 인증 작업을 처리하고 ConversionAction을 만드는 과정을 안내합니다.

또한 대부분의 전환 액션을 추적하려면 광고주가 추가 단계를 거쳐야 합니다. 예를 들어 웹사이트에서 전환을 추적하려면 웹사이트의 전환 페이지에 태그라는 코드 스니펫을 추가해야 합니다. 기타 전환 액션 요구사항은 고객센터 도움말을 참고하세요.

웹사이트 전환

웹사이트 전환을 이용하면 온라인 판매, 링크 클릭, 페이지 조회, 가입 등의 웹사이트 액션을 추적할 수 있습니다.

웹사이트에서 전환을 추적하려면 ConversionActionTypeWEBPAGE로 설정하여 ConversionAction를 만들고 태그라는 코드 스니펫을 웹사이트의 전환 페이지에 추가해야 합니다.

ConversionAction에는 API 내에서 ConversionActiontag_snippets 필드에 나열된 각 TagSnippettype 필드로 구분되는 여러 유형의 웹사이트 전환이 포함됩니다.

TagSnippet는 전환 액션을 추적하기 위해 웹사이트에 포함해야 하는 추적 코드를 제공합니다. 웹사이트전화번호 클릭 전환에는 event_snippet이 필요합니다. event_snippet은 결제 확인 또는 리드 양식 제출 페이지와 같은 전환 액션을 나타내는 웹페이지에 배치해야 하며 global_site_tag는 웹사이트의 모든 페이지에 설치해야 합니다. ConversionActionService를 사용하여 이러한 두 속성을 모두 검색할 수 있습니다. 페이지에 태그를 추가하는 방법에 관한 자세한 내용은 고객센터를 참고하세요.

다음 표에서는 Google Ads 웹 인터페이스에서 각 소스에 사용할 수 있는 API 매개변수를 보여줍니다.

추적 코드 유형 Google Ads 소스
WEBPAGE 웹사이트, 웹사이트 (Google 애널리틱스 (GA4))
WEBPAGE_ONCLICK 웹사이트, 웹사이트 (Google 애널리틱스 (GA4))
CLICK_TO_CALL 전화번호 클릭
--- 웹사이트 (Google 애널리틱스 (UA))

앱 전환

앱 전환을 사용하면 Google Play 스토어에서 모바일 앱 설치 또는 인앱 구매를 추적할 수 있습니다.

다음 표에는 Google Ads 웹 인터페이스에서 각 소스에 사용할 수 있는 ConversionActionType API 매개변수가 나와 있습니다.

전환 액션 유형 Google Ads 소스
GOOGLE_PLAY_DOWNLOAD Google Play > 설치
GOOGLE_PLAY_IN_APP_PURCHASE Google Play > 인앱 구매

Google 애널리틱스 4 속성 또는 서드 파티 앱 애널리틱스를 사용하여 다른 모바일 앱 액션을 추적하려는 경우 추가 전환 액션 유형을 참고하세요.

전화 통화 전환

전화 통화 전환 추적을 사용하면 광고에서 연결된 통화, 웹사이트에 표시된 전화번호로 건 통화, 모바일 사이트의 전화번호 클릭을 추적할 수 있습니다.

다음 표에는 Google Ads 웹 인터페이스에서 각 소스에 사용할 수 있는 ConversionActionType API 매개변수가 나와 있습니다.

전환 액션 유형 Google Ads 소스
AD_CALL 전화번호 광고 확장이 사용된 광고 또는 통화 전용 광고에서 연결된 통화
WEBSITE_CALL 웹사이트에 게시된 전화번호로 걸려온 전화
CLICK_TO_CALL 모바일 웹사이트의 전화번호 클릭수

CLICK_TO_CALL 유형은 실제 전화 통화를 추적하지 않는다는 점에서 AD_CALL 유형과 다릅니다. 대신 CLICK_TO_CALL는 휴대기기의 전화번호 클릭만 추적합니다. 이 기능은 Google 착신 전화번호를 사용하여 전화 통화를 추적할 수 없는 경우에 유용합니다.

AD_CALL

AD_CALL 전환 액션은 Google Ads 웹 인터페이스에서 광고에서 연결된 통화 전환으로 표시됩니다. AD_CALL 전환 액션을 만든 후 CallAsset을 만들 때 call_conversion_action 필드에 해당 리소스 이름을 지정합니다. 전화번호 확장 소재를 사용하면 광고에 전화번호를 직접 표시할 수 있습니다.

통화가 지정된 시간보다 오래 지속되면 전환으로 보고됩니다. 기본값은 60초입니다.

WEBSITE_CALL

WEBSITE_CALL 전환 액션은 Google Ads 웹 인터페이스에서 웹사이트에서 걸려오는 통화 전환으로 표시됩니다.

AD_CALL와 달리 이 추적기는 event_snippetglobal_site_tag를 웹사이트에 추가해야 웹사이트에 등록된 전화번호에서 통화 추적을 위한 동적 Google 착신 전화번호를 가져올 수 있습니다. 또한 전화번호 확장 소재를 설정하고 고객, 캠페인 또는 광고그룹 수준에서 연결해야 합니다.

오프라인 전환 가져오기

다음 표에는 Google Ads 웹 인터페이스에서 각 소스에 사용할 수 있는 ConversionActionType API 매개변수와 특정 전환 액션 유형의 문서 링크가 나와 있습니다.

전환 액션 유형 Google Ads 소스 API 설정 가이드
UPLOAD_CLICKS 클릭에서 발생한 전환 및 리드 확보용 향상된 전환 추적하기 업로드 클릭 가이드
리드 확보용 향상된 전환 가이드
UPLOAD_CALLS 통화에서 전환 추적 API 설정 가이드
STORE_SALES 전환 매장 판매 추적 API 설정 가이드

웹용 향상된 전환

웹용 향상된 전환을 사용하면 전환 이벤트 발생 후 24시간 이내에 WEBPAGE 전환 액션의 퍼스트 파티 전환 데이터를 동시에 전송할 수 없습니다. 이를 통해 고객 데이터베이스나 CRM 시스템과 같은 다양한 소스에서 퍼스트 파티 데이터를 찾을 수 있습니다.

추가 전환 액션 유형

Google Ads API를 사용하면 보고서에서 추가 전환 액션 유형을 사용할 수 있지만 이러한 액션의 생성 또는 수정이 제한되거나 금지될 수 있습니다.

SKAdNetwork 전환수

iOS 앱 캠페인을 실행하고 SKAdNetwork를 구현한 경우 다음 리소스를 사용하여 CustomerCampaign 수준에서 Google에 제공된 SKAdNetwork 데이터에 액세스할 수 있습니다.

보고서 필드 설명
metrics.sk_ad_network_conversions Apple에서 보고한 전환수입니다. 이 측정항목은 segments.sk_ad_network_conversion_value 및 날짜 관련 세그먼트의 조합으로만 분류할 수 있습니다.
segments.sk_ad_network_conversion_value

Apple에서 보고한 전환 가치입니다. 이 세그먼트는 metrics.sk_ad_network_conversions 이외의 측정항목에 적용할 수 없으며 날짜 관련 세그먼트와만 결합할 수 있습니다.

Apple이 값을 0로 보고하면 0 값이 반환되고 그렇지 않은 경우 값이 반환되지 않습니다. 필드 존재를 확인하여 두 경우를 구분합니다.

CustomerSkAdNetworkConversionValueSchema를 통해 iOS 앱을 사용하는 연결된 특정 고객에 대한 SKAdNetwork 전환 가치 매핑을 저장할 수도 있습니다.

샘플 Python 코드

#!/usr/bin/env python
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import argparse
import sys

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException

def main(client, customer_id):
    """Adds a keyword plan, campaign, ad group, etc. to the customer account.

    Also handles errors from the API and prints them.

    Args:
        client: An initialized instance of GoogleAdsClient
        customer_id: A str of the customer_id to use in requests.
    """

    res = update_skan_cv_schema(
        client, customer_id, "my_app_id", "account_link_id"
    )
    print(res)

def update_skan_cv_schema(client, customer_id, app_id, account_link_id):
    skan_service = client.get_service(
        "CustomerSkAdNetworkConversionValueSchemaService"
    )

    req = client.get_type(
        "MutateCustomerSkAdNetworkConversionValueSchemaRequest"
    )
    operation = client.get_type(
        "CustomerSkAdNetworkConversionValueSchemaOperation"
    )
    schema_instance = client.get_type(
        "CustomerSkAdNetworkConversionValueSchema"
    )

    new_schema = operation.update
    new_schema.resource_name = (
        skan_service.customer_sk_ad_network_conversion_value_schema_path(
            "customer_id", "account_link_id"
        )
    )
    new_schema.schema.app_id = app_id
    new_schema.schema.measurement_window_hours = 48

    skan_cv_mapping = (
        schema_instance.SkAdNetworkConversionValueSchema.FineGrainedConversionValueMappings()
    )
    skan_cv_mapping.fine_grained_conversion_value = 0  # 0 - 63
    skan_cv_mapping.conversion_value_mapping.min_time_post_install_hours = 0
    skan_cv_mapping.conversion_value_mapping.max_time_post_install_hours = 48

    skan_cv_event = schema_instance.SkAdNetworkConversionValueSchema.Event()
    skan_cv_event.mapped_event_name = "TEST"
    skan_cv_event.event_revenue_value = 10

    skan_cv_mapping.conversion_value_mapping.mapped_events.append(skan_cv_event)
    new_schema.schema.fine_grained_conversion_value_mappings.append(
        skan_cv_mapping
    )

    req.operation = operation
    req.customer_id = customer_id

    res = skan_service.mutate_customer_sk_ad_network_conversion_value_schema(
        req
    )
    return res

if __name__ == "__main__":
    # GoogleAdsClient will read the google-ads.yaml configuration file in the
    # home directory if none is specified.
    googleads_client = GoogleAdsClient.load_from_storage(
        version="v16"
    )

    parser = argparse.ArgumentParser(
        description="Creates a keyword plan for specified customer."
    )
    # The following argument(s) should be provided to run the example.
    parser.add_argument(
        "-c",
        "--customer_id",
        type=str,
        required=True,
        help="The Google Ads customer ID.",
    )
    args = parser.parse_args()

    try:
        main(googleads_client, args.customer_id)
    except GoogleAdsException as ex:
        print(
            f'Request with ID "{ex.request_id}" failed with status '
            f'"{ex.error.code().name}" and includes the following errors:'
        )
        for error in ex.failure.errors:
            print(f'\tError with message "{error.message}".')
            if error.location:
                for field_path_element in error.location.field_path_elements:
                    print(f"\t\tOn field: {field_path_element.field_name}")
        sys.exit(1)
  

Google 애널리틱스

연결된 Google 애널리틱스 속성의 전환은 다음 type 값 중 하나를 갖습니다.

  • GA4 속성 전환:

    • GOOGLE_ANALYTICS_4_CUSTOM
    • GOOGLE_ANALYTICS_4_PURCHASE

    google_analytics_4_settings 필드에서 GA4 속성 ID, 속성 이름, 이벤트 이름을 가져올 수도 있습니다.

  • 유니버설 애널리틱스 속성 전환:

    • UNIVERSAL_ANALYTICS_GOAL
    • UNIVERSAL_ANALYTICS_TRANSACTION

GA4 속성 전환을 다음과 같이 변경할 수 있습니다.

  • status 필드를 HIDDEN에서 ENABLED로 수정하여 GA4 속성에서 Google Ads 계정으로 전환을 가져옵니다.
  • primary_for_goalcategory 필드를 수정하여 Google Ads 입찰 및 보고서에 미치는 영향을 표시합니다.
  • name 또는 value_settings를 업데이트합니다.
  • remove 작업을 사용하여 Google Ads 계정에서 전환을 삭제합니다.

가져온 GA4 전환의 다른 속성이나 가져온 유니버설 애널리틱스 전환의 모든 속성을 수정하려고 하면 MUTATE_NOT_ALLOWED 오류가 발생합니다. 이러한 변경은 Google Ads UI를 통해서만 가능합니다.

Firebase 및 서드 파티 앱 애널리틱스

서드 파티 앱 애널리틱스 또는 Firebase 전환을 가져오려면 ConversionActionServicemutate 메서드를 사용하여 ConversionActionstatusHIDDEN에서 ENABLED로 변경합니다. 이러한 전환 액션의 경우 app_id 업데이트가 지원되지 않습니다.

  • FIREBASE_ANDROID_FIRST_OPEN
  • FIREBASE_ANDROID_IN_APP_PURCHASE
  • FIREBASE_ANDROID_CUSTOM
  • FIREBASE_IOS_FIRST_OPEN
  • FIREBASE_IOS_IN_APP_PURCHASE
  • FIREBASE_IOS_CUSTOM
  • THIRD_PARTY_APP_ANALYTICS_ANDROID_FIRST_OPEN
  • THIRD_PARTY_APP_ANALYTICS_ANDROID_IN_APP_PURCHASE
  • THIRD_PARTY_APP_ANALYTICS_ANDROID_CUSTOM
  • THIRD_PARTY_APP_ANALYTICS_IOS_FIRST_OPEN
  • THIRD_PARTY_APP_ANALYTICS_IOS_IN_APP_PURCHASE
  • THIRD_PARTY_APP_ANALYTICS_IOS_CUSTOM

오프라인 매장 판매

Google Ads API를 사용하여 STORE_SALES 또는 STORE_SALES_DIRECT_UPLOAD 전환 액션을 만들 수는 없지만 API는 매장 판매 거래 업로드를 지원합니다.

  • STORE_SALES
  • STORE_SALES_DIRECT_UPLOAD

기타

다음 전환 액션 유형은 Google Ads API에서 읽기 전용이며 보고용으로 제공됩니다.

  • ANDROID_APP_PRE_REGISTRATION
  • ANDROID_INSTALLS_ALL_OTHER_APPS
  • FLOODLIGHT_ACTION
  • FLOODLIGHT_TRANSACTION
  • GOOGLE_HOSTED
  • LEAD_FORM_SUBMIT
  • SALESFORCE
  • SEARCH_ADS_360
  • SMART_CAMPAIGN_AD_CLICKS_TO_CALL
  • SMART_CAMPAIGN_MAP_CLICKS_TO_CALL
  • SMART_CAMPAIGN_MAP_DIRECTIONS
  • SMART_CAMPAIGN_TRACKED_CALLS
  • STORE_VISITS
  • WEBPAGE_CODELESS

알 수 없음

Google Ads 계정에 다른 유형의 전환 액션이 포함된 경우 쿼리 및 보고서가 ConversionAction.typeUNKNOWN인 전환 액션을 반환할 수 있습니다. API는 이러한 전환 액션의 관리를 지원하지 않지만 metrics.conversionsmetrics.conversions_value와 같은 주요 전환 측정항목의 전체 결과를 제공하기 위해 보고서에 해당 전환 액션을 반환합니다.

코드 예시

다음 코드 예에서는 새 전환 액션을 만드는 과정을 안내합니다. 구체적으로는 typeUPLOAD_CLICKS로 설정된 전환 액션을 만듭니다. 가져오기 > API 또는 업로드를 사용하여 수동 가져오기 > 클릭에서 전환 추적을 사용하여 새 전환 액션을 만드는 것과 동일한 Google Ads UI 흐름입니다. 또한 categoryDEFAULT로 설정합니다.

다음 기본 설정이 적용됩니다.

Java

private void runExample(GoogleAdsClient googleAdsClient, long customerId) {

  // Creates a ConversionAction.
  ConversionAction conversionAction =
      ConversionAction.newBuilder()
          // Note that conversion action names must be unique. If a conversion action already
          // exists with the specified conversion_action_name the create operation will fail with
          // a ConversionActionError.DUPLICATE_NAME error.
          .setName("Earth to Mars Cruises Conversion #" + getPrintableDateTime())
          .setCategory(ConversionActionCategory.DEFAULT)
          .setType(ConversionActionType.WEBPAGE)
          .setStatus(ConversionActionStatus.ENABLED)
          .setViewThroughLookbackWindowDays(15L)
          .setValueSettings(
              ValueSettings.newBuilder()
                  .setDefaultValue(23.41)
                  .setAlwaysUseDefaultValue(true)
                  .build())
          .build();

  // Creates the operation.
  ConversionActionOperation operation =
      ConversionActionOperation.newBuilder().setCreate(conversionAction).build();

  try (ConversionActionServiceClient conversionActionServiceClient =
      googleAdsClient.getLatestVersion().createConversionActionServiceClient()) {
    MutateConversionActionsResponse response =
        conversionActionServiceClient.mutateConversionActions(
            Long.toString(customerId), Collections.singletonList(operation));
    System.out.printf("Added %d conversion actions:%n", response.getResultsCount());
    for (MutateConversionActionResult result : response.getResultsList()) {
      System.out.printf(
          "New conversion action added with resource name: '%s'%n", result.getResourceName());
    }
  }
}
      

C#

public void Run(GoogleAdsClient client, long customerId)
{
    // Get the ConversionActionService.
    ConversionActionServiceClient conversionActionService =
        client.GetService(Services.V16.ConversionActionService);

    // Note that conversion action names must be unique.
    // If a conversion action already exists with the specified name the create operation
    // will fail with a ConversionAction.DUPLICATE_NAME error.
    string ConversionActionName = "Earth to Mars Cruises Conversion #"
        + ExampleUtilities.GetRandomString();

    // Add a conversion action.
    ConversionAction conversionAction = new ConversionAction()
    {
        Name = ConversionActionName,
        Category = ConversionActionCategory.Default,
        Type = ConversionActionType.Webpage,
        Status = ConversionActionStatus.Enabled,
        ViewThroughLookbackWindowDays = 15,
        ValueSettings = new ConversionAction.Types.ValueSettings()
        {
            DefaultValue = 23.41,
            AlwaysUseDefaultValue = true
        }
    };

    // Create the operation.
    ConversionActionOperation operation = new ConversionActionOperation()
    {
        Create = conversionAction
    };

    try
    {
        // Create the conversion action.
        MutateConversionActionsResponse response =
            conversionActionService.MutateConversionActions(customerId.ToString(),
                    new ConversionActionOperation[] { operation });

        // Display the results.
        foreach (MutateConversionActionResult newConversionAction in response.Results)
        {
            Console.WriteLine($"New conversion action with resource name = " +
                $"'{newConversionAction.ResourceName}' was added.");
        }
    }
    catch (GoogleAdsException e)
    {
        Console.WriteLine("Failure:");
        Console.WriteLine($"Message: {e.Message}");
        Console.WriteLine($"Failure: {e.Failure}");
        Console.WriteLine($"Request ID: {e.RequestId}");
        throw;
    }
}
      

2,399필리핀

public static function runExample(GoogleAdsClient $googleAdsClient, int $customerId)
{
    // Creates a conversion action.
    $conversionAction = new ConversionAction([
        // Note that conversion action names must be unique.
        // If a conversion action already exists with the specified conversion_action_name
        // the create operation will fail with a ConversionActionError.DUPLICATE_NAME error.
        'name' => 'Earth to Mars Cruises Conversion #' . Helper::getPrintableDatetime(),
        'category' => ConversionActionCategory::PBDEFAULT,
        'type' => ConversionActionType::WEBPAGE,
        'status' => ConversionActionStatus::ENABLED,
        'view_through_lookback_window_days' => 15,
        'value_settings' => new ValueSettings([
            'default_value' => 23.41,
            'always_use_default_value' => true
        ])
    ]);

    // Creates a conversion action operation.
    $conversionActionOperation = new ConversionActionOperation();
    $conversionActionOperation->setCreate($conversionAction);

    // Issues a mutate request to add the conversion action.
    $conversionActionServiceClient = $googleAdsClient->getConversionActionServiceClient();
    $response = $conversionActionServiceClient->mutateConversionActions(
        MutateConversionActionsRequest::build($customerId, [$conversionActionOperation])
    );

    printf("Added %d conversion actions:%s", $response->getResults()->count(), PHP_EOL);

    foreach ($response->getResults() as $addedConversionAction) {
        /** @var ConversionAction $addedConversionAction */
        printf(
            "New conversion action added with resource name: '%s'%s",
            $addedConversionAction->getResourceName(),
            PHP_EOL
        );
    }
}
      

Python

def main(client, customer_id):
    conversion_action_service = client.get_service("ConversionActionService")

    # Create the operation.
    conversion_action_operation = client.get_type("ConversionActionOperation")

    # Create conversion action.
    conversion_action = conversion_action_operation.create

    # Note that conversion action names must be unique. If a conversion action
    # already exists with the specified conversion_action_name, the create
    # operation will fail with a ConversionActionError.DUPLICATE_NAME error.
    conversion_action.name = f"Earth to Mars Cruises Conversion {uuid.uuid4()}"
    conversion_action.type_ = (
        client.enums.ConversionActionTypeEnum.UPLOAD_CLICKS
    )
    conversion_action.category = (
        client.enums.ConversionActionCategoryEnum.DEFAULT
    )
    conversion_action.status = client.enums.ConversionActionStatusEnum.ENABLED
    conversion_action.view_through_lookback_window_days = 15

    # Create a value settings object.
    value_settings = conversion_action.value_settings
    value_settings.default_value = 15.0
    value_settings.always_use_default_value = True

    # Add the conversion action.
    conversion_action_response = (
        conversion_action_service.mutate_conversion_actions(
            customer_id=customer_id,
            operations=[conversion_action_operation],
        )
    )

    print(
        "Created conversion action "
        f'"{conversion_action_response.results[0].resource_name}".'
    )
      

Ruby

def add_conversion_action(customer_id)
  # GoogleAdsClient will read a config file from
  # ENV['HOME']/google_ads_config.rb when called without parameters
  client = Google::Ads::GoogleAds::GoogleAdsClient.new


  # Add a conversion action.
  conversion_action = client.resource.conversion_action do |ca|
    ca.name = "Earth to Mars Cruises Conversion #{(Time.new.to_f * 100).to_i}"
    ca.type = :UPLOAD_CLICKS
    ca.category = :DEFAULT
    ca.status = :ENABLED
    ca.view_through_lookback_window_days = 15

    # Create a value settings object.
    ca.value_settings = client.resource.value_settings do |vs|
      vs.default_value = 15
      vs.always_use_default_value = true
    end
  end

  # Create the operation.
  conversion_action_operation = client.operation.create_resource.conversion_action(conversion_action)

  # Add the ad group ad.
  response = client.service.conversion_action.mutate_conversion_actions(
    customer_id: customer_id,
    operations: [conversion_action_operation],
  )

  puts "New conversion action with resource name = #{response.results.first.resource_name}."
end
      

Perl

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

  # Note that conversion action names must be unique.
  # If a conversion action already exists with the specified conversion_action_name,
  # the create operation fails with error ConversionActionError.DUPLICATE_NAME.
  my $conversion_action_name = "Earth to Mars Cruises Conversion #" . uniqid();

  # Create a conversion action.
  my $conversion_action =
    Google::Ads::GoogleAds::V16::Resources::ConversionAction->new({
      name                          => $conversion_action_name,
      category                      => DEFAULT,
      type                          => WEBPAGE,
      status                        => ENABLED,
      viewThroughLookbackWindowDays => 15,
      valueSettings                 =>
        Google::Ads::GoogleAds::V16::Resources::ValueSettings->new({
          defaultValue          => 23.41,
          alwaysUseDefaultValue => "true"
        })});

  # Create a conversion action operation.
  my $conversion_action_operation =
    Google::Ads::GoogleAds::V16::Services::ConversionActionService::ConversionActionOperation
    ->new({create => $conversion_action});

  # Add the conversion action.
  my $conversion_actions_response =
    $api_client->ConversionActionService()->mutate({
      customerId => $customer_id,
      operations => [$conversion_action_operation]});

  printf "New conversion action added with resource name: '%s'.\n",
    $conversion_actions_response->{results}[0]{resourceName};

  return 1;
}
      

이 예는 클라이언트 라이브러리의 리마케팅 폴더와 코드 예시 컬렉션(전환 액션 추가 코드 예)에서도 찾을 수 있습니다.

확인

Google Ads 및 Google Ads API는 다양한 전환 액션을 지원하므로 일부 유효성 검사 규칙은 액션의 type에 따라 다릅니다.

전환 액션을 만들 때 가장 흔히 발생하는 오류는 DUPLICATE_NAME입니다. 전환 액션별로 고유한 이름을 사용해야 합니다.

다음은 ConversionAction 필드를 설정하는 방법에 관한 몇 가지 도움말입니다.

모든 enum 필드
enum 필드를 UNKNOWN로 설정하려고 하면 RequestError.INVALID_ENUM_VALUE 오류가 발생합니다.
app_id
app_id 속성은 변경할 수 없으며 새 앱 전환을 만들 때만 설정할 수 있습니다.
attribution_model_settings
이 옵션을 지원 중단된 옵션으로 설정하면 CANNOT_SET_RULE_BASED_ATTRIBUTION_MODELS 오류가 발생합니다. Google Ads에서는 GOOGLE_ADS_LAST_CLICKGOOGLE_SEARCH_ATTRIBUTION_DATA_DRIVEN만 지원합니다.
click_through_lookback_window_days

이 속성을 허용된 범위를 벗어난 값으로 설정하면 RangeError.TOO_LOW 또는 RangeError.TOO_HIGH 오류가 발생합니다.

이 속성은 AD_CALL 또는 WEBSITE_CALL 전환 액션의 [1,60] 범위 내에 있어야 합니다. 대부분의 다른 전환 액션에서 허용되는 범위는 [1,30]입니다.

include_in_conversions_metric

create 또는 update 작업에서 이 값을 설정하면 FieldError.IMMUTABLE_FIELD 오류와 함께 실패합니다. 대신 전환 목표 가이드의 설명에 따라 primary_for_goal를 설정하세요.

phone_call_duration_seconds

통화 이외의 전환 액션에 이 속성을 설정하려고 하면 FieldError.VALUE_MUST_BE_UNSET 오류가 발생합니다.

type

type 속성은 변경할 수 없으며 새 전환을 만들 때만 설정할 수 있습니다.

전환 액션을 typeUNKNOWN와 같음으로 업데이트하면 MutateError.MUTATE_NOT_ALLOWED 오류가 발생합니다.

value_settings

WEBSITE_CALL 또는 AD_CALL 전환 액션의 value_settings에서 always_use_default_valuetrue로 설정되어야 합니다. 이 값을 만들거나 업데이트할 때 false 값을 지정하면 INVALID_VALUE 오류가 발생합니다.

view_through_lookback_window_days

이 속성을 허용된 범위를 벗어난 값으로 설정하면 RangeError.TOO_LOW 또는 RangeError.TOO_HIGH 오류가 발생합니다. 대부분의 전환 액션에서 허용되는 범위는 [1,30]입니다.

이 속성은 AD_CALL 또는 WEBSITE_CALL 전환 액션에는 설정할 수 없습니다. 값을 지정하면 VALUE_MUST_BE_UNSET 오류가 발생합니다.