In Shopify, every page of the store is built from one theme file, theme.liquid. Paste the widget code there and the chat appears on the home page, collections, products and cart.
Before you start
- The widget code of an Active chat agent, copied from Chat agentAgent profileShare, Chat button panel.
- Access to the Shopify admin with permission to edit the theme.
#Paste the code into the theme
-
Open the themes
In the Shopify admin, go to Online StoreThemes (in an admin set to Italian, Negozio onlineTemi).
-
Open the code editor
Next to the published theme, press the three dots and choose Edit code (Modifica codice in Italian).
-
Open theme.liquid
In the file search on the left, type
theme.liquidand open the file. It's in thelayoutfolder. -
Find where the header closes
Look for the
</head>tag with Ctrl + F (on Mac ⌘ + F). -
Paste and save
Paste the widget code on the line right before
</head>, then press Save (Salva in Italian).
Duplicate the theme before editing it. From the theme's three dots, choose Duplicate: if something goes wrong, you have a copy ready to publish.
Result
The widget appears on every page of the store that uses the theme.
#How to check
Open the store in a private window and follow the check in Installing the widget, checking the home page, a product page and the cart. If the store is password protected, enter the password: the password page doesn't show the widget.
#Good to know
- The code lives in the theme. If you publish another theme, or install a new version of yours, check that the code is still there. If it's missing, paste it again.
- No widget at checkout. The payment pages aren't built from the theme file, so the chat doesn't appear there.
- The .myshopify.com address. If you fill in the publishing domain with your own domain, the widget doesn't appear on the address ending in
.myshopify.com.
#Removing the widget
Open theme.liquid again, delete the line with the code and press Save.
#Frequently asked questions
The chat button covers the cart or another app's button. What do I do?
Move it to the other side in Agent profileInterface, with Button position.
Can the chat recognize customers who have an account in the store?
Yes, with a few lines in theme.liquid. The example is in Passing user data.