測試
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
在 Google Ads 中設定 Webhook 後,建議您測試客戶關係管理系統
使用測試功能正確設定。否則您可能不會收到
客戶關係管理系統中的待開發客戶資料
在 Google Ads 建立待開發客戶表單時,下方會顯示測試按鈕
進行 Webhook 設定:

請注意,建立待開發客戶時,設定介面可能會有所不同
表單中。
按下測試按鈕後,系統就會將範例 Webhook 要求傳送至您的
系統就會顯示結果如果要求
也會順利收到您的客戶關係管理系統所發出的 HTML 回應狀態碼
系統為 200
,系統會顯示綠色狀態訊息:

如要進行這類測試,請確認您的客戶關係管理系統是否正確
接收及剖析範例酬載。如果沒有執行這個步驟,
但不保證 Webhook 能正常運作。
下方顯示已傳送的酬載範例。實際要求
僅包含表單中選取的欄位:
{
"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
」欄位值設為表單的實際 ID
測試已經儲存的表單。如果表單尚未儲存
系統會提供虛擬值
使用 curl 指令
您可以使用 Mac 或 Linux 的 curl
指令列
- 從範例中選擇酬載範例。
並視需要修改
- 將該檔案儲存在檔案中 (例如
request.txt
)。
- 在指令列中執行下列指令:
$ curl -v -X POST --header "Content-Type:application/json" -d @request.txt https://webhook_url
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-21 (世界標準時間)。
[null,null,["上次更新時間:2025-08-21 (世界標準時間)。"],[[["\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 ```"]]