Loading
Salesforce now sends email only from verified domains. Read More
Put Employees First with Work.com
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Add Markup and ReCaptcha Keys to Your Sign-Up Form

          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
          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.
          1. Navigate to Setup and enter All Sites in the Quick Find box.
          2. Click Builder next to the site that will host the visitor sign-up form.
          3. Click the gear icon and click Edit Head Markup.
          4. 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>
          5. In the Settings section of your site, click Security. Choose Relaxed CSP from the security level dropdown.
          6. For the Clickjack protection level set to Allow Framing by Any Page.
          7. Add www.google.com and https://www.gstatic.com.
          8. Click Trusted URLs under Trusted Sites for Scripts.
          9. In the Trusted URL page that opens up, add www.google.com as a Trusted URL. Save the changes.
          10. Navigate to the Developer Console from Setup.
          11. Click File>Open>Classes. Then, select reCaptcha.
          12. Replace the reCaptcha site key in the code with the one that Google generated for you.
          13. Click Publish.
           
          Loading
          Salesforce Help | Article