تست کردن
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
پس از راهاندازی وب هوک در Google Ads، توصیه میکنیم آزمایش کنید که آیا CRM شما با استفاده از عملکرد آزمایشی به درستی تنظیم شده است یا خیر. در غیر این صورت، ممکن است داده های سرنخ را در سیستم CRM خود دریافت نکنید.
هنگام ساخت فرم سرنخ خود در Google Ads، یک دکمه تست را در زیر تنظیم وب هوک خواهید دید:

توجه داشته باشید که اگر در حال تنظیم فرم سرنخ در جستجو هستید، رابط راهاندازی ممکن است متفاوت به نظر برسد.
پس از زدن دکمه تست، یک نمونه درخواست وب هوک به نقطه پایانی وب هوک پیکربندی شده شما ارسال می شود و نتیجه نمایش داده می شود. اگر درخواست توسط 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 از خط فرمان مک یا لینوکس خود استفاده کنید.
- یک بار نمونه را از Samples انتخاب کنید و در صورت نیاز آن را تغییر دهید.
- آن را در یک فایل (به عنوان مثال،
request.txt
) در دستگاه خود ذخیره کنید. - دستور زیر را در خط فرمان خود اجرا کنید:
$ curl -v -X POST --header "Content-Type:application/json" -d @request.txt https://webhook_url
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده 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 ```"]]