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

โปรดทราบว่าอินเทอร์เฟซการตั้งค่าอาจดูแตกต่างออกไปหากคุณกําลังสร้างโอกาสในการขาย
ใน Search
เมื่อกดปุ่มทดสอบแล้ว ระบบจะส่งคำขอเว็บฮุคไปยัง
ปลายทางเว็บฮุคที่มีการกำหนดค่าและผลลัพธ์จะปรากฏขึ้น หากคำขอคือ
ได้รับโดย CRM และรหัสสถานะการตอบสนอง HTML จาก
ระบบเดิมคือ 200
คุณจะเห็นข้อความสถานะสีเขียว:

หากต้องการทดสอบให้เสร็จสมบูรณ์ในกรณีดังกล่าว โปรดยืนยันว่า CRM ของคุณ
ได้รับและแยกวิเคราะห์เปย์โหลดตัวอย่างแล้ว หากไม่ทำขั้นตอนนี้
ไม่รับประกันว่าเว็บฮุคจะทำงานอย่างถูกต้อง
ตัวอย่างของเพย์โหลดที่ส่งแสดงอยู่ด้านล่าง คำขอจริงจะ
มีเฉพาะฟิลด์ที่เลือกไว้ในแบบฟอร์ม:
{
"lead_id":"Cj0KCQjwit_8BRCoARIsAIx3Rj7g-AeL6z35IWb6VYiZUygtTfwD3hDlgSGmY-XTTlK3lfV1wcuIwIAaAmMxEALw_wcB",
"campaign_id":123456,
"adgroup_id":0,
"creative_id":0,
"gcl_id":"Cj0KCQjwit_8BRCoARIsAIx3Rj7g-AeL6z35IWb6VYiZUygtTfwD3hDlgSGmY-XTTlK3lfV1wcuIwIAaAmMxEALw_wcB",
"user_column_data": [
{
"column_name": "Full Name",
"string_value":"FirstName LastName",
"column_id": "FULL_NAME"
},
{
"column_name":"User Phone",
"string_value":"1-650-555-0123",
"column_id":"PHONE_NUMBER"
},
{
"column_name":"User Email",
"string_value":"test@example.com",
"column_id":"EMAIL"
}],
"api_version":"1.0",
"form_id":123456789,
"google_key":"testkey",
"is_test":true
}
โปรดทราบว่าระบบจะกำหนดค่าในช่อง form_id
เป็นรหัสจริงของแบบฟอร์ม
หากคุณกำลังทำการทดสอบ
ในแบบฟอร์มที่บันทึกไว้แล้ว สำหรับแบบฟอร์มที่ไม่ได้บันทึก
ระบบจะระบุค่าจำลอง
ใช้คำสั่ง curl
คุณใช้ curl จาก Mac หรือ Linux ได้
บรรทัดคำสั่ง
- เลือกเพย์โหลดตัวอย่างจากตัวอย่าง
และแก้ไขหากจำเป็น
- จัดเก็บไว้ในไฟล์ (เช่น
request.txt
) ในเครื่องของคุณ
- เรียกใช้คำสั่งต่อไปนี้ในบรรทัดคำสั่ง
$ curl -v -X POST --header "Content-Type:application/json" -d @request.txt https://webhook_url
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-21 UTC
[null,null,["อัปเดตล่าสุด 2025-08-21 UTC"],[[["\u003cp\u003eGoogle Ads recommends testing your CRM setup with the provided functionality to ensure lead data is received correctly.\u003c/p\u003e\n"],["\u003cp\u003eA test button in the lead form builder sends a sample webhook request to your endpoint, displaying a green status message upon success with HTML response code \u003ccode\u003e200\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eFor a comprehensive test, verify your CRM received and parsed the payload to guarantee proper webhook functionality.\u003c/p\u003e\n"],["\u003cp\u003eThe sample payload includes lead information like name, phone, email, and other relevant form data in a structured JSON format.\u003c/p\u003e\n"],["\u003cp\u003eUsers can utilize curl command with a modified sample payload for testing the webhook integration from Mac or Linux command line.\u003c/p\u003e\n"]]],[],null,["# Testing\n\nUsing the webhook validation in the form builder UI (recommended)\n-----------------------------------------------------------------\n\nOnce the webhook is set up in Google Ads, we recommend you test if your CRM is\nset up correctly using the test functionality. Otherwise, you may not receive\nthe lead data in your CRM system.\n\nWhen constructing your lead form in Google Ads, you will see a test button below\nthe webhook set-up:\n\nNote that the set-up interface may look different if you are setting up a lead\nform on Search.\n\nOnce you hit the test button, a sample webhook request is sent to your\nconfigured webhook endpoint and a result is displayed. If the request was\nreceived successfully by your CRM and the HTML response status code from your\nsystem was `200`, you will see a green status message:\n\nTo complete the test in such a case, please verify that your CRM has correctly\nreceived and parsed the sample payload. **Without performing this step there is\nno guarantee that the webhook is working properly.**\n\nA sample of the payload that is sent is shown below. The actual request will\ncontain only fields that were selected in the form:\n\n#### Form fields selected in the example: Name, Phone, Email\nLead type: Test payload sent by webhook testing UI\n\n {\n \"lead_id\":\"Cj0KCQjwit_8BRCoARIsAIx3Rj7g-AeL6z35IWb6VYiZUygtTfwD3hDlgSGmY-XTTlK3lfV1wcuIwIAaAmMxEALw_wcB\",\n \"campaign_id\":123456,\n \"adgroup_id\":0,\n \"creative_id\":0,\n \"gcl_id\":\"Cj0KCQjwit_8BRCoARIsAIx3Rj7g-AeL6z35IWb6VYiZUygtTfwD3hDlgSGmY-XTTlK3lfV1wcuIwIAaAmMxEALw_wcB\",\n \"user_column_data\": [\n {\n \"column_name\": \"Full Name\",\n \"string_value\":\"FirstName LastName\",\n \"column_id\": \"FULL_NAME\"\n },\n {\n \"column_name\":\"User Phone\",\n \"string_value\":\"1-650-555-0123\",\n \"column_id\":\"PHONE_NUMBER\"\n },\n {\n \"column_name\":\"User Email\",\n \"string_value\":\"test@example.com\",\n \"column_id\":\"EMAIL\"\n }],\n \"api_version\":\"1.0\",\n \"form_id\":123456789,\n \"google_key\":\"testkey\",\n \"is_test\":true\n }\n\nPlease note that `form_id` field value will be set to the actual id of your form\nif you are performing a test on a form that is already saved. For unsaved forms,\na dummy value will be provided.\n\nUsing curl command\n------------------\n\nYou can use [curl](//curl.haxx.se/docs/manpage.html) from your Mac or Linux\ncommand line.\n\n1. Choose a sample payload from [Samples](/google-ads/webhook/docs/samples), and modify if required.\n2. Store it in a file (e.g., `request.txt`) on your machine.\n3. Run the following command on your command line: \n\n ```bash\n $ curl -v -X POST --header \"Content-Type:application/json\" -d @request.txt https://webhook_url\n ```"]]