Gorgias logo
Gorgias logo

All articles

Customize Chat using JavascriptUpdated 8 days ago

You can configure the Chat behavior with URL query parameters to share links with your customers - when a customer clicks the link, the specified page will load and the Chat will perform the desired behavior.



Common URL query parameters

Open Chat on page load

You can make the Chat open automatically when the page loads by adding the gs_open_chat parameter to your URL (notice the gs_ which stands for Gorgias). The resulting store URL is now www.my-store.com?gs_open_chat.

Set the default Chat page

You can set up a Chat page that will be showing by default for your customers with the query parameter gs_chat_page. The value can be either conversation (for the Chat messages page) or homepage (for the self-service page, to fall back to the Chat messages page if self-service is disabled).

For instance, www.my-store.com?gs_chat_page=conversation sets the conversation page as the default one, while www.my-store.com?gs_chat_page=homepage sets the self-service page as the default one.

Pre-fill user messages

You can direct your customers to a URL where the Chat will have a pre-filled message by using the query parameter gs_chat_message=mymessage where the mymessage part is your custom message, but it must be URL encoded. 

For example, the message "I want information on product..." must be URL-encoded as I%20want%20information%20on%20product... So the URL to your store would be www.my-store.com?gs_chat_message=I%20want%20information%20on%20product...

You can use online tools to encode a string such as urlencoder.org.


Using more than one parameter simultaneously

If you, for example, want to open the Chat automatically, and also set the default page as conversation, and pre-fill the user message with "Hello" - you can combine all the parameters in a single URL by separating them with an &, so the URL would be www.my-store.com?gs_open_chat&gs_chat_page=conversation&gs_chat_message=Hello.

Was this article helpful?
Yes
No