{"title":"Web-to-lead and web-to-case integration","slug":"web-to-lead-and-web-to-case-integration","url":"https://support.storeconnect.com/articles/web-to-lead-and-web-to-case-integration","url_markdown":"https://support.storeconnect.com/articles/web-to-lead-and-web-to-case-integration.md","subtitle":null,"summary":"Generate Salesforce Web-to-Lead or Web-to-Case HTML forms, embed them on your StoreConnect pages via Content Blocks, add reCAPTCHA v2 spam protection, and troubleshoot missing submissions.","type":"Help_Documentation","video_url":"","keywords":"web-to-lead, web-to-case, salesforce forms, lead generation, customer support forms, html form integration, content blocks, recaptcha, spam protection, form embed, duplicate rules, form troubleshooting","last_modified":"2026-08-21T07:12:35+0000","body_markdown":"### Salesforce offers:\n\n-   [Web-to-Lead](https://www.salesforce.com/products/guide/lead-gen/web-to-lead/) forms for lead generation\n-   [Web-to-Case](https://trailhead.salesforce.com/en/content/learn/modules/service_basics/service_basics_create_customer_channels) forms for customer support\n\nEach of these can be used on the StoreConnect platform.\n\n**Building and Integrating Your Forms**\n\nA Salesforce System **Administrator** configure Salesforce to build out the web-to-lead or web-to-case html code. Once you have the html code you only need to add it direct to a page, or to a **Content Block** and insert the Content Block to the Page in the desired location.\n\nYou generate your forms code from [Web-to-Lead](https://help.salesforce.com/s/articleView?id=sf.setting_up_web-to-lead.htm\u0026type=5) or [Web-to-Case](https://help.salesforce.com/s/articleView?id=sf.setting_up_web-to-case.htm\u0026type=5) in Salesforce Setup.\n\nThere will be some **CSS** styling required on these forms to match your site design. You can use the built in classes or your own to achieve this.\n\n### **Generate the form code**\n\nIn this video, we show you how to create your web-to-lead HTML code. It is also highly recommended you add Captcha to your forms to prevent being spammed.\n\n\u003ciframe src=\"https://player.vimeo.com/video/976179814?badge=0\u0026autopause=0\u0026player_id=0\u0026app_id=58479\" title=\"StoreConnect How to Generate the Form Code for Web to Lead\" width=\"720\" height=\"405\"\u003e\u003c/iframe\u003e\n\nOnce you have your code, you can create a Content Block and paste it in the Content field. You then add that content block to your page or article. Alternatively you could paste your code directly on the page or article without the needing for content block.\n\nMake sure you test your form to ensure entries arrive in Salesforce. Checkout [Troubleshooting](web-to-lead-and-web-to-case-integration) if your form appears to not be working.\n\n### Captcha\n\nCaptcha can be added to your forms code when generating the code in Salesforce using Google reCAPTCHA v2.\n\nIf you add Googles reCAPTCHA to your web-to-lead and web-to-case forms, you may want to add the below JavaScript also. Without it, if a visitor forgets to click on the reCAPTCHA checkbox, their form will be rejected by Salesforce without notice. This code will enforce the use of the checkbox.\n\n1) Give the form an ID by adding `id='contact-form'` to this line of your form's HTML:\n\n```\n​​​\n```\n\n2) Place this code at the bottom of the page or content block, after the forms HTML:\n\n```\n\n    document.getElementById(\"contact-form\").onsubmit = function (event) {\n        const recaptcha = document.getElementById(\"g-recaptcha-response\").value\n        if (recaptcha === \"\") {\n            alert(\"Please confirm that you are not a robot.\");\n            event.preventDefault();\n        }\n    }\n```\n\nYou can change the error message (alert) if you want and you must use different form ID's for each form if you have more than one form on the same page.\n\n### **Troubleshooting**\n\n-   If some leads are not coming through to Salesforce, check your Salesforce Duplicate Rules to make sure they don't block duplicates. Disable alerts on create, or add a condition to the rule so it only applies when records are not created by the StoreConnect Synchronisation User.\n-   Add the raw code generated by Salesforce to a page on its own and confirm this is working, then add your customisations and continue testing until you narrow down on the customisation causing the issue.\n\n## Terms\n\n**Administrator:** Someone who manages something. For example, a Salesforce Administrator would be the person responsible for managing and configuring a Salesforce Org.\n\n**CSS:** Cascading Style Sheets (CSS) is a programming language that defines the design styles; colours, font-sizes, font-types, border-colours, etc on a website.\n\n**Content Block:** Content Blocks are used to place content on your Pages and Articles. There are two types of Content Blocks 1) A Container Content Block, and 2) A Template Content Block."}