如何在页面背景中包含 reCAPTCHA v3? [英] How to include reCAPTCHA v3 in the background of pages?

查看:108
本文介绍了如何在页面背景中包含 reCAPTCHA v3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 reCAPTCHA v3 文档中,它说

In the reCAPTCHA v3 docs, it says

当 reCAPTCHA 拥有最多的与您的网站互动的上下文时,它的效果最佳,这来自于同时看到合法和滥用行为.因此,我们建议在表单或操作以及用于分析的页面背景中加入 reCAPTCHA 验证.

reCAPTCHA works best when it has the most context about interactions with your site, which comes from seeing both legitimate and abusive behavior. For this reason, we recommend including reCAPTCHA verification on forms or actions as well as in the background of pages for analytics.

我们如何在页面后台运行它?

How do we run it in the background of pages?

假设我有一个处理多个网页的 React 应用程序,对于我的一个网页,它是一个注册表单,我想在用户注册时获得风险评分.当文档说要在其他页面的后台运行 reCAPTCHA 时,这是否意味着只要 <script src="https://www.google.com/recaptcha/api.js?render=_reCAPTCHA_site_key"></script> 是否在标题中?或者我们是否需要在所有其他页面上调用 grecaptcha.execute(...) 而不仅仅是注册页面?

Let's say I have a React app that handles multiple web pages, and for one of my web pages, it is a sign up form where I want to get a risk score when users sign up. When the docs say to run reCAPTCHA in the background on other pages, does that mean it's running on other pages as long as <script src="https://www.google.com/recaptcha/api.js?render=_reCAPTCHA_site_key"></script> is in the header? Or do we need to call grecaptcha.execute(...) on all the other pages, and not just the signup page?

推荐答案

只要附上脚本,它就会在页面后台运行.如果 reCAPTCHA 横幅/图标显示在页面上(通常是右下角),您可以看到它正在运行.grecaptcha.execute(...) 应该针对特定操作运行,例如当您单击按钮进行注册时.

As long as you have the script attached, it will run in the background of pages. You can see that it's running if the reCAPTCHA banner/icon is showing on the page (usually bottom right corner). grecaptcha.execute(...) should be run on a specific action, like when you click a button to sign up for example.

这篇关于如何在页面背景中包含 reCAPTCHA v3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