Source: https://nishanth-fern-test.docs-staging.pageloop.ai/web/adding-whatfix-javascript-to-salesforce-community

# Add Whatfix JavaScript to Salesforce Community

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

Note:

Salesforce Community Integration can only be done for accounts that use the [JS Embed](/web/integrating-whatfix-using-javascript) model. Customers using the [Browser Extension](/web/integrate-whatfix-using-browser-extension) 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](/images/57/SF_community_builder-57a05e87.png)
2. Click the **Settings** icon. ![SF\_community\_settings.png](/images/07/SF_community_settings-075d2807.png)
3. Click **Advanced**. ![SF\_community\_advanced.png](/images/35/SF_community_advanced-35a546d2.png)
4. In the **Head Markup** section, click **Edit Head Markup**. ![SF\_community\_edit\_markup.png](/images/21/SF_community_edit_markup-218e8e85.png)
5. Add Whatfix JavaScript in the pop-up, and then click **Save**. ![SBC\_head-popup.png](/images/f5/SBC_head-popup-f50fb939.png)
6. Click **Security** in the settings menu. ![SF\_community\_security.png](/images/73/SF_community_security-73b8ac2c.png)
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](/images/5c/SF_community_CSP-5cfc905d.png)
8. Under Trusted Sites for Scripts, click **+Add Trusted Site**. ![SF\_community\_trustedsites.png](/images/4c/SF_community_trustedsites-4ca594a9.png)
9. Enter the following details in the pop-up.

- Name- Whatfix
- URL- <https://whatfix.com/>

1. Select the **Active** checkbox, and then click **Add Site**. ![SBC\_ADDsite\_popup.png](/images/ca/SBC_ADDsite_popup-ca33a65b.png)
2. 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](/images/e9/Screenshot-2021-08-18-at-4.03.43-PM-e94039b0.png)

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](/web/whitelisting-whatfix-domains-on-salesforce).

## Related

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