How to Add the SeaText AI Data Attribute to Your Shopify Store
Add the SeaText AI data attribute by editing your Shopify theme’s Liquid files. Log in to Shopify admin, open Online Store > Themes > Edit Code, paste SeaText’s snippet into theme.liquid, and wrap the...
What is the SeaText AI data attribute?
An HTML data attribute is a custom attribute you add to an element, like data-example='value'. SeaText AI uses this marker in the HTML source to recognize the blocks of content it should work with. In the official Shopify integration guide, SeaText calls it the data- attribute.
The attribute matters because SeaText AI can only act on content that is installed and marked correctly. Without it, the product description may display fine, but SeaText AI may not detect the section it needs to translate, optimize, or analyze. You usually see this step near the end of the integration process, after the main JavaScript snippet is on the page.
Think of the data attribute as a label. It tells the AI exactly where the content lives. The AI does not guess. It looks for the marker. If the marker is missing, the AI cannot do its job. This is why the attribute is not optional. It is a core part of the setup.
The attribute also helps the AI avoid touching other parts of your page. Your header, footer, and navigation are not marked. So the AI leaves them alone. This keeps your store safe and stable.
Prerequisites before you start
- A SeaText AI account. The official guide says you need one before you can install the script. If you don't have one, create it first.
- Shopify admin access with theme editing permission. You will open Online Store > Themes and choose Edit Code.
- Your active theme files. The main file you need is in the Layout folder and is named theme.liquid.
- A real domain on your account. Localhost is blocked, and dynamic development domains may not work.
- A separate account for each domain. SeaText links each account to one primary URL.
Check your permissions before you start. If you cannot see Edit Code, you may need a store owner to give you access. This is a common blocker for new team members.
Also confirm which theme is active. Shopify stores can have multiple themes. You must edit the one that is live. Editing a different theme will not change your store.
Step 1: Install the SeaText AI JavaScript snippet
- Log in to SeaText AI and copy the JavaScript code from the code integration section.
- Log in to your Shopify admin.
- Go to Online Store > Themes.
- Find the theme you want to use.
- Click the three dots icon next to the theme, then choose Edit Code.
- In the file list on the left, open the Layout folder.
- Select theme.liquid.
- Paste the SeaText AI snippet into the file in the position your SeaText dashboard shows.
- Click Save.
The snippet will not change anything on its own. SeaText states that the AI remains inert until activated, so the code is safe to install before you enable any agents.
Where you paste the snippet matters. The dashboard shows a specific spot. Usually it is near the top of the file, inside the head section. This ensures the script loads early. If you paste it in the wrong place, the AI may not work correctly.
Do not paste the snippet into a product template. The main script belongs in theme.liquid. The product template only needs the wrapping markup for the description. Mixing these up is a common error.
Step 2: Add the data attribute to product descriptions
- While still in Edit Code, locate the product template. It is usually named product.liquid or product-template.liquid.
- Find the part of the file that outputs the product description.
- Wrap that output with the markup SeaText AI provides. The wrapping element is what carries the data- attribute.
- Save the file.
- Preview a product page and confirm the description is still displayed correctly.
This is normally where the data- attribute gets added. Do not guess the wrapping markup. Use the code sample from SeaText AI's documentation so the attribute name and value match exactly.
The wrapping element is usually a div or a section. It surrounds the product description output. The data attribute sits on that wrapper. The AI scans the page for this wrapper. When it finds it, the AI knows which content to process.
If your theme uses a different template name, search for it. Look for files that contain the product description. Common names include product.liquid, product-template.liquid, and product-main.liquid. Some themes use sections. In that case, look in the Sections folder.
Common mistakes to avoid
- Pasting the snippet into the wrong theme. If you have multiple themes, make sure Edit Code is open for the active theme.
- Putting the integration code in a product template first. The main snippet belongs in theme.liquid. The product template only needs the wrapping markup for the description.
- Forgetting to wrap the description output. Loading the script is only half the job. The product page also needs the data- attribute in its HTML.
- Skipping the Save button. Unsaved edits won't appear on the live store.
- Using localhost or a temporary development URL. SeaText restricts these for security and may not associate traffic reliably with your account.
- Using one account for multiple domains. Each domain needs its own SeaText AI account.
Another mistake is editing the wrong file. Some themes have multiple product templates. You must edit the one that your products actually use. Check the template assignment in your product settings.
Also avoid copying the wrapping code from memory. The exact attribute name and value matter. A small typo can break the integration. Always copy from the official documentation.
How to verify the data attribute on a product page
After you save your changes, test a real product page. Open the page in your browser, right-click the product description area, and choose Inspect or View Page Source. Look for the description element and confirm the data- attribute appears on it.
The integration guide asks you to verify that the data- attribute is present in the HTML source using your browser's developer tools. If you see it, the integration is ready. If you don't, go back to the product template and check that the wrapping element surrounds the description output code.
Use the search function in the developer tools. Type the attribute name. It should appear in the HTML. If it does not, the wrapping code is missing or incorrect.
Also check that the description still renders correctly. The wrapping element should not change the visual layout. If the description disappears, you may have placed the wrapper in the wrong spot.
What to do after the data attribute is verified
Once you see the data- attribute on a product page, the technical setup is complete. The SeaText AI snippet is loading through theme.liquid, and your product description is wrapped with the marker SeaText expects. This is the point where you can move to the SeaText AI dashboard to choose which agents to activate.
Because the AI remains inert until activated, you can install the code during a quiet period, confirm the HTML, then turn on features when you are ready. Keep the integration page open so you can return to the exact snippet if you switch themes or start a new store.
After activation, monitor your store. Check that the AI is working on the marked content. You can also test different agents. Start with one agent, like the translation agent. Then add more as you see results.
Key facts at a glance
| Element | What to know |
|---|---|
| Where the main code goes | Layout/theme.liquid in your active Shopify theme |
| Where the product wrap goes | product.liquid or product-template.liquid |
| Account requirement | One SeaText AI account per primary URL |
| Development URLs | localhost is blocked; dynamic development domains may not work |
| Activation safety | AI code remains inert until activated |
| Final check | Inspect the product page HTML for the data- attribute |
Limitations and restrictions
SeaText AI ties each account to a single primary URL. A staging store and a live store cannot share one account. Create one account for each domain. For development environments, use a valid real domain. Localhost is blocked, and dynamic development domains may not work because SeaText may not be able to match traffic to your account.
The Shopify integration steps assume the standard Online Store theme editor. Some third-party themes hide Liquid files or use different template names. In that case, find the product template through your theme documentation or use the custom-code area provided by your theme.
Also note that the data attribute only marks product descriptions. Other content types, like blog posts or collection pages, may need different markers. Check the SeaText documentation for those cases.
If you use a headless Shopify setup, the steps differ. The standard theme editor may not apply. Contact SeaText support for guidance on headless stores.
Frequently asked questions
Do I need a SeaText AI account before adding the code?
Yes. SeaText's installation steps say you need an account before you can install the script. Create one first, then copy the JavaScript code from your account.
Which file should I paste the main snippet into?
Open the Layout folder and put it in theme.liquid. That is the file the official integration guide points to.
What is the data- attribute for?
It is a marker in the HTML source that SeaText AI can detect on product pages. For product descriptions, you add it by wrapping the description output with the markup SeaText provides.
Can I use one SeaText AI account for my staging and live stores?
No. Each account is linked to a single primary URL, so separate domains need separate accounts.
What happens if I use localhost?
SeaText says development URLs such as localhost are restricted for security reasons. Use a valid, real domain.
Where can I find the exact wrapping code?
SeaText's documentation is at https://seatext.com/documentation-ai-scope. The integration guide also links to it.
What if my theme does not have a product.liquid file?
Some themes use sections or different file names. Search for the file that outputs the product description. It may be in the Sections folder. If you cannot find it, check your theme documentation.
Can I add the data attribute to other content types?
Yes, but you need the correct markup for each type. The product description is the main one. Other types may have different attributes. Check the SeaText documentation for details.
Will the data attribute affect my SEO?
No. The attribute is invisible to users. It does not change how search engines see your content. It only helps SeaText AI find the content.
How long does the integration take?
Most users finish in under 15 minutes. The steps are simple. The main time is finding the right files in your theme.
What if I switch themes later?
You will need to redo the integration. The new theme will not have the code. Keep the SeaText integration page open so you can copy the snippet again.
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
Learn more
Visit the website for more information.