+ Start a Discussion
FG DeveloperFG Developer 

Post-chat Survey Integration: gives a ‘Refused to Connect’ error

Can anyone help me to resolve an issue with implementing a post-chat survey after ending a chat? 

After I end the chat session, I could see a 'Leave a feedback' button and it takes me to the new page but the created survey is not showing but giving an error.

Created all in the sandbox following the steps from https://chatbotslife.com/salesforce-surveys-in-embedded-service-for-chat-formerly-snap-ins-76224fb6729f#ee02

Followed by https://chatbotslife.com/salesforce-surveys-in-embedded-service-for-chat-formerly-snap-ins-76224fb6729f#ee02

1. Created a feedback (grabbed surveyId as of 0Kd***************)
2. Created a community (grabbed networkId as of 0DB***************)
3. Added required object relationships
4. Added Chat Survey Redirect controller & page through Developer Console, Apex Classes > Profiles, and Visualforce Pages
(In Community Workspaces, Administration> Pages > there was no selection as of 'Community Builder Page', so I just selected 'Default Page')
5. Added Post-Chat URL to Chat BUtton configuration as of
(Can I use Post-Chat Page as of 'SurveyRedirectPage' instead of URL? It doesn't matter to use either Page or URL for Post-Chat?)
6. Created Process Builders, saved, and activated.
Also checked the CSP and CORS however this error appears. 
livechat-fg.cs35.force.com refused to connect
FG DeveloperFG Developer
User-added image
Guillaume LoubierGuillaume Loubier
I had the same issue and finally got it working after I went to Setup > Security > Session Settings and added the following as Whitelisted Domains:
- The URL of my salesforce site: https://domain.csXX.force.com/

I've also set the clickjack protection level on the community site from which I host the survey to Allow framing of site or community pages on external domains (Good protection)

It initially worked once I whitelisted *.force.com completly, but then I reduced to the domain
You basically need to whitelist the URL from which you host the chat, not the survey.

My survey is hosted on a community. And I have a separate site used to host the chat only (iframed on an external app)

Aidan Fowler 14Aidan Fowler 14
I am having the same issue even after adding my site (where the survey) is hosted to the session settings whitelist and chaning the clickjack protection on the community site. Does anyone know if this is due to recent updates to the digital experience licesnse?

When I debug the post chat give feedback button the survey invitation url hosted on the site is returned correctly. I also tried enabling clickjack protection for customer visualfroce pages with headers disabled to no avail.