You are here:
Add Markup and ReCaptcha Keys to Your Sign-Up Form
Add markup and Google’s secret key to your Experience Cloud site.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise,Performance, Unlimited, andDeveloper editions |
| User Permissions Needed | |
|---|---|
| To create Queues: | Admin or Facility Manager permission set license |
| To create, customize, and publish an Experience Cloud site: | Create and Set Up Experiences AND View Setup and Configuration |
Note In the Spring ’21 release, Community Cloud was
renamed to Experience Cloud. As part of this rebranding effort, you can expect changes for both
tools and terminology.
- Navigate to Setup and enter All Sites in the Quick Find box.
- Click Builder next to the site that will host the visitor sign-up form.
- Click the gear icon and click Edit Head Markup.
-
Paste this code snippet into your Head Markup section.
Substitute the site key that Google gave you for the site key line in the snippet.
<!--reCaptcha v2 Checkbox--> <script> var verifyCallback = function(token) { window.parent.document.dispatchEvent(new CustomEvent('grecaptchaVerified', {'detail': {response: token}})); }; var expireCallback = function() { window.parent.document.dispatchEvent(new Event('grecaptchaExpired')); }; var errorCallback = function() { window.parent.document.dispatchEvent(new Event('grecaptchaError')); }; document.addEventListener('grecaptchaRender', function(e) { grecaptcha.render(e.detail.element, { 'sitekey': '*6LeH8OEZAAAAAMi0TO4HCEgcO9fRTkryTroe13GZ*', 'callback': verifyCallback, 'expired-callback': expireCallback, 'error-callback': errorCallback }); }); document.addEventListener('grecaptchaReset', function() { grecaptcha.reset(); }); </script> <script src='https://www.google.com/recaptcha/api.js?render=explicit' async defer></script> - In the Settings section of your site, click Security. Choose Relaxed CSP from the security level dropdown.
- For the Clickjack protection level set to Allow Framing by Any Page.
- Add www.google.com and https://www.gstatic.com.
- Click Trusted URLs under Trusted Sites for Scripts.
- In the Trusted URL page that opens up, add www.google.com as a Trusted URL. Save the changes.
- Navigate to the Developer Console from Setup.
- Click File>Open>Classes. Then, select reCaptcha.
- Replace the reCaptcha site key in the code with the one that Google generated for you.
- Click Publish.
Did this article solve your issue?
Let us know so we can improve!

