อัปโหลด Conversion การคลิก

คุณสามารถใช้ Google Ads API เพื่ออัปโหลด Conversion จากการคลิกแบบออฟไลน์ ไปยัง Google Ads เพื่อติดตามโฆษณาที่นําไปสู่ยอดขายในโลกออฟไลน์ เช่น ทางโทรศัพท์หรือผ่านตัวแทนฝ่ายขาย

ตั้งค่า

การตั้งค่า Conversion ออฟไลน์ที่ใช้งานได้ต้องมีข้อกำหนดเบื้องต้นบางอย่าง โปรดตรวจสอบว่าคุณมีคุณสมบัติตรงตามข้อกำหนดเบื้องต้นทั้งหมดก่อนดำเนินการติดตั้งใช้งาน

  1. เปิดใช้เครื่องมือวัด Conversion ในบัญชีลูกค้า Conversion โฆษณาของ Google Ads

  2. กำหนดค่าการติดแท็กและจัดเก็บรหัสคลิก

1. เปิดใช้เครื่องมือวัด Conversion ในบัญชีลูกค้า Conversion โฆษณาของ Google Ads

หากทําตามคู่มือเริ่มต้นใช้งานเครื่องมือวัด Conversion และ เปิดใช้เครื่องมือวัด Conversion แล้ว ให้ข้ามไปที่ ขั้นตอนที่ 2: กําหนดค่าการติดแท็ก

ดึงข้อมูลเกี่ยวกับการตั้งค่าเครื่องมือวัด Conversion

คุณสามารถตรวจสอบการตั้งค่าเครื่องมือวัด Conversion ของบัญชีและยืนยันว่าได้เปิดใช้เครื่องมือวัด Conversion แล้วโดยการค้นหาแหล่งข้อมูล Customer สําหรับ ConversionTrackingSetting ส่งคําค้นหาต่อไปนี้ด้วย GoogleAdsService.SearchStream

SELECT
  customer.conversion_tracking_setting.google_ads_conversion_customer,
  customer.conversion_tracking_setting.conversion_tracking_status,
  customer.conversion_tracking_setting.conversion_tracking_id,
  customer.conversion_tracking_setting.cross_account_conversion_tracking_id
FROM customer

ฟิลด์ google_ads_conversion_customer จะระบุบัญชี Google Ads ที่สร้างและจัดการ Conversion สําหรับลูกค้ารายนี้ สำหรับลูกค้าที่ใช้ เครื่องมือวัด Conversion ข้ามบัญชี ติดตาม ฟิลด์นี้จะเป็นรหัส ของบัญชีดูแลจัดการ คุณควรระบุรหัสลูกค้า Conversion ของ Google Ads เป็น customer_id ในคําขอ Google Ads API เพื่อสร้างและจัดการ Conversion โปรดทราบว่าระบบจะป้อนข้อมูลในฟิลด์นี้แม้ว่าจะไม่ได้เปิดใช้เครื่องมือวัด Conversion ก็ตาม

ฟิลด์ conversion_tracking_status จะระบุว่าได้เปิดใช้เครื่องมือวัด Conversion แล้วหรือไม่ และบัญชี ใช้เครื่องมือวัด Conversion ข้ามบัญชีหรือไม่

สร้างการกระทำที่ถือเป็น Conversion ภายใต้บัญชีลูกค้า Conversion โฆษณาของ Google Ads

หากค่า conversion_tracking_status เป็น NOT_CONVERSION_TRACKED แสดงว่าบัญชีไม่ได้เปิดใช้เครื่องมือวัด Conversion เปิดใช้เครื่องมือวัด Conversion โดยสร้าง ConversionAction อย่างน้อย 1 รายการใน บัญชี Conversion ของ Google Ads เช่น ในตัวอย่างต่อไปนี้ หรือคุณ จะสร้างการกระทําที่ถือเป็น Conversion ใน UI โดยทําตามวิธีการใน บทความในศูนย์ช่วยเหลือของ Google Ads เกี่ยวกับการตั้งค่าเครื่องมือวัด Conversion สําหรับประเภท Conversion ที่คุณต้องการเปิดใช้ก็ได้

โปรดทราบว่าระบบจะเปิดใช้ Conversion ที่ปรับปรุงแล้วโดยอัตโนมัติเมื่อส่งผ่าน Google Ads API แต่คุณสามารถปิดใช้ได้ผ่าน UI ของ Google Ads

ตัวอย่างโค้ด

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.V25.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;
    }
}
      

PHP

    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: GoogleAdsClient, customer_id: str) -> None:
    conversion_action_service: ConversionActionServiceClient = (
        client.get_service("ConversionActionService")
    )

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

    # Create conversion action.
    conversion_action: ConversionAction = 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: ConversionAction.ValueSettings = (
        conversion_action.value_settings
    )
    value_settings.default_value = 15.0
    value_settings.always_use_default_value = True

    # Add the conversion action.
    conversion_action_response: MutateConversionActionsResponse = (
        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::V25::Resources::ConversionAction->new({
      name                          => $conversion_action_name,
      category                      => DEFAULT,
      type                          => WEBPAGE,
      status                        => ENABLED,
      viewThroughLookbackWindowDays => 15,
      valueSettings                 =>
        Google::Ads::GoogleAds::V25::Resources::ValueSettings->new({
          defaultValue          => 23.41,
          alwaysUseDefaultValue => "true"
        })});

  # Create a conversion action operation.
  my $conversion_action_operation =
    Google::Ads::GoogleAds::V25::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;
}
      

curl

ตรวจสอบว่าได้ตั้งค่า type เป็นค่า ConversionActionType ที่ถูกต้อง ดูคําแนะนําเพิ่มเติมเกี่ยวกับการสร้างการกระทําที่ถือเป็น Conversion ใน Google Ads API ได้ที่ สร้าง การกระทําที่ถือเป็น Conversion

ดึงข้อมูลการกระทําที่ถือเป็น Conversion ที่มีอยู่

