Where to Paste the SeaText JavaScript Snippet in Shopify (Exact File Path)
Paste the SeaText JavaScript snippet in theme.liquid, inside the <head> section, ideally just before the closing </head> tag. From Shopify admin, go to Online Store > Themes > Edit code > Layout > theme.liquid,...
Paste the SeaText JavaScript snippet in theme.liquid, inside the <head> section, ideally just before the closing </head> tag. This is the layout file that Shopify uses for every page, so the snippet gets site-wide reach.
From the Shopify admin, the exact path is: Online Store → Themes → ⋮ (three dots) → Edit code → Layout → theme.liquid. After you paste the code, click Save.
The exact file path in Shopify
- Log in to your Shopify admin.
- Go to Online Store in the left menu, then click Themes.
- Find the theme you are actively using. Click the three dots next to that theme and select Edit code.
- In the left file list, open the Layout folder.
- Click theme.liquid.
If you do not see Edit code, check your staff permissions. Only a store owner or a user with theme editing permission can open the code editor.
Why theme.liquid and the head section matter
theme.liquid is the master template for a Shopify theme. Every page — home, product, collection, cart — is rendered inside it. When a script is in this file, it can load on all pages automatically.
The <head> section is where Shopify expects global scripts. Putting a snippet there helps it load before the rest of the page finishes. That is useful for a tool like SeaText, which later adjusts copy, offers, and calls to action.
If you paste the snippet inside a section file, it may only run on pages that contain that section. If you paste it in a product template, it may not run on your homepage. Use theme.liquid for the global JavaScript snippet.
How the snippet connects to your SeaText account
Think of the snippet as a connector. When a page loads, it lets SeaText recognize your store and match it to the correct account. That is why the primary URL rule matters. If the domain does not match, SeaText cannot reliably associate traffic with your account.
The snippet does not rewrite your content by itself. It becomes active only after you activate specific agents in your SeaText dashboard.
What you need before you paste the snippet
- A SeaText account. The official integration instructions say: “Before you can install the script, you need a SEATEXT AI account.” If you don’t have one, create it first.
- One account per domain. Each SeaText account is linked to a single primary URL.
- A real, valid domain. Development URLs like localhost are restricted for security reasons.
- Separate accounts for separate storefronts. If you use SeaText on multiple websites, create one account for each website.
These rules matter because the snippet needs a stable URL to connect to the correct account. A mismatch is a common reason why the script appears saved but does nothing.
Step-by-step: paste and save the SeaText snippet
- Copy the code. Open the SeaText Shopify Integration page and copy the JavaScript snippet from the “Step by step integration” area.
- Open theme.liquid. Use the path above.
- Find the head tag. Scroll toward the top of theme.liquid until you see <head>. Do not paste it inside another tag.
- Paste just before </head>. This is the exact spot: near the end of the head section.
- Save the file. Click the Save button in the top right.
- Verify it loaded. Open your storefront, view the page source (right-click > View Page Source), and search for the SeaText snippet. If it is there, the file saved correctly.
Where not to paste the snippet
- Do not paste it at the end of the body. It may still load, but the official placement for a site-wide snippet is inside <head>.
- Do not paste it into a section file like header.liquid or footer.liquid. Those files may not exist on every page, and you can end up with duplicate or missing snippets.
- Do not paste it into product.liquid unless you are specifically adding the optional product-description tag. The main JavaScript snippet belongs in theme.liquid.
- Do not paste it into a non-active theme. If you edit a theme that isn’t published, the code won’t appear on your live store.
- Do not paste a snippet from another domain’s account. The code is tied to the primary URL of your SeaText account.
The separate product-description tag
The SeaText integration page includes a second part called “Implement the Tag in Your Product Descriptions.” This is not the same as the main JavaScript snippet.
After the JavaScript snippet is in theme.liquid, you may also want to add a tag around your product description output. That task happens in the product template, usually product.liquid or product-template.liquid.
If that tag is not part of your goal, skip it. The JavaScript placement question is about theme.liquid, not the product template.
Key facts at a glance
| Item | What to know |
|---|---|
| Snippet location | theme.liquid, inside <head>, before </head> |
| Admin path | Online Store > Themes > Edit code > Layout > theme.liquid |
| Account required | Create a SeaText account before installing the script. |
| URL rule | One account per primary URL; localhost and dynamic development domains are restricted. |
| Save action | Click Save after pasting the snippet. |
Limitations and edge cases
- If you use a third-party script manager like Google Tag Manager, you might be able to add the snippet without editing code. But the official SeaText instructions use theme.liquid, so start there.
- If your theme is heavily customized, theme.liquid should still exist under the Layout folder. If you can’t find it, check the file list for anything named layout with a .liquid extension.
- Multiple domains are a common trap. One account is linked to one primary URL. For a production domain and a separate staging domain, create separate accounts or use a real domain for staging.
- The script stays inactive until you activate agents. Saving the file does not start rewriting content. Activation is a separate step.
- Ad blockers or security extensions can hide the snippet in your preview even if it’s installed. Check the raw page source, not just your visual preview.
Common questions about pasting SeaText in Shopify
Do I paste the snippet in theme.liquid or in a section file?
In theme.liquid. It is the layout file that wraps every page. Section files are for page-specific blocks.
Can I paste it at the bottom of theme.liquid instead?
You could, but the official placement is inside the <head> section. Use <head> so the snippet loads early and consistently across pages.
Do I need a SeaText account before I paste the code?
Yes. The integration instructions say you need an account before installing the script.
Can I use one SeaText account on my live site and a test site?
No. Each account is linked to a single primary URL. Development URLs like localhost are restricted. Create a separate account for each website.
Will my page change immediately after I save theme.liquid?
No. The installation process is secure, and the AI remains inert until activated. After saving, you still need to activate the agents you want.
Where do I find the code to copy?
On the SeaText Shopify Integration page, in the “Step by step integration” section. The code block is labelled with the integration code.
Does pasting the snippet also add a data attribute to product descriptions?
No. That is a separate step. The product-description tag is added to product.liquid or product-template.liquid if you need it.
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
How SeaText can help
SeaText’s official Shopify Integration page gives you the copy-paste code block and the exact file path: Online Store, Themes, Edit Code, Layout, theme.liquid. You can install it quickly once you have a SeaText account and a valid single primary URL. The script stays inactive until you activate the AI agents you need, so saving the file doesn’t change your site by itself.