Seatext library

Where to Find the SeaText AI Data Attribute in Your Shopify Theme

The SeaText AI data attribute is added to your Shopify theme's code files—typically in theme.liquid, product.liquid, or collection.liquid—depending on where you want AI activation. Access these files via Shopify Admin > Online Store >...

The SeaText AI data attribute is a small HTML marker. It tells SeaText AI which pages to read and optimize. You can add it to your Shopify theme in theme.liquid, product.liquid, or collection.liquid.

To reach these files, go to your Shopify admin. Then click Online Store > Themes. Find your active theme. Click Actions > Edit code.

In the left file list, open the Layout folder to see theme.liquid. Open the Templates folder to see product.liquid and collection.liquid. Some themes use product-template.liquid instead.

Understanding Where the Attribute Lives in Your Theme

Shopify themes are made of Liquid files. Liquid is Shopify's template language. These files control what HTML appears on each page type.

theme.liquid is the layout file. It wraps every page on your store. If you add the attribute there, SeaText AI can operate across the whole site.

product.liquid is the template for product pages. It controls how product descriptions, images, and buy buttons appear.

collection.liquid controls collection or category pages. These pages list multiple products.

Some themes split product templates into smaller files. A common snippet is product-template.liquid. If your theme uses that file, open it instead.

The attribute is an HTML data attribute. It looks like this: data-seatext-ai. You place it inside a tag, usually a div or section.

Do not place it in CSS or JavaScript files. Those are not Liquid templates. SeaText AI will not see it there.

How to Confirm the Attribute Is Already Installed

Before you edit anything, check if the attribute is already there.

  1. Go to Online Store > Themes > Actions > Edit code.
  2. Use the search box at the top of the file list.
  3. Type data-seatext-ai.
  4. Look through all results.

If you see it in a .liquid file, note which file it is. If you see it in a .css or .js file, move it to the correct template.

You can also check the live page. Open a product page in your browser. Right-click and choose Inspect. Look for data-seatext-ai in the HTML. If it is not there, the attribute is not active on that page.

Remember that Shopify can cache rendered pages. Check the browser source, not just the editor.

Why the Template Choice Matters

Template choice decides coverage. SeaText AI only works on page types that contain the attribute.

If you add it to theme.liquid, every page can be optimized. That includes home, product, collection, and content pages. This is good for global personalization.

If you add it to product.liquid, only product pages are optimized. This is good for product copy, descriptions, and CTAs.

If you add it to collection.liquid, only collection pages are optimized. This helps category descriptions and local SEO.

You can add it to more than one template. That gives you broader coverage.

Do not add it to a file that is not loaded on the pages you want. For example, placing it only in cart.liquid will not affect product pages.

In Shopify, products can use custom templates. A product assigned to product.custom.liquid will not respond to changes in product.liquid unless the custom template includes the attribute too.

Adding the Attribute to the Product Template

This is the most common task for ecommerce stores.

  1. Log in to your Shopify admin.
  2. Go to Online Store > Themes.
  3. Click Actions > Edit code.
  4. Open the Templates folder.
  5. Select product.liquid. Or select product-template.liquid if your theme uses snippets.
  6. Find the product description output. It often looks like {{ product.description }}.
  7. Wrap that line in a container with the attribute.

Here is a simple example:

<div class='product-description' data-seatext-ai>
  {{ product.description }}
</div>

Save the file.

Wrapping means the opening tag goes before the product description. The closing tag goes after it. SeaText AI can then read that section.

If your theme uses blocks, place the attribute on the block wrapper that contains the description. The goal is to put the marker as close to the product copy as possible.

You can apply the same method to collection.liquid. Look for the collection description output and wrap it with data-seatext-ai.

How to Test Your Saved Changes

After saving, open a product page on your online store. Preview it if needed.

Right-click the page and choose View Page Source or Inspect. Search for data-seatext-ai.

If the attribute appears, the setup is correct. The product description should still show normally.

If you cannot see it, clear your browser cache. Old HTML may be saved locally.

Use a private or incognito window to avoid cached files.

Check that the template you edited is the one your product uses. In Shopify, go to the product details in admin. Look for the template field. Confirm which template the product uses.

Troubleshooting Checklist

  • Active theme: Make sure you edited the active theme, not a duplicate. The active theme is shown at the top of the code editor.
  • Liquid file: Confirm the attribute is in a .liquid template file. CSS and JS assets will not work.
  • Cache: Clear your cache or use Inspect to see the updated HTML.
  • Account linked: Check that your SeaText AI account is linked to the primary domain.
  • Localhost: Development URLs such as localhost are restricted. Use a real domain for testing.

Account, Domain, and Activation Prerequisites

SeaText AI is not just a code copy. It needs an account.

Create a SeaText AI account before installation. Then copy the JavaScript code from the SeaText AI dashboard. Paste it into theme.liquid or follow the SeaText instructions. The attribute can then work with that script.

Each account is linked to a single primary URL. If you use the same store on multiple domains, create a separate account for each domain. Dynamic development domains may not work.

Development URLs such as localhost are restricted for security reasons. Use a valid real domain.

The AI remains inert until you activate it. This protects your content. Installation is secure, but activation is required.

If you do not see optimization after adding the attribute, check your SeaText dashboard. Confirm the feature is active for the domain.

Frequently Asked Questions

Can I add the data attribute to multiple templates?

Yes. Add data-seatext-ai to theme.liquid for site-wide activation. Or add it to product.liquid for product pages and collection.liquid for collection pages.

Where exactly in the code should I place the attribute?

Place it within the main content wrapper. For example: <div class='product-container' data-seatext-ai>.

What if I don't see the attribute after saving?

Clear your browser cache and preview the page again. Use browser developer tools (right-click > Inspect) to check the HTML source.

Does adding the attribute affect site speed?

No. The attribute is a lightweight HTML marker. It enables SeaText's backend AI processing without slowing the frontend.

Can I remove the attribute later?

Yes. Delete the data-seatext-ai attribute from the template file and save. AI optimization will stop on affected pages.

Do I need a SeaText AI account before adding the attribute?

Yes. You need a SeaText AI account and the associated script. The account must be linked to the primary domain.

Will the attribute work on my staging site?

Only if the staging site uses a real domain and has its own SeaText AI account. Localhost and dynamic development domains are restricted.

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.