คุณสามารถดึงข้อมูลรายละเอียดสําหรับการกระทําที่ถือเป็น Conversion ที่มีอยู่ได้โดยส่งคําค้นหาต่อไปนี้ ตรวจสอบว่าได้ตั้งค่ารหัสลูกค้าในคําขอเป็นบัญชีลูกค้า Conversion ของ Google Ads ที่คุณระบุไว้ก่อนหน้านี้ และตั้งค่าประเภทการกระทําที่ถือเป็น Conversion เป็นค่า ConversionActionType ที่ถูกต้อง

SELECT
  conversion_action.id,
  conversion_action.resource_name,
  conversion_action.name,
  conversion_action.type,
  conversion_action.category,
  conversion_action.status
FROM conversion_action

WHERE conversion_action.type = 'UPLOAD_CLICKS'

2. กำหนดค่าการติดแท็กและจัดเก็บรหัสคลิก

ทำตามวิธีการติดแท็กอัตโนมัติเพื่อยืนยันว่าได้เปิดใช้การติดแท็กอัตโนมัติแล้ว ตั้งค่าบัญชี Google Ads, เว็บไซต์ และระบบการติดตามโอกาสในการขายเพื่อบันทึกและจัดเก็บ GCLID สําหรับการแสดงผลแต่ละครั้ง รวมถึงพารามิเตอร์ของ URL GBRAID หรือ WBRAID สําหรับโฆษณา การติดแท็กอัตโนมัติจะเปิดอยู่โดยค่าเริ่มต้นสําหรับบัญชีใหม่

สร้างคําขอ

ทําตามคําแนะนําต่อไปนี้เพื่อสร้าง UploadClickConversionsRequest และตั้งค่า ฟิลด์เป็นค่าที่เหมาะสม

customer_id

ระบุบัญชี Google Ads ของการอัปโหลด ตั้งค่านี้เป็น ลูกค้า Conversion โฆษณาของ Google Ads ของบัญชีที่เป็น แหล่งที่มาของการคลิก

job_id

มีกลไกสําหรับเชื่อมโยงคําขออัปโหลดกับข้อมูลต่อคําขอ ใน ข้อมูลการวินิจฉัยข้อมูลออฟไลน์

หากคุณไม่ได้ตั้งค่าฟิลด์นี้ Google Ads API จะกําหนดค่าที่ไม่ซ้ำกันในช่วง [2^31, 2^63) ให้กับคําขอแต่ละรายการ หากต้องการจัดกลุ่มคําขอหลายรายการเป็นงานเชิงตรรกะเดียว ให้ตั้งค่าฟิลด์นี้เป็นค่าเดียวกันในช่วง [0, 2^31) ในคําขอทุกรายการในงาน

job_id ใน response มี รหัสงานสําหรับคําขอ ไม่ว่าคุณจะระบุค่าหรือให้ Google Ads API กําหนดค่าก็ตาม

partial_failure

กําหนดวิธีที่ Google Ads API จัดการข้อผิดพลาดจากการดําเนินการ

ฟิลด์นี้ต้องตั้งค่าเป็น true ทำตามหลักเกณฑ์ข้อผิดพลาดบางส่วน เมื่อประมวลผลการตอบกลับ

สร้างการดําเนินการ Conversion จากการคลิก

คอลเล็กชันออบเจ็กต์ ClickConversion ใน UploadClickConversionsRequest จะกําหนดชุด Conversion ที่คุณต้องการ อัปโหลด ทําตามคําแนะนําต่อไปนี้เพื่อสร้าง ClickConversion แต่ละรายการและตั้งค่าฟิลด์เป็นค่าที่เหมาะสม

ตั้งค่าฟิลด์ที่ต้องระบุของการดําเนินการ Conversion แต่ละรายการ

ทําตามวิธีการต่อไปนี้เพื่อตั้งค่าฟิลด์ที่ต้องระบุของ ClickConversion เป็นค่าที่เหมาะสม

gclid, gbraid, wbraid

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

  • gclid
  • gbraid
  • wbraid
conversion_date_time

วันที่และเวลาของ Conversion

ค่าต้องระบุเขตเวลา และรูปแบบต้องเป็น yyyy-mm-dd HH:mm:ss+|-HH:mm เช่น 2022-01-01 19:32:45-05:00 (ไม่รวมเวลาออมแสง)

เขตเวลาอาจเป็นค่าที่ถูกต้องใดก็ได้ โดย ไม่ จําเป็นต้องตรงกับเขตเวลาของบัญชี อย่างไรก็ตาม หากคุณวางแผนที่จะเปรียบเทียบข้อมูล Conversion ที่อัปโหลดกับข้อมูลใน UI ของ Google Ads เราขอแนะนําให้ใช้เขตเวลาเดียวกับบัญชี Google Ads เพื่อให้จํานวน Conversion ตรงกัน ดูรายละเอียดและตัวอย่างเพิ่มเติมได้ที่ เตรียมข้อมูลสําหรับการนําเข้า และดูรายการรหัสเขตเวลาที่ถูกต้องได้ที่ ตรวจสอบรหัสและรูปแบบ

user_identifiers

อย่าตั้งค่าฟิลด์นี้เมื่ออัปโหลด Conversion โดยใช้เฉพาะรหัสคลิก หากตั้งค่าฟิลด์นี้ Google Ads จะถือว่าการดําเนินการอัปโหลดเป็นการอัปโหลด Conversion ที่ปรับปรุงแล้วสําหรับโอกาสในการขาย

conversion_action

ชื่อแหล่งข้อมูลของ ConversionAction สําหรับ Conversion จากการคลิก

การกระทําที่ถือเป็น Conversion ต้องมี type เป็น UPLOAD_CLICKS และต้องมีอยู่ในบัญชีลูกค้า Conversion ของ Google Ads ของบัญชี Google Ads ที่เชื่อมโยงกับการคลิก

conversion_value

มูลค่าของ Conversion

currency_code

รหัสสกุลเงินของ conversion_value

ตั้งค่าฟิลด์ตัวเลือกของการดําเนินการ Conversion แต่ละรายการ

