How to Add the SeaText Snippet to Shopify with Google Tag Manager
Add the SeaText snippet to Shopify through GTM by installing the GTM container snippet in theme.liquid, then creating a Custom HTML tag in GTM that contains the SeaText JavaScript and fires on all pages....
Add the SeaText snippet to Shopify with Google Tag Manager by installing the GTM container snippet in your theme first, then creating a Custom HTML tag inside GTM that holds the SeaText JavaScript. Fire that tag on all pages. Before you can do any of this, you need a SeaText account and a copy of the JavaScript snippet from the SEATEXT AI integration section.
This guide walks through the setup in ordered steps, including the product description tag and how to verify everything is running.
What you need before you start
You need five things before you begin:
- A SeaText account. The SeaText integration page says you need one before you can install the script.
- The SeaText JavaScript snippet. You copy it from the SEATEXT AI integration section.
- Admin access to your Shopify store so you can edit theme code.
- A Google Tag Manager account with a container created. You will need the container ID, usually GTM-XXXXXXX.
- A valid, real domain. Development URLs such as localhost are restricted.
Step 1: Get your SeaText snippet and account
If you don't have a SeaText account yet, create one first. The integration instructions say you need an account before you can install the script.
Once logged in, go to the SEATEXT AI integration section and copy the JavaScript code that appears there. Store it somewhere safe. This is the snippet you will give to Google Tag Manager.
Keep the domain rule in mind: each SeaText account is linked to a single primary URL. If you want to test on a development domain and go live on a production domain, create a separate account for each. Localhost is blocked, and dynamic development domains may not work reliably because SeaText may not be able to associate traffic with your account.
Step 2: Add the GTM container to Shopify
Google Tag Manager cannot load anything until its own container snippet is in your theme. This is a one-time code edit.
- Log in to your Shopify admin.
- Go to Online Store and open Themes.
- Next to your active theme, click Actions and choose Edit Code.
- Open the Layout folder and click theme.liquid.
- Paste the first GTM snippet right after the opening head tag.
- Paste the second GTM snippet, the noscript version, right after the opening body tag.
- Click Save.
Do not paste SeaText into theme.liquid at this point. The next step attaches SeaText to GTM instead. That way you can update the snippet without editing theme code again.
Step 3: Create the SeaText Custom HTML tag in GTM
Now open Google Tag Manager and add the SeaText snippet as a tag.
- Open your GTM workspace.
- Click Tags, then click New.
- Click Tag Configuration and choose Custom HTML.
- Paste the SeaText JavaScript snippet you copied in Step 1.
- Click Triggering and choose All Pages. For product-only setup, use a page path trigger for product pages.
- Click Save and give the tag a clear name, such as SeaText - All Pages.
A tag in GTM does not run until you submit and publish the container. Use Preview mode before you publish.
Step 4: Add SeaText's product description tag (if needed)
SeaText's Shopify integration also includes a tag for product descriptions. Do not put this one in GTM. It belongs in the theme template that renders the product description.
- In Shopify admin, go to Online Store and open Themes.
- Click Actions and choose Edit Code.
- Find the product template. The SeaText source names product.liquid or product-template.liquid as typical locations.
- Locate the product description output code.
- Wrap that output with the data attribute or wrapper SeaText provides in its documentation.
- Click Save.
After saving, preview a product page and inspect the HTML source with your browser's developer tools. Verify that the data- attribute appears in the output.
Step 5: Verify the SeaText snippet is loading
Verification is the step that catches the most mistakes. Do not skip it.
- In GTM, click Preview to open Tag Assistant.
- Open your Shopify store in another tab and reload the page.
- Check whether the SeaText - All Pages tag fires.
- Open the browser's developer tools and switch to the Network tab. Look for a request from the SeaText script.
- If you added the product description tag, open a product page and inspect the HTML source for the data- attribute.
If the GTM tag fires but no script appears in the Network tab, check the trigger and confirm the container version was published. If the script appears but the product attribute is missing, the problem is in the product template, not in GTM.
Common mistakes and how to avoid them
- Installing without an account. SeaText says you need a SEATEXT AI account before installing the script.
- Using the same account for multiple domains. Each account is linked to one primary URL. Use separate accounts for separate domains.
- Testing on localhost. Development URLs are restricted, so use a valid real domain.
- Publishing GTM without previewing. Always preview first, then publish.
- Pasting SeaText into both theme.liquid and GTM. This can load the snippet twice. Pick one method.
- Editing the wrong theme. Make sure you edit the live theme, not a duplicate.
- Trying to wrap product descriptions inside GTM. That wrapper goes in product.liquid or product-template.liquid.
Key facts: SeaText installation and domain rules
The table below lists the facts from the SeaText Shopify integration page.
| Fact | Detail |
|---|---|
| Account requirement | You need a SEATEXT AI account before installing the script. |
| Snippet source | Copy the JavaScript code from the SEATEXT AI integration section. |
| Domain binding | Each SEATEXT AI account is linked to a single primary URL. |
| Multiple domains | Create separate accounts for each domain. |
| Development URLs | Localhost is restricted; use a valid real domain. |
| Security | The installation process is secure and the AI remains inert until activated. |
| Product description tag | Wrap the product description output and verify the data- attribute in the HTML source. |
Limitations and when this guide doesn't apply
This guide assumes a standard Shopify Online Store 2.0 theme with a theme.liquid file. Most themes work this way, but headless setups or heavily customized themes may place scripts differently.
GTM fires tags asynchronously. If the SeaText documentation asks for a specific trigger, such as DOM Ready or Window Loaded, use that trigger instead of All Pages. The right trigger depends on what the script needs to access on the page.
The domain rule still applies when you use GTM. A SeaText account is linked to one primary URL, and development URLs such as localhost are restricted. If you move from a staging subdomain to your production domain, plan to create a separate account rather than assuming the same snippet works.
If you don't want to use GTM at all, you can paste the SeaText snippet directly into theme.liquid using SeaText's Shopify integration steps. GTM is a management layer, not a requirement for SeaText.
SeaText and GTM: terminology in plain English
- Snippet: a small piece of JavaScript you add to a page.
- Container: your Google Tag Manager workspace and its settings.
- Tag: a code block in GTM that fires when conditions are met.
- Trigger: the condition, such as All Pages, that tells a tag when to run.
- theme.liquid: the main layout file in your Shopify theme that wraps every page.
Frequently asked questions
Do I need a separate SeaText account for my dev store?
Yes. Each SeaText account is linked to a single primary URL, and localhost is restricted. Use a real domain for each environment.
Can I install SeaText without GTM?
Yes. Paste the snippet directly into theme.liquid or follow SeaText's Shopify integration steps. GTM just makes it easier to manage the snippet.
Why use GTM if I can paste the snippet into theme.liquid?
GTM lets you update the snippet, add triggers, and manage other third-party scripts in one place without editing theme code each time.
Where do I paste the GTM container in Shopify?
In theme.liquid. Add the first part after the opening head tag and the noscript part after the opening body tag.
How do I know the SeaText snippet is working?
Use GTM Preview mode to confirm the tag fires, then check the Network tab for the script. For the product description tag, inspect the page's HTML source for the data- attribute.
Does the product description tag need GTM?
No. It belongs in the product template, usually product.liquid or product-template.liquid.
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
How SeaText can help
SeaText gives you a JavaScript snippet designed for your Shopify store. The installation process is secure, and the AI stays inert until you activate it. Before you install, create a SeaText account and use a valid real domain, because each account is tied to one primary URL. For product descriptions, SeaText also provides a separate data-attribute tag that you wrap around the product description output in your theme template.
Use the official integration guide to see the exact code your account generates and to avoid placing the snippet in the wrong file.