RECAPTCHAV3- tags cover exactly these three steps.
Guide: Captcha protection
All tags on this page are permitted in all templates.
Friendly Captcha is the second provider available in the shop system. The tags there have different names but work according to exactly the same pattern.
Loading the script from Google
Two tags return the details that the script needs.Both values come from the shop configuration. Do not hard-code them in the template; otherwise, the integration breaks as soon as the key is changed or a subshop uses its own.
The previous documentation lists both tags only as single tags. In the shop system, they also apply as range tags, specifically when the respective value is configured. This lets you cleanly hide the entire integration if reCAPTCHA is not set up for this shop.
Passing the token to the shop
Google generates a token in the browser. Your form must send this token to the shop under the namews_recaptchav3_token; otherwise, the shop cannot check anything.
A token from Google is short-lived. Therefore, only get it immediately before submitting, not when the page is built, if a lot of time can pass between building and submitting.
Querying the result
Two ranges query the result. The difference lies in how often the check is performed.RECAPTCHAV3-PassedAlways checks exactly once per page call. Placing it several times on the same page therefore does not generate a second request but reuses the result of the first tag.The check is passed if the score returned by Google is greater than the configured minimum value. A score that exactly equals the minimum value is considered failed.
In the cross-references of both pages, the previous documentation misspells the tag name as
RECHAPTAV3-PassedOnce and RECHAPTAV3-PassedAlways, respectively. The correct prefix is RECAPTCHAV3-.Tracing errors
After a check, two tags are available for troubleshooting.The response codes
The previous documentation only states “0 means passed, everything else means failed”. The shop system additionally distinguishes what caused the result.Codes 1 and 2 do not mean that a check was just performed. They indicate that an earlier negative result was reused. Code 2 only comes from
RECAPTCHAV3-PassedOnce, code 1 only from RECAPTCHAV3-PassedAlways on a second occurrence on the same page.Codes 201 and 202 indicate an incomplete shop configuration, not a behavior of the visitor.
RECAPTCHAV3-LastPlainResponse returns Google’s response as JSON, unchanged. Among other things, it contains the score and the action name. For further processing in the template, pass the content to the JSON interface.The tags at a glance
All six tags are permitted in all templates. As a range tag,
RECAPTCHAV3-LastResponseCode is treated as an invalid tag.
Related topics
- Guide: Captcha protection
- Reference: FRIENDLYCAPTCHAV1- (Friendly Captcha)
- Reference: EJD- (JSON interface)
- Reference: Captcha section in the shop configuration