ตรวจสอบรายการฟิลด์ตัวเลือกต่อไปนี้และตั้งค่าใน ClickConversion ตามที่ต้องการ

order_id
รหัสธุรกรรมสําหรับ Conversion ฟิลด์นี้ไม่บังคับ แต่เราขอแนะนําอย่างยิ่ง หากตั้งค่าไว้ระหว่างการอัปโหลด คุณ ต้อง ใช้ค่าดังกล่าวสําหรับการ ปรับทั้งหมดที่ทํากับ Conversion ดูข้อมูลเพิ่มเติมเกี่ยวกับ วิธีใช้รหัสธุรกรรมเพื่อลดจํานวน Conversion ที่ซ้ำกันได้ที่ ใช้รหัสธุรกรรมเพื่อลดจํานวน Conversion ที่ซ้ำกัน
external_attribution_data

หากคุณใช้เครื่องมือของบุคคลที่สามหรือโซลูชันที่พัฒนาขึ้นเองเพื่อติดตาม Conversion คุณอาจต้องการให้ Google Ads ได้รับเครดิตเพียงบางส่วนสําหรับ Conversion หรืออาจต้องการกระจายเครดิตสําหรับ Conversion ไปยังการคลิกหลายรายการ การนําเข้า Conversion ที่มีการระบุแหล่งที่มาจากภายนอกช่วยให้คุณ อัปโหลด Conversion ที่มีการกําหนดเครดิตส่วนย่อยให้กับการคลิกแต่ละครั้งได้

หากต้องการอัปโหลดเครดิตบางส่วน ให้ตั้งค่าฟิลด์นี้เป็นออบเจ็กต์ ExternalAttributionData ที่มีค่าสําหรับ external_attribution_model และ external_attribution_credit

custom_variables

ค่าสําหรับ ตัวแปรที่กําหนดเองสําหรับ Conversion

Google Ads ไม่รองรับตัวแปรที่กําหนดเองสําหรับ Conversion ร่วมกับ wbraid หรือ gbraid

cart_data

คุณสามารถรวมข้อมูลรถเข็นช็อปปิ้งสําหรับ ClickConversion ใน ฟิลด์ cart_data ซึ่งประกอบด้วยแอตทริบิวต์ต่อไปนี้

  • merchant_id: รหัสของบัญชี Merchant Center ที่เชื่อมโยง
  • feed_country_code: รหัสภูมิภาค 2 ตัวอักษร ISO 3166 ของฟีด Merchant Center
  • feed_language_code: รหัสภาษา ISO 639-1 ของ ฟีด Merchant Center
  • local_transaction_cost: ผลรวมของส่วนลดทั้งหมดในระดับธุรกรรมใน currency_code ของ ClickConversion
  • items: สินค้าในรถเข็นช็อปปิ้ง

สินค้าแต่ละรายการใน items ประกอบด้วยแอตทริบิวต์ต่อไปนี้

  • product_id: รหัสผลิตภัณฑ์ ซึ่งบางครั้งเรียกว่า รหัสข้อเสนอหรือรหัสสินค้า
  • quantity: จํานวนสินค้า
  • unit_price: ราคาต่อหน่วยของสินค้า
conversion_environment

ระบุสภาพแวดล้อมที่บันทึก Conversion นี้ เช่น แอปหรือเว็บ

ตัวอย่างโค้ด

Java

private void runExample(
    GoogleAdsClient googleAdsClient,
    long customerId,
    long conversionActionId,
    String gclid,
    String gbraid,
    String wbraid,
    String conversionDateTime,
    Double conversionValue,
    Long conversionCustomVariableId,
    String conversionCustomVariableValue,
    String orderId,
    ConsentStatus adUserDataConsent)
    throws InvalidProtocolBufferException {
  // Verifies that exactly one of gclid, gbraid, and wbraid is specified, as required.
  // See https://developers.google.com/google-ads/api/docs/conversions/upload-clicks for details.
  long numberOfIdsSpecified =
      Arrays.asList(gclid, gbraid, wbraid).stream().filter(idField -> idField != null).count();
  if (numberOfIdsSpecified != 1) {
    throw new IllegalArgumentException(
        "Exactly 1 of gclid, gbraid, or wbraid is required, but "
            + numberOfIdsSpecified
            + " ID values were provided");
  }

  // Constructs the conversion action resource name from the customer and conversion action IDs.
  String conversionActionResourceName =
      ResourceNames.conversionAction(customerId, conversionActionId);

  // Creates the click conversion.
  ClickConversion.Builder clickConversionBuilder =
      ClickConversion.newBuilder()
          .setConversionAction(conversionActionResourceName)
          .setConversionDateTime(conversionDateTime)
          .setConversionValue(conversionValue)
          .setCurrencyCode("USD");

  // Sets the single specified ID field.
  if (gclid != null) {
    clickConversionBuilder.setGclid(gclid);
  } else if (gbraid != null) {
    clickConversionBuilder.setGbraid(gbraid);
  } else {
    clickConversionBuilder.setWbraid(wbraid);
  }

  if (conversionCustomVariableId != null && conversionCustomVariableValue != null) {
    // Sets the custom variable and value, if provided.
    clickConversionBuilder.addCustomVariables(
        CustomVariable.newBuilder()
            .setConversionCustomVariable(
                ResourceNames.conversionCustomVariable(customerId, conversionCustomVariableId))
            .setValue(conversionCustomVariableValue));
  }

  if (orderId != null) {
    // Sets the order ID (unique transaction ID), if provided.
    clickConversionBuilder.setOrderId(orderId);
  }

  // Sets the consent information, if provided.
  if (adUserDataConsent != null) {
    // Specifies whether user consent was obtained for the data you are uploading. See
    // https://www.google.com/about/company/user-consent-policy for details.
    clickConversionBuilder.setConsent(Consent.newBuilder().setAdUserData(adUserDataConsent));
  }
  ClickConversion clickConversion = clickConversionBuilder.build();

  // Creates the conversion upload service client.
  try (ConversionUploadServiceClient conversionUploadServiceClient =
      googleAdsClient.getLatestVersion().createConversionUploadServiceClient()) {
    // Uploads the click conversion. Partial failure should always be set to true.

    // NOTE: This request contains a single conversion as a demonstration.  However, if you have
    // multiple conversions to upload, it's best to upload multiple conversions per request
    // instead of sending a separate request per conversion. See the following for per-request
    // limits:
    // https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
    UploadClickConversionsResponse response =
        conversionUploadServiceClient.uploadClickConversions(
            UploadClickConversionsRequest.newBuilder()
                .setCustomerId(Long.toString(customerId))
                .addConversions(clickConversion)
                // Enables partial failure (must be true).
                .setPartialFailure(true)
                .build());

    // Prints any partial errors returned.
    if (response.hasPartialFailureError()) {
      GoogleAdsFailure googleAdsFailure =
          ErrorUtils.getInstance().getGoogleAdsFailure(response.getPartialFailureError());
      // Constructs a protocol buffer printer that will print error details in a concise format.
      Printer errorPrinter = JsonFormat.printer().omittingInsignificantWhitespace();
      for (int operationIndex = 0;
          operationIndex < response.getResultsCount();
          operationIndex++) {
        ClickConversionResult conversionResult = response.getResults(operationIndex);
        if (ErrorUtils.getInstance().isPartialFailureResult(conversionResult)) {
          // Prints the errors for the failed operation.
          System.out.printf("Operation %d failed with the following errors:%n", operationIndex);
          for (GoogleAdsError resultError :
              ErrorUtils.getInstance().getGoogleAdsErrors(operationIndex, googleAdsFailure)) {
            // Prints the error with newlines and extra spaces removed.
            System.out.printf("  %s%n", errorPrinter.print(resultError));
          }
        } else {
          // Prints the information about the successful operation.
          StringBuilder clickInfoBuilder =
              new StringBuilder("conversion that occurred at ")
                  .append(String.format("'%s' ", conversionResult.getConversionDateTime()))
                  .append("with ");
          if (conversionResult.hasGclid()) {
            clickInfoBuilder.append(String.format("gclid '%s'", conversionResult.getGclid()));
          } else if (!conversionResult.getGbraid().isEmpty()) {
            clickInfoBuilder.append(String.format("gbraid '%s'", conversionResult.getGbraid()));
          } else if (!conversionResult.getWbraid().isEmpty()) {
            clickInfoBuilder.append(String.format("wbraid '%s'", conversionResult.getWbraid()));
          } else {
            clickInfoBuilder.append("no click ID");
          }
          System.out.printf("Operation %d for %s succeeded.%n", operationIndex, clickInfoBuilder);
        }
      }
    }
  }
}
      

