---
title: "Add Whatfix JavaScript to Salesforce Community"
slug: "adding-whatfix-javascript-to-salesforce-community"
updated: 2025-02-24T04:10:51Z
published: 2025-02-24T04:10:51Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.whatfix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Whatfix JavaScript to Salesforce Community

Display Whatfix content on Salesforce Community by adding the Whatfix JavaScript to the header of every community page.

:::(Warning) (Note:)
Salesforce Community Integration can only be done for accounts that use the [JS Embed](/studio/docs/integrating-whatfix-using-javascript){target=`_blank`} model. Customers using the [Browser Extension](/studio/docs/integrate-whatfix-using-browser-extension){target=`_blank`} model cannot perform this integration.
:::

Use the following steps to add Whatfix JavaScript to the Salesforce community:

1. Open Community Builder in Salesforce Lightning.
![SF_community_builder.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/SF_community_builder.png){height="264" width="331"}

2. Click the **Settings** icon.
![SF_community_settings.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/SF_community_settings.png){height="333" width="227"}

3. Click **Advanced**.
![SF_community_advanced.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/SF_community_advanced.png){height="413" width="205"}

 4. In the **Head Markup** section, click **Edit Head Markup**.
![SF_community_edit_markup.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/SF_community_edit_markup.png){height="157" width="519"}

5. Add Whatfix JavaScript in the pop-up, and then click **Save**.
![SBC_head-popup.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/SBC_head-popup.png){height="566" width="1292"}

6. Click **Security** in the settings menu.
![SF_community_security.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/SF_community_security.png){height="412" width="206"}

7. In the **Content Security Policy (CSP)** section, under **Security Level**, click the dropdown, and then select **Relaxed CSP: Permit Access to Inline Scripts and Allowed Hosts**.
![SF_community_CSP.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/SF_community_CSP.png){height="345" width="811"}

8. Under Trusted Sites for Scripts, click **+Add Trusted Site**.
![SF_community_trustedsites.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/SF_community_trustedsites.png){height="162" width="805"}

9. Enter the following details in the pop-up.
*  Name- Whatfix
*  URL- https://whatfix.com/ 

10. Select the **Active** checkbox, and then click **Add Site**. 
![SBC_ADDsite_popup.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/SBC_ADDsite_popup.png){height="341" width="651"}

11. Similarly, add the following domains as mentioned in steps 8, 9, and 10.
* **https://cdn.whatfix.com**
* **https://whatfix.com**  
* **https://www.google-analytics.com** (Optional only for Custom GA integration)
* **https://analytics.google.com** (Optional only for Custom GA integration)
![Screenshot 2021-08-18 at 4.03.43 PM.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/Screenshot%202021-08-18%20at%204.03.43%20PM.png){height="" width="500"}

:::(Warning) (Note:)
Ensure that you whitelist Whatfix Domains in the respective Salesforce Lightning Instances as well. For more information, see [Whitelist Whatfix domains on Salesforce Lightning](/studio/docs/whitelisting-whatfix-domains-on-salesforce){target="_blank"}.
:::

## Related

- [Remove Whatfix JavaScript from Salesforce Community](/remove-whatfix-javascript-from-salesforce-community.md)
- [Salesforce Lightning Integration](/salesforce-integration-1.md)
