测试
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在 Google Ads 中设置网络钩子后,建议您测试自己的 CRM 是否
正确设置。否则,您可能不会收到
客户关系管理系统中的潜在客户数据。
在 Google Ads 中构建潜在客户表单时,您会在下方看到一个测试按钮
webhook 设置:

请注意,在设置潜在客户时,设置界面可能会有所不同
表单。
点击测试按钮后,系统会向您的
并会显示结果。如果请求
客户关系管理系统已成功收到 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
字段值将设置为表单的实际 ID
对已保存的表单执行测试。对于未保存的表单,
系统会提供一个虚拟值
使用 curl 命令
您可以在 Mac 或 Linux 中使用 curl
命令行。
- 从 Samples 中选择一个示例载荷,
并根据需要进行修改
- 将其存储在一个文件中(例如
request.txt
)。
- 在命令行上运行以下命令:
$ curl -v -X POST --header "Content-Type:application/json" -d @request.txt https://webhook_url
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[null,null,["最后更新时间 (UTC):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 ```"]]