C#

public void Run(GoogleAdsClient client, long customerId, long conversionActionId,
    string gclid, string gbraid, string wbraid, string conversionTime,
    double conversionValue, ConsentStatus? adUserDataConsent)
{
    // Get the ConversionActionService.
    ConversionUploadServiceClient conversionUploadService =
        client.GetService(Services.V25.ConversionUploadService);

    // Creates a click conversion by specifying currency as USD.
    ClickConversion clickConversion = new ClickConversion()
    {
        ConversionAction = ResourceNames.ConversionAction(customerId, conversionActionId),
        ConversionValue = conversionValue,
        ConversionDateTime = conversionTime,
        CurrencyCode = "USD",
    };

    // Sets the consent information, if provided.
    if (adUserDataConsent != null)
    {
        // Specifies whether user consent was obtained for the data you are uploading. See
        // https://www.google.com/about/company/user-consent-policy
        // for details.
        clickConversion.Consent = new Consent()
        {
            AdUserData = (ConsentStatus)adUserDataConsent
        };
    }

    // Verifies that exactly one of gclid, gbraid, and wbraid is specified, as required.
    // See https://developers.google.com/google-ads/api/docs/conversions/upload-clicks
    // for details.
    string[] ids = { gclid, gbraid, wbraid };
    int idCount = ids.Where(id => !string.IsNullOrEmpty(id)).Count();

    if (idCount != 1)
    {
        throw new ArgumentException($"Exactly 1 of gclid, gbraid, or wbraid is " +
            $"required, but {idCount} ID values were provided");
    }

    // Sets the single specified ID field.
    if (!string.IsNullOrEmpty(gclid))
    {
        clickConversion.Gclid = gclid;
    }
    else if (!string.IsNullOrEmpty(wbraid))
    {
        clickConversion.Wbraid = wbraid;
    }
    else if (!string.IsNullOrEmpty(gbraid))
    {
        clickConversion.Gbraid = gbraid;
    }

    try
    {
        // Issues a request to upload the click conversion.
        UploadClickConversionsResponse response =
            conversionUploadService.UploadClickConversions(
                new UploadClickConversionsRequest()
                {
                    CustomerId = customerId.ToString(),
                    Conversions = { clickConversion },
                    PartialFailure = true,
                    ValidateOnly = false
                });

        // Prints the result.
        ClickConversionResult uploadedClickConversion = response.Results[0];
        Console.WriteLine($"Uploaded conversion that occurred at " +
            $"'{uploadedClickConversion.ConversionDateTime}' from Google " +
            $"Click ID '{uploadedClickConversion.Gclid}' to " +
            $"'{uploadedClickConversion.ConversionAction}'.");
    }
    catch (GoogleAdsException e)
    {
        Console.WriteLine("Failure:");
        Console.WriteLine($"Message: {e.Message}");
        Console.WriteLine($"Failure: {e.Failure}");
        Console.WriteLine($"Request ID: {e.RequestId}");
        throw;
    }
}
      

