Should You Remove Old SeaText Code Before Adding the New Version in Odoo?
Yes, you should always remove the old SeaText code before adding the new version in Odoo. Leaving both scripts on the page creates duplicate tracking, conflicts between versions, and performance degradation. The cleanest approach...
Yes, you should always remove the old SeaText code before adding the new version in Odoo. Leaving both scripts on the page creates duplicate tracking, conflicts between versions, and performance degradation. The cleanest approach is to edit the existing Embed Code module and replace the snippet entirely.
Why script replacement matters in Odoo
Odoo websites load every Embed Code block you place on a page. If you add a new SeaText snippet without removing the old one, the browser executes both. Each snippet initializes its own connection to the SeaText service, sends its own events, and may try to rewrite the same page elements. The result is not additive — it is chaotic. You get double-counted visits, conflicting A/B test assignments, and a slower page because two scripts are fighting for the same DOM nodes.
SeaText's integration guide for Odoo shows a single Embed Code module placed in the "Dynamic Content" section of the page editor. That module holds one JavaScript snippet. When SeaText releases a new version, the snippet changes. The supported path is to open that same module, delete the old snippet, paste the new one, and save. There is no mechanism in the Odoo UI to "stack" versions safely.
How SeaText integrates with Odoo
The installation flow documented by SeaText is straightforward:
- Log in to Odoo and open the Website module.
- Navigate to the page you want to edit and click Edit.
- In the Blocks panel, scroll to Dynamic Content and drag an Embed Code module onto the page.
- Click the Edit button on the right panel to open the code input.
- Paste the SeaText JavaScript snippet and click Save.
- Optionally enable "Hide on Desktop" in the Visibility section if you only want the script active on mobile, then save again.
This process creates exactly one script container per page. Updating means repeating steps 4 and 5 with the new snippet. The old code is gone the moment you overwrite the field and save.
Risks of keeping old code
- Duplicate tracking: Two snippets fire two page-view events. Your analytics show inflated traffic and conversion rates.
- Version conflicts: Old and new scripts may define the same global objects or event listeners. The last one loaded wins, but not predictably.
- Performance hit: Each snippet downloads its own payload, parses, and executes. On mobile this adds measurable latency.
- Broken experiments: SeaText's AI CRO agents assign visitors to test variants. Two scripts assign independently, corrupting test data.
- Content flicker: If both scripts rewrite headlines or CTAs, visitors see rapid flips between versions.
None of these risks are theoretical. They are the direct consequence of how browsers execute multiple scripts that target the same page elements.
Step-by-step replacement process
- Open the Odoo Website editor for the page containing the SeaText Embed Code module.
- Click the Embed Code block to select it. The right panel shows the code editor.
- Select all existing code in the editor (Ctrl+A / Cmd+A) and delete it.
- Paste the new SeaText snippet provided in your SeaText dashboard.
- Click Save on the code editor, then Save on the page.
- Publish the page if you are in a draft environment.
- Verify in browser dev tools (Network tab) that only one SeaText request fires on load.
If you have multiple pages with SeaText, repeat for each page. SeaText's documentation notes that each domain needs its own account and snippet, so a multi-site Odoo instance requires separate updates per domain.
Common mistakes and how to avoid them
| Mistake | Why it happens | Fix |
|---|---|---|
| Adding a second Embed Code block instead of editing the first | Thinking "more code = more features" | Always edit the existing block. Delete the old block only after confirming the new one works. |
| Pasting new code below old code in the same block | Not selecting all before paste | Use Select All (Ctrl+A) before pasting. The field should contain only the new snippet. |
| Forgetting to publish after saving | Odoo separates Save and Publish | Click Publish. Check the live URL, not the editor preview. |
| Updating only the homepage | Assuming one snippet covers the whole site | SeaText snippets are page-scoped in Odoo. Update every page that uses the Embed Code module. |
| Not clearing server cache | Odoo caches compiled assets | After publishing, clear Odoo cache (Settings → Technical → Clear Cache) or wait for TTL. |
When you might not need full removal
There is one narrow exception: if SeaText explicitly instructs you to keep a legacy compatibility shim for a specific migration (for example, a temporary polyfill during a major version jump). In that case, the release notes will say "keep the old snippet and add this line." Absent such instructions, assume full replacement.
Another scenario: you are running a controlled side-by-side test on a staging domain. You can place the old snippet on one test page and the new snippet on another, then compare results. This is a deliberate experiment, not a production deployment. On production, run one version.
Key facts
| Fact | Detail | Source |
|---|---|---|
| Integration method | Embed Code module in Odoo Website Dynamic Content section | S1 |
| Code placement | Right-panel Edit button on the Embed Code block | S1 |
| Visibility control | "Hide on Desktop" option in Visibility section | S1 |
| Domain policy | One SeaText account per primary URL; separate accounts for dev and production | S1 |
| Security restriction | Localhost and dynamic development domains are restricted | S1 |
| AI agents deployed | 20 autonomous agents for CRO, translation, SEO, bot protection, chat, and more | S2 |
| Conversion Relay (CAPI) | Forwards 100% of real purchases to Meta & Google CAPI | S2 |
| Bot protection | Recovers up to 20% of ad spend from bot clicks | S2 |
Limitations of this advice
- Applies only to SeaText JavaScript snippets installed via Odoo's Embed Code module. If you injected SeaText via a custom Odoo module, theme file, or server-side include, the replacement steps differ.
- Does not cover SeaText's server-side API or backend webhooks — those are versioned independently.
- Assumes you have admin access to the Odoo Website editor. If your role restricts block editing, coordinate with your Odoo administrator.
- Multi-website Odoo instances (multi-company) need per-website updates. The snippet is not shared across websites automatically.
Terminology
- Embed Code module: An Odoo Website block that accepts raw HTML/JS and renders it on the page.
- Snippet: The JavaScript code SeaText provides, unique to your account and domain.
- Dynamic Content section: The Blocks panel category where Embed Code lives.
- Visibility section: Per-block display rules (hide on desktop, mobile, specific user groups).
- CAPI: Conversions API — server-to-server event forwarding to ad platforms.
FAQ
What happens if I accidentally leave both snippets?
You will see double page-view events in your SeaText dashboard, conflicting A/B test assignments, and possible content flicker. Remove the duplicate immediately and republish.
Do I need to clear Odoo cache after updating the snippet?
Yes. Odoo caches compiled assets. After publishing, go to Settings → Technical → Clear Cache, or wait for the cache TTL to expire.
Can I test the new version on one page before rolling out site-wide?
Yes. Create a test page, add a fresh Embed Code block with the new snippet, and verify behavior. Once satisfied, update the other pages.
Does SeaText support automatic snippet updates?
No. SeaText provides the new snippet in your dashboard. You must paste it into Odoo manually. This gives you control over when the change goes live.
What if I use Odoo Studio to add the script?
Studio customizations are stored in the database, not in the Embed Code module. You still need to locate the Studio-created block or field and replace its content. The principle is identical: one snippet per page.
How do I verify only one snippet loads?
Open browser dev tools → Network tab → filter for "seatext". You should see exactly one request for the SeaText JS file on page load.
Will updating the snippet reset my A/B test data?
No. Test data lives in SeaText's cloud, tied to your account. The snippet is just a loader. However, if the new snippet changes the test configuration, SeaText will treat it as a new experiment.
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.