با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
reCAPTCHA v3 یک امتیاز برای هر درخواست بدون اصطکاک کاربر برمی گرداند. امتیاز بر اساس تعامل با سایت شما است و شما را قادر می سازد تا اقدام مناسبی برای سایت خود انجام دهید. کلیدهای reCAPTCHA v3 را در کنسول مدیریت reCAPTCHA ثبت کنید.
این صفحه نحوه فعال کردن و سفارشی کردن reCAPTCHA v3 را در صفحه وب خود توضیح می دهد.
قرار دادن در وب سایت شما
reCAPTCHA v3 هرگز کاربران شما را قطع نمیکند، بنابراین میتوانید هر زمان که بخواهید بدون تأثیر بر تبدیل، آن را اجرا کنید. reCAPTCHA زمانی بهترین کار می کند که بیشترین زمینه را در مورد تعامل با سایت شما داشته باشد، که از مشاهده رفتار مشروع و توهین آمیز ناشی می شود. به همین دلیل، توصیه میکنیم تأیید reCAPTCHA را در فرمها یا اقدامات و همچنین در پسزمینه صفحات برای تجزیه و تحلیل قرار دهید.
میتوانید reCAPTCHA را در همان صفحه روی هر تعداد عملی که میخواهید اجرا کنید.
چالش را به صورت خودکار به یک دکمه متصل کنید
ساده ترین روش برای استفاده از reCAPTCHA v3 در صفحه شما، گنجاندن منبع لازم جاوا اسکریپت و افزودن چند ویژگی به دکمه html است.
اگر می خواهید کنترل بیشتری روی زمان اجرای reCAPTCHA داشته باشید، می توانید از متد execute در شی grecaptcha استفاده کنید. برای انجام این کار، باید یک پارامتر render به بار اسکریپت reCAPTCHA اضافه کنید.
API جاوا اسکریپت را با کلید سایت خود بارگیری کنید.
برای هر اقدامی که میخواهید از آن محافظت کنید، grecaptcha.execute فراخوانی کنید.
<script>
function onClick(e) {
e.preventDefault();
grecaptcha.ready(function() {
grecaptcha.execute('reCAPTCHA_site_key', {action: 'submit'}).then(function(token) {
// Add your logic to submit to your backend server here.
});
});
}
</script>
توکن را فوراً با درخواست تأیید به باطن خود ارسال کنید.
تفسیر نمره
reCAPTCHA v3 یک امتیاز برمی گرداند (1.0 به احتمال زیاد یک تعامل خوب است، 0.0 به احتمال زیاد یک ربات است). بر اساس امتیاز، می توانید اقدام متغیری را در زمینه سایت خود انجام دهید. هر سایتی متفاوت است، اما در زیر چند نمونه از نحوه استفاده سایت ها از امتیاز آورده شده است. مانند مثال های زیر، به جای مسدود کردن ترافیک برای محافظت بهتر از سایت خود، در پشت صحنه اقدام کنید.
مورد استفاده
توصیه
صفحه اصلی
هنگام فیلتر کردن اسکراپرها، نمای منسجمی از ترافیک خود را در کنسول مدیریت مشاهده کنید.
ورود به سیستم
با امتیازات پایین، برای جلوگیری از حملات پر کردن اعتبار، به احراز هویت دو عاملی یا تأیید ایمیل نیاز دارید.
اجتماعی
درخواستهای دوستی بیپاسخ از سوی کاربران توهینآمیز را محدود کنید و نظرات خطرناک را برای نظارت ارسال کنید.
تجارت الکترونیک
فروش واقعی خود را بر ربات ها ترجیح دهید و معاملات پرخطر را شناسایی کنید.
reCAPTCHA با دیدن ترافیک واقعی در سایت شما یاد می گیرد. به همین دلیل، نمرات در یک محیط صحنه سازی یا بلافاصله پس از اجرا ممکن است با تولید متفاوت باشد. از آنجایی که reCAPTCHA نسخه 3 هرگز جریان کاربر را قطع نمیکند، میتوانید ابتدا reCAPTCHA را بدون هیچ اقدامی اجرا کنید و سپس با مشاهده ترافیک خود در کنسول مدیریت، در مورد آستانه تصمیم بگیرید. به طور پیش فرض می توانید از آستانه 0.5 استفاده کنید.
اقدامات
reCAPTCHA v3 یک مفهوم جدید را معرفی می کند: اقدامات. هنگامی که در هر مکانی که reCAPTCHA را اجرا می کنید یک نام اقدام مشخص می کنید، ویژگی های جدید زیر را فعال می کنید:
تفکیک دقیق داده ها برای ده عملکرد برتر شما در کنسول مدیریت
تجزیه و تحلیل ریسک تطبیقی بر اساس زمینه عمل، زیرا رفتار توهین آمیز می تواند متفاوت باشد.
نکته مهم این است که وقتی پاسخ reCAPTCHA را تأیید میکنید، باید بررسی کنید که نام عمل همان نامی است که انتظار دارید.
پاسخ تایید سایت
درخواست تأیید رمز پاسخ را مانند reCAPTCHA v2 یا Invisible reCAPTCHA انجام دهید.
پاسخ یک شی JSON است:
{"success":true|false,// whether this request was a valid reCAPTCHA token for your site"score":number// the score for this request (0.0 - 1.0)"action":string// the action name for this request (important to verify)"challenge_ts":timestamp,// timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ)"hostname":string,// the hostname of the site where the reCAPTCHA was solved"error-codes":[...]// optional}
نکات
grecaptcha.ready() تابع شما را هنگام بارگیری کتابخانه reCAPTCHA اجرا می کند. برای اجتناب از شرایط مسابقه با api.js ، api.js قبل از اسکریپتهای خود که grecaptcha را فراخوانی میکنند، اضافه کنید، یا به استفاده از پاسخ به تماس در بارگذاری که با API v2 تعریف شده است، ادامه دهید.
سعی کنید تماس execute را به اقدامات جالب یا حساسی مانند ثبت نام، تنظیم مجدد رمز عبور، خرید یا پخش متصل کنید.
از https://www.google.com/recaptcha/api.js?trustedtypes=true برای بارگیری کدهای سازگار با Trusted Types استفاده کنید.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003ereCAPTCHA v3 provides a score-based system to assess user interactions without interrupting their experience, allowing you to take appropriate actions based on risk levels.\u003c/p\u003e\n"],["\u003cp\u003eYou can implement reCAPTCHA v3 by either automatically binding it to a button or programmatically invoking it for more control over when it runs.\u003c/p\u003e\n"],["\u003cp\u003ereCAPTCHA v3 uses "actions" to categorize interactions, providing detailed data breakdown and adaptive risk analysis based on the specific context.\u003c/p\u003e\n"],["\u003cp\u003ereCAPTCHA v3 returns a score along with other details that you should verify on your backend to ensure the response is valid and the action is expected.\u003c/p\u003e\n"],["\u003cp\u003eYou should analyze reCAPTCHA v3 scores within your admin console and adjust action thresholds based on your site's traffic and risk tolerance, starting with a default of 0.5.\u003c/p\u003e\n"]]],["reCAPTCHA v3 provides a score per request, indicating the likelihood of a good interaction. Implement it by registering keys and including the JavaScript API. Execute reCAPTCHA on forms, actions, or in the background using either an automated button binding or the `grecaptcha.execute` method. Verify the response token, and interpret scores (0.0-1.0) to decide actions like requiring multi-factor authentication. Define action names to gain detailed data in the admin console. Always verify the action name in the response.\n"],null,["# reCAPTCHA v3 returns a score for each request without user friction. The score is based on interactions with your site and enables you to take an appropriate action for your site. Register reCAPTCHA v3 keys on the [reCAPTCHA Admin console](https://www.google.com/recaptcha/admin/create).\n\nThis page explains how to enable and customize reCAPTCHA v3 on your webpage.\n\nPlacement on your website\n-------------------------\n\nreCAPTCHA v3 will never interrupt your users, so you can run it whenever you like without affecting\nconversion. reCAPTCHA works best when it has the most context about interactions with your site,\nwhich comes from seeing both legitimate and abusive behavior. For this reason, we recommend\nincluding reCAPTCHA verification on forms or actions as well as in the background of pages for\nanalytics.\n| **Note:** reCAPTCHA tokens expire after two minutes. If you're protecting an action with reCAPTCHA, make sure to call `execute` when the user takes the action rather than on page load.\n\nYou can execute reCAPTCHA on as many actions as you want on the same page.\n\nAutomatically bind the challenge to a button\n--------------------------------------------\n\nThe easiest method for using reCAPTCHA v3 on your page is to include the\nnecessary JavaScript resource and add a few attributes to your html button.\n\n1. Load the JavaScript API.\n\n \u003cscript src=\"https://www.google.com/recaptcha/api.js\"\u003e\u003c/script\u003e\n\n2. Add a callback function to handle the token.\n\n \u003cscript\u003e\n function onSubmit(token) {\n document.getElementById(\"demo-form\").submit();\n }\n \u003c/script\u003e\n\n3. Add attributes to your html button.\n\n \u003cbutton class=\"g-recaptcha\" \n data-sitekey=\"reCAPTCHA_site_key\" \n data-callback='onSubmit' \n data-action='submit'\u003eSubmit\u003c/button\u003e\n\nProgrammatically invoke the challenge\n-------------------------------------\n\nIf you wish to have more control over when reCAPTCHA runs, you can use the\n`execute` method in `grecaptcha` object. To do this,\nyou need to add a `render` parameter to the reCAPTCHA script load.\n\n1. Load the JavaScript API with your sitekey.\n\n \u003cscript src=\"https://www.google.com/recaptcha/api.js?render=reCAPTCHA_site_key\"\u003e\u003c/script\u003e\n\n2. Call `grecaptcha.execute` on each action you wish to protect.\n\n \u003cscript\u003e\n function onClick(e) {\n e.preventDefault();\n grecaptcha.ready(function() {\n grecaptcha.execute('reCAPTCHA_site_key', {action: 'submit'}).then(function(token) {\n // Add your logic to submit to your backend server here.\n });\n });\n }\n \u003c/script\u003e\n\n3. Send the token immediately to your backend with the request to\n [verify](/recaptcha/docs/verify).\n\nInterpreting the score\n----------------------\n\nreCAPTCHA v3 returns a score (1.0 is very likely a good interaction, 0.0 is very likely a bot).\nBased on the score, you can take variable action in the context of your site. Every site is\ndifferent, but below are some examples of how sites use the score. As in the examples below, take\naction behind the scenes instead of blocking traffic to better protect your site.\n\n| Use case | Recommendation |\n|------------|----------------------------------------------------------------------------------------------------------------|\n| homepage | See a cohesive view of your traffic on the admin console while filtering scrapers. |\n| login | With low scores, require 2-factor-authentication or email verification to prevent credential stuffing attacks. |\n| social | Limit unanswered friend requests from abusive users and send risky comments to moderation. |\n| e-commerce | Put your real sales ahead of bots and identify risky transactions. |\n\nreCAPTCHA learns by seeing real traffic on your site. For this reason, scores in a staging\nenvironment or soon after implementing may differ from production. As reCAPTCHA v3 doesn't ever\ninterrupt the user flow, you can first run reCAPTCHA without taking action and then decide on\nthresholds by looking at your traffic in the [admin console](https://g.co/recaptcha/admin). By\ndefault, you can use a threshold of 0.5.\n\nActions\n-------\n\nreCAPTCHA v3 introduces a new concept: actions. When you specify an action name\nin each place you execute reCAPTCHA, you enable the following new features:\n\n- A detailed break-down of data for your top ten actions in the [admin console](https://g.co/recaptcha/admin/)\n- Adaptive risk analysis based on the context of the action, because abusive behavior can vary.\n\nImportantly, when you verify the reCAPTCHA response, you should verify that the\naction name is the name you expect.\n| **Note:** Actions might contain only alphanumeric characters, slashes, and underscores. Actions must not be user-specific.\n\nSite Verify Response\n--------------------\n\nMake the request to [verify the response token](/recaptcha/docs/verify) as with reCAPTCHA v2 or\nInvisible reCAPTCHA.\n\nThe response is a JSON object: \n\n {\n \"success\": true|false, // whether this request was a valid reCAPTCHA token for your site\n \"score\": number // the score for this request (0.0 - 1.0)\n \"action\": string // the action name for this request (important to verify)\n \"challenge_ts\": timestamp, // timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ)\n \"hostname\": string, // the hostname of the site where the reCAPTCHA was solved\n \"error-codes\": [...] // optional\n }\n\n### Tips\n\n1. `grecaptcha.ready()` runs your function when the reCAPTCHA library loads. To avoid race conditions with the `api.js`, include the `api.js` before your scripts that call grecaptcha, or continue to use the [onload callback](/recaptcha/docs/display#explicit_render) that's defined with the v2 API.\n2. Try hooking the `execute` call to interesting or sensitive actions like Register, Password Reset, Purchase, or Play.\n3. Use `https://www.google.com/recaptcha/api.js?trustedtypes=true` to load code compatible with [Trusted Types](https://web.dev/trusted-types/)."]]