PHP

    public static function runExample(
        GoogleAdsClient $googleAdsClient,
        int $customerId,
        int $conversionActionId,
        ?string $gclid,
        ?string $gbraid,
        ?string $wbraid,
        ?string $orderId,
        string $conversionDateTime,
        float $conversionValue,
        ?string $conversionCustomVariableId,
        ?string $conversionCustomVariableValue,
        ?int $adUserDataConsent
    ) {
        // Verifies that exactly one of gclid, gbraid, and wbraid is specified, as required.
        // See https://developers.google.com/google-ads/api/docs/conversions/upload-clicks for details.
        $nonNullFields = array_filter(
            [$gclid, $gbraid, $wbraid],
            function ($field) {
                return !is_null($field);
            }
        );
        if (count($nonNullFields) !== 1) {
            throw new \UnexpectedValueException(
                sprintf(
                    "Exactly 1 of gclid, gbraid or wbraid is required, but %d ID values were "
                    . "provided",
                    count($nonNullFields)
                )
            );
        }

        // Creates a click conversion by specifying currency as USD.
        $clickConversion = new ClickConversion(
            [
            'conversion_action' =>
                ResourceNames::forConversionAction($customerId, $conversionActionId),
            'conversion_value' => $conversionValue,
            'conversion_date_time' => $conversionDateTime,
            'currency_code' => 'USD'
            ]
        );
        // Sets the single specified ID field.
        if (!is_null($gclid)) {
            $clickConversion->setGclid($gclid);
        } elseif (!is_null($gbraid)) {
            $clickConversion->setGbraid($gbraid);
        } else {
            $clickConversion->setWbraid($wbraid);
        }

        if (!is_null($conversionCustomVariableId) && !is_null($conversionCustomVariableValue)) {
            $clickConversion->setCustomVariables(
                [new CustomVariable(
                    [
                    'conversion_custom_variable' => ResourceNames::forConversionCustomVariable(
                        $customerId,
                        $conversionCustomVariableId
                    ),
                    'value' => $conversionCustomVariableValue
                    ]
                )]
            );
        }
        // Sets the consent information, if provided.
        if (!empty($adUserDataConsent)) {
            // Specifies whether user consent was obtained for the data you are uploading. See
            // https://www.google.com/about/company/user-consent-policy for details.
            $clickConversion->setConsent(new Consent(['ad_user_data' => $adUserDataConsent]));
        }

        if (!empty($orderId)) {
            // Sets the order ID (unique transaction ID), if provided.
            $clickConversion->setOrderId($orderId);
        }

        // Issues a request to upload the click conversion.
        $conversionUploadServiceClient = $googleAdsClient->getConversionUploadServiceClient();
        /**
 * @var UploadClickConversionsResponse $response
*/
        // NOTE: This request contains a single conversion as a demonstration.  However, if you have
        // multiple conversions to upload, it's best to upload multiple conversions per request
        // instead of sending a separate request per conversion. See the following for per-request
        // limits:
        // https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
        $response = $conversionUploadServiceClient->uploadClickConversions(
            // Uploads the click conversion. Partial failure should always be set to true.
            UploadClickConversionsRequest::build($customerId, [$clickConversion], true)
        );

        // Prints the status message if any partial failure error is returned.
        // Note: The details of each partial failure error are not printed here, you can refer to
        // the example HandlePartialFailure.php to learn more.
        if ($response->hasPartialFailureError()) {
            printf(
                "Partial failures occurred: '%s'.%s",
                $response->getPartialFailureError()->getMessage(),
                PHP_EOL
            );
        } else {
            // Prints the result if exists.
            /**
 * @var ClickConversionResult $uploadedClickConversion
*/
            $uploadedClickConversion = $response->getResults()[0];
            printf(
                "Uploaded click conversion that occurred at '%s' from Google Click ID '%s' " .
                "to '%s'.%s",
                $uploadedClickConversion->getConversionDateTime(),
                $uploadedClickConversion->getGclid(),
                $uploadedClickConversion->getConversionAction(),
                PHP_EOL
            );
        }
    }
      

Python

def main(
    client: GoogleAdsClient,
    customer_id: str,
    conversion_action_id: str,
    gclid: Optional[str],
    conversion_date_time: str,
    conversion_value: str,
    conversion_custom_variable_id: Optional[str],
    conversion_custom_variable_value: Optional[str],
    gbraid: Optional[str],
    wbraid: Optional[str],
    order_id: Optional[str],
    ad_user_data_consent: Optional[str],
) -> None:
    """Creates a click conversion with a default currency of USD.

    Args:
        client: An initialized GoogleAdsClient instance.
        customer_id: The client customer ID string.
        conversion_action_id: The ID of the conversion action to upload to.
        gclid: The Google Click Identifier ID. If set, the wbraid and gbraid
            parameters must be None.
        conversion_date_time: The the date and time of the conversion (should be
            after the click time). The format is 'yyyy-mm-dd hh:mm:ss+|-hh:mm',
            e.g. '2021-01-01 12:32:45-08:00'.
        conversion_value: The conversion value in the desired currency.
        conversion_custom_variable_id: The ID of the conversion custom
            variable to associate with the upload.
        conversion_custom_variable_value: The str value of the conversion custom
            variable to associate with the upload.
        gbraid: The GBRAID for the iOS app conversion. If set, the gclid and
            wbraid parameters must be None.
        wbraid: The WBRAID for the iOS app conversion. If set, the gclid and
            gbraid parameters must be None.
        order_id: The order ID for the click conversion.
        ad_user_data_consent: The ad user data consent for the click.
    """
    click_conversion: ClickConversion = client.get_type("ClickConversion")
    conversion_upload_service: ConversionUploadServiceClient = (
        client.get_service("ConversionUploadService")
    )
    conversion_action_service: ConversionActionServiceClient = (
        client.get_service("ConversionActionService")
    )
    click_conversion.conversion_action = (
        conversion_action_service.conversion_action_path(
            customer_id, conversion_action_id
        )
    )

    # Sets the single specified ID field.
    if gclid:
        click_conversion.gclid = gclid
    elif gbraid:
        click_conversion.gbraid = gbraid
    else:
        click_conversion.wbraid = wbraid

    click_conversion.conversion_value = float(conversion_value)
    click_conversion.conversion_date_time = conversion_date_time
    click_conversion.currency_code = "USD"

    if conversion_custom_variable_id and conversion_custom_variable_value:
        conversion_custom_variable: CustomVariable = client.get_type(
            "CustomVariable"
        )
        conversion_custom_variable.conversion_custom_variable = (
            conversion_upload_service.conversion_custom_variable_path(
                customer_id, conversion_custom_variable_id
            )
        )
        conversion_custom_variable.value = conversion_custom_variable_value
        click_conversion.custom_variables.append(conversion_custom_variable)

    if order_id:
        click_conversion.order_id = order_id

    # Sets the consent information, if provided.
    if ad_user_data_consent:
        # Specifies whether user consent was obtained for the data you are
        # uploading. For more details, see:
        # https://www.google.com/about/company/user-consent-policy
        click_conversion.consent.ad_user_data = client.enums.ConsentStatusEnum[
            ad_user_data_consent
        ]

    # Uploads the click conversion. Partial failure must be set to True here.
    #
    # NOTE: This request only uploads a single conversion, but if you have
    # multiple conversions to upload, it's most efficient to upload them in a
    # single request. See the following for per-request limits for reference:
    # https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
    request: UploadClickConversionsRequest = client.get_type(
        "UploadClickConversionsRequest"
    )
    request.customer_id = customer_id
    request.conversions.append(click_conversion)
    request.partial_failure = True
    conversion_upload_response: UploadClickConversionsResponse = (
        conversion_upload_service.upload_click_conversions(
            request=request,
        )
    )
    uploaded_click_conversion: ClickConversionResult = (
        conversion_upload_response.results[0]
    )
    print(
        f"Uploaded conversion that occurred at "
        f'"{uploaded_click_conversion.conversion_date_time}" from '
        f'Google Click ID "{uploaded_click_conversion.gclid}" '
        f'to "{uploaded_click_conversion.conversion_action}"'
    )
      

Ruby

def upload_offline_conversion(
  customer_id,
  conversion_action_id,
  gclid,
  gbraid,
  wbraid,
  conversion_date_time,
  conversion_value,
  conversion_custom_variable_id,
  conversion_custom_variable_value,
  ad_user_data_consent)
  # GoogleAdsClient will read a config file from
  # ENV['HOME']/google_ads_config.rb when called without parameters
  client = Google::Ads::GoogleAds::GoogleAdsClient.new

  # Verifies that exactly one of gclid, gbraid, and wbraid is specified, as required.
  # See https://developers.google.com/google-ads/api/docs/conversions/upload-clicks for details.
  identifiers_specified = [gclid, gbraid, wbraid].reject {|v| v.nil?}.count
  if identifiers_specified != 1
    raise "Must specify exactly one of GCLID, GBRAID, and WBRAID. " \
      "#{identifiers_specified} values were provided."
  end

  click_conversion = client.resource.click_conversion do |cc|
    cc.conversion_action = client.path.conversion_action(customer_id, conversion_action_id)
    # Sets the single specified ID field.
    if !gclid.nil?
      cc.gclid = gclid
    elsif !gbraid.nil?
      cc.gbraid = gbraid
    else
      cc.wbraid = wbraid
    end
    cc.conversion_value = conversion_value.to_f
    cc.conversion_date_time = conversion_date_time
    cc.currency_code = 'USD'
    if conversion_custom_variable_id && conversion_custom_variable_value
      cc.custom_variables << client.resource.custom_variable do |cv|
        cv.conversion_custom_variable = client.path.conversion_custom_variable(
          customer_id, conversion_custom_variable_id)
        cv.value = conversion_custom_variable_value
      end
    end
    # Sets the consent information, if provided.
    unless ad_user_data_consent.nil?
      cc.consent = client.resource.consent do |c|
        # Specifies whether user consent was obtained for the data you are
        # uploading. For more details, see:
        # https://www.google.com/about/company/user-consent-policy
        c.ad_user_data = ad_user_data_consent
      end
    end
  end

  response = client.service.conversion_upload.upload_click_conversions(
    customer_id: customer_id,
    # NOTE: This request contains a single conversion as a demonstration.
    # However, if you have multiple conversions to upload, it's best to upload
    # multiple conversions per request instead of sending a separate request per
    # conversion. See the following for per-request limits:
    # https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
    conversions: [click_conversion],
    partial_failure: true,
  )
  if response.partial_failure_error.nil?
    result = response.results.first
    puts "Uploaded conversion that occurred at #{result.conversion_date_time} " \
      "from Google Click ID #{result.gclid} to #{result.conversion_action}."
  else
    failures = client.decode_partial_failure_error(response.partial_failure_error)
    puts "Request failed. Failure details:"
    failures.each do |failure|
      failure.errors.each do |error|
        puts "\t#{error.error_code.error_code}: #{error.message}"
      end
    end
  end
end
      

Perl

sub upload_offline_conversion {
  my (
    $api_client,                    $customer_id,
    $conversion_action_id,          $gclid,
    $gbraid,                        $wbraid,
    $conversion_date_time,          $conversion_value,
    $conversion_custom_variable_id, $conversion_custom_variable_value,
    $order_id,                      $ad_user_data_consent
  ) = @_;

  # Verify that exactly one of gclid, gbraid, and wbraid is specified, as required.
  # See https://developers.google.com/google-ads/api/docs/conversions/upload-clicks for details.
  my $number_of_ids_specified = grep { defined $_ } ($gclid, $gbraid, $wbraid);
  if ($number_of_ids_specified != 1) {
    die sprintf "Exactly 1 of gclid, gbraid, or wbraid is required, " .
      "but %d ID values were provided.\n",
      $number_of_ids_specified;
  }

  # Create a click conversion by specifying currency as USD.
  my $click_conversion =
    Google::Ads::GoogleAds::V25::Services::ConversionUploadService::ClickConversion
    ->new({
      conversionAction =>
        Google::Ads::GoogleAds::V25::Utils::ResourceNames::conversion_action(
        $customer_id, $conversion_action_id
        ),
      conversionDateTime => $conversion_date_time,
      conversionValue    => $conversion_value,
      currencyCode       => "USD"
    });

  # Set the single specified ID field.
  if (defined $gclid) {
    $click_conversion->{gclid} = $gclid;
  } elsif (defined $gbraid) {
    $click_conversion->{gbraid} = $gbraid;
  } else {
    $click_conversion->{wbraid} = $wbraid;
  }

  if ($conversion_custom_variable_id && $conversion_custom_variable_value) {
    $click_conversion->{customVariables} = [
      Google::Ads::GoogleAds::V25::Services::ConversionUploadService::CustomVariable
        ->new({
          conversionCustomVariable =>
            Google::Ads::GoogleAds::V25::Utils::ResourceNames::conversion_custom_variable(
            $customer_id, $conversion_custom_variable_id
            ),
          value => $conversion_custom_variable_value
        })];
  }

  if (defined $order_id) {
    # Set the order ID (unique transaction ID), if provided.
    $click_conversion->{orderId} = $order_id;
  }

  # Set the consent information, if provided.
  if ($ad_user_data_consent) {
    # Specify whether user consent was obtained for the data you are uploading.
    # See https://www.google.com/about/company/user-consent-policy for details.
    $click_conversion->{consent} =
      Google::Ads::GoogleAds::V25::Common::Consent->new({
        adUserData => $ad_user_data_consent
      });
  }

  # Issue a request to upload the click conversion. Partial failure should
  # always be set to true.
  #
  # NOTE: This request contains a single conversion as a demonstration.
  # However, if you have multiple conversions to upload, it's best to
  # upload multiple conversions per request instead of sending a separate
  # request per conversion. See the following for per-request limits:
  # https://developers.google.com/google-ads/api/docs/best-practices/quotas#conversion_upload_service
  my $upload_click_conversions_response =
    $api_client->ConversionUploadService()->upload_click_conversions({
      customerId     => $customer_id,
      conversions    => [$click_conversion],
      partialFailure => "true"
    });

  # Print any partial errors returned.
  if ($upload_click_conversions_response->{partialFailureError}) {
    printf "Partial error encountered: '%s'.\n",
      $upload_click_conversions_response->{partialFailureError}{message};
  }

  # Print the result if valid.
  my $uploaded_click_conversion =
    $upload_click_conversions_response->{results}[0];
  if (%$uploaded_click_conversion) {
    printf
      "Uploaded conversion that occurred at '%s' from Google Click ID '%s' " .
      "to the conversion action with resource name '%s'.\n",
      $uploaded_click_conversion->{conversionDateTime},
      $uploaded_click_conversion->{gclid},
      $uploaded_click_conversion->{conversionAction};
  }

  return 1;
}
      

curl

# This code example uploads a click conversion.
#
# Variables:
#   API_VERSION,
#   CUSTOMER_ID,
#   MANAGER_CUSTOMER_ID,
#   OAUTH2_ACCESS_TOKEN:
#     See https://developers.google.com/google-ads/api/rest/auth#request_headers
#     for details.
#
#   CONVERSION_ACTION_RESOURCE_NAME: Resource name of the conversion action
#     associated with this conversion.
#   GCLID: The Google click ID (gclid) associated with this conversion.
#   CONVERSION_VALUE: The value of the conversion for the advertiser.
#   CONVERSION_DATE_TIME: The date time at which the conversion occurred. The
#     format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example,
#     "2019-01-01 12:32:45-08:00".
#   CURRENCY_CODE: The currency code of the conversion value. This is the
#     ISO 4217 3-character currency code. For example: USD, EUR.
#   CONVERSION_CUSTOM_VARIABLE: The name of the conversion custom variable.
#   CONVERSION_CUSTOM_VARIABLE_VALUE: The value of the conversion custom
#     variable.
#   ORDER_ID: The order ID of the conversion.
curl -f --request POST \
"https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}:uploadClickConversions" \
--header "Content-Type: application/json" \
--header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--data @- <<EOF
{
  "conversions": [
    {
      "conversionAction": "${CONVERSION_ACTION_RESOURCE_NAME}",
      "gclid": "${GCLID}",
      "conversionValue": ${CONVERSION_VALUE},
      "conversionDateTime": "${CONVERSION_DATE_TIME}",
      "currencyCode": "${CURRENCY_CODE}",
      "customVariables": [
        {
          "conversionCustomVariable": "${CONVERSION_CUSTOM_VARIABLE}",
          "value": "${CONVERSION_CUSTOM_VARIABLE_VALUE}"
        }
      ],
      "orderId": "${ORDER_ID}",
      "consent": {
        "adUserData": "GRANTED"
      }
    }
  ],
  "partialFailure": true
}
EOF
      

แก้ปัญหา

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

ข้อผิดพลาดที่พบบ่อยที่สุดบางอย่างเมื่ออัปโหลดการกระทําที่ถือเป็น Conversion คือข้อผิดพลาดในการให้สิทธิ์ เช่น USER_PERMISSION_DENIED โปรดตรวจสอบอีกครั้งว่าคุณได้ตั้งค่ารหัสลูกค้าในคําขอเป็นบัญชีลูกค้า Conversion โฆษณาของ Google Ads ที่เป็นเจ้าของการกระทำที่ถือเป็น Conversion ดูรายละเอียดเพิ่มเติมได้ใน คู่มือการให้สิทธิ์ และดูเคล็ดลับในการแก้ไขข้อผิดพลาดต่างๆ เหล่านี้ได้ใน คู่มือข้อผิดพลาดที่พบบ่อย

แก้ไขข้อผิดพลาดที่พบบ่อย

ข้อผิดพลาด
INVALID_CONVERSION_ACTION_TYPE การกระทําที่ถือเป็น Conversion ที่ระบุมี ประเภท ที่ไม่ถูกต้องสําหรับการอัปโหลด Conversion จากการคลิก ตรวจสอบว่า ConversionAction ที่ระบุในคําขออัปโหลดมีประเภทเป็น UPLOAD_CLICKS
NO_CONVERSION_ACTION_FOUND การกระทําที่ถือเป็น Conversion ที่ระบุไม่ได้เปิดใช้หรือค้นหาไม่พบ ภายใน customer_id ที่อัปโหลด ดึงข้อมูลเกี่ยวกับการตั้งค่า Conversion เพื่อให้แน่ใจว่าได้เปิดใช้การกระทําที่ถือเป็น Conversion ในการอัปโหลดแล้ว และ customer_id ของคําขออัปโหลดเป็นเจ้าของการกระทําที่ถือเป็น Conversion
TOO_RECENT_CONVERSION_ACTION การกระทําที่ถือเป็น Conversion เพิ่งสร้างขึ้น รออย่างน้อย 6 ชั่วโมงหลังจากสร้างการกระทําแล้วจึงลอง Conversion ที่ล้มเหลวอีกครั้ง
INVALID_CUSTOMER_FOR_CLICK customer_id ของคําขอไม่ใช่รหัสลูกค้าเดียวกับ บัญชี Conversion ของ Google Ads API ในขณะที่เกิดการคลิก อัปเดต customer_id ของ คําขอเป็นลูกค้าที่ถูกต้อง
EVENT_NOT_FOUND Google Ads ค้นหาการผสมผสานระหว่างรหัสคลิกกับ customer_id ไม่พบ ตรวจสอบข้อกําหนดสําหรับ customer_id และ ยืนยันว่าคุณกําลังอัปโหลดโดยใช้บัญชี Google Ads ที่ถูกต้อง
DUPLICATE_CLICK_CONVERSION_IN_REQUEST Conversion หลายรายการในคําขอมีการผสมผสานระหว่างรหัสคลิก conversion_date_time และ conversion_action เหมือนกัน นํา Conversion ที่ซ้ำกันออกจากคําขอ
CLICK_CONVERSION_ALREADY_EXISTS ก่อนหน้านี้มีการอัปโหลด Conversion ที่มีการผสมผสานระหว่างรหัสคลิก conversion_date_time และ conversion_action เหมือนกัน ละเว้นข้อผิดพลาดนี้หากคุณลองอัปโหลดอีกครั้งและ Conversion นี้สําเร็จก่อนหน้านี้ หากต้องการเพิ่ม Conversion อีกรายการนอกเหนือจาก Conversion ที่อัปโหลดก่อนหน้านี้ ให้ปรับ conversion_date_time ของ ClickConversion เพื่อหลีกเลี่ยงการทําซ้ำ Conversion ที่อัปโหลดก่อนหน้านี้
EVENT_NOT_FOUND Google Ads ค้นหาการผสมผสานระหว่างรหัสคลิกกับ customer_id ไม่พบ ตรวจสอบข้อกําหนดสําหรับ customer_id และ ยืนยันว่าคุณกําลังอัปโหลดโดยใช้บัญชี Google Ads ที่ถูกต้อง
EXPIRED_EVENT การคลิกที่นําเข้าเกิดขึ้นก่อนกรอบเวลาที่ระบุใน click_through_lookback_window_days ฟิลด์ การเปลี่ยนแปลง click_through_lookback_window_days จะส่งผลต่อการคลิกที่บันทึกไว้หลังจากการเปลี่ยนแปลงเท่านั้น ดังนั้นการเปลี่ยนกรอบเวลามองย้อนกลับจะไม่แก้ไขข้อผิดพลาดนี้สําหรับการคลิกที่เฉพาะเจาะจง หากเหมาะสม ให้เปลี่ยน conversion_action เป็นการกระทําอื่นที่มีกรอบเวลามองย้อนกลับนานขึ้น
CONVERSION_PRECEDES_EVENT conversion_date_time เกิดขึ้นก่อนวันที่และเวลาที่เกิดการ คลิก อัปเดต conversion_date_time เป็นค่าที่ใหม่กว่า
GBRAID_WBRAID_BOTH_SET ClickConversion มีการตั้งค่าค่าสําหรับทั้ง gbraid และ wbraid อัปเดต Conversion ให้ใช้รหัสคลิกหรือพารามิเตอร์ของ URL เพียงรายการเดียว และตรวจสอบว่าคุณไม่ได้รวมการคลิกหลายรายการไว้ใน Conversion เดียวกัน การคลิกแต่ละครั้งจะมีรหัสคลิก หรือพารามิเตอร์ของ URL เพียงรายการเดียว
VALUE_MUST_BE_UNSET ตรวจสอบ location ของ GoogleAdsError เพื่อดูว่าปัญหาใดต่อไปนี้ทําให้เกิด ข้อผิดพลาด
  • ClickConversion มีการตั้งค่าค่าสําหรับ gclid รวมถึง gbraid หรือ wbraid อย่างน้อย 1 รายการ อัปเดต Conversion ให้ใช้รหัสคลิกหรือพารามิเตอร์ของ URL เพียงรายการเดียว และตรวจสอบว่าคุณไม่ได้รวมการคลิกหลายรายการไว้ใน Conversion เดียวกัน การคลิกแต่ละครั้ง จะมีรหัสคลิกหรือพารามิเตอร์ของ URL เพียงรายการเดียว
  • ClickConversion มีการตั้งค่าค่าสําหรับ gbraid หรือ wbraid และมีค่าสําหรับ custom_variables Google Ads ไม่รองรับตัวแปรที่กําหนดเองสําหรับ Conversion ที่มีพารามิเตอร์ URL gbraid หรือ wbraid ยกเลิกการตั้งค่าฟิลด์ custom_variables ของ Conversion

Conversion ในรายงาน

Conversion ที่อัปโหลดจะแสดงในรายงานสําหรับวันที่ การแสดงผล ของการคลิกเดิม ไม่ใช่วันที่ของ คําขออัปโหลดหรือวันที่ conversion_date_time ของ ClickConversion

ระบบใช้เวลาสูงสุด 3 ชั่วโมงในการแสดงสถิติ Conversion ที่นำเข้าในบัญชี Google Ads สำหรับการระบุแหล่งที่มาของคลิกสุดท้าย สําหรับรูปแบบการระบุแหล่งที่มาของการค้นหาอื่นๆ อาจใช้เวลานานกว่า 3 ชั่วโมง โปรดดูข้อมูลเพิ่มเติมใน คู่มือความใหม่ของข้อมูล