Prerequisites
- A Marketrix account with at least one application
- At least one agent created and tested
- Knowledge uploaded to your application
- Access to your website’s HTML or CMS
Step 1: Create the Integration
- Log into your account at the Marketrix dashboard
- Click Widgets in the left sidebar
- Click Create Integration
- Select Widget as the integration type
- Choose your application and agent
- Give the integration a descriptive name (e.g., “Website Support Widget”)
Step 2: Configure the Widget
All widget configuration is done in the Marketrix dashboard. After creating the integration, you can configure:- Header and body text — the title and description shown in the widget
- Greeting message — the initial message users see when they open the widget
- Quick action chips — shortcut buttons for common user actions
- Interaction modes — enable or disable Tell, Show, and Do modes
- Human handoff — allow escalation to a human agent
- Appearance — colors, position, dimensions, border radius, and more
- Device visibility — show on desktop, mobile, or both
Step 3: Deploy to Your Website
Copy the integration code from the dashboard and paste it into your website before the closing</body> tag:
| Attribute | Required | Description |
|---|---|---|
mtx-id | Yes (production) | Your unique integration identifier |
mtx-key | Yes (production) | Your integration authentication key |
mtx-api-host | No | Marketrix API endpoint (defaults to production) |
mtx-ai-host | No | Marketrix AI agent endpoint (defaults to production) |
mtx-id and mtx-key. There are no other script attributes to set.
Development Mode
For local development and testing, you can usemtx-app and mtx-agent attributes instead of mtx-id and mtx-key:
| Attribute | Required | Description |
|---|---|---|
mtx-app | Yes (dev mode) | Your application ID (integer) |
mtx-agent | Yes (dev mode) | Your agent ID (integer) |
mtx-id + mtx-key (production) or mtx-app + mtx-agent (development). Do not mix both.
Platform-Specific Instructions
HTML websites: Paste the script before the closing</body> tag in your HTML files.
WordPress: Add the script to your theme’s footer.php, or use a plugin that allows adding scripts to the footer.
Shopify: Add the script to your theme.liquid file before the closing </body> tag.
Squarespace / Wix: Use the built-in code injection feature to add the script to your site footer.
Step 4: Verify the Integration
- Visit your website in a browser
- Confirm the widget appears in the configured position
- Click the widget to open it
- Send a test message and verify the agent responds
- Test each enabled interaction mode (Tell, Show, Do)
Troubleshooting
Widget Not Appearing
- Verify the script tag is placed before
</body> - Check the browser console for JavaScript errors
- Confirm the
mtx-idandmtx-keyvalues are correct - Ensure the script URL (
https://widget.marketrix.ai/standalone.mjs) is not blocked by your CSP or ad blockers
Widget Not Responding
- Check that the application and agent are active in the dashboard
- Test the agent in the Marketrix playground first
- Look for network errors in the browser console (failed SSE connections)
- Verify network connectivity to the AI agent endpoint and the API endpoint
Agent Not Using Knowledge
- Confirm knowledge is assigned to the agent in the dashboard
- Verify the agent is linked to the correct application
- Test with questions that directly relate to your uploaded content
Next Steps
- Customize your widget — fine-tune appearance and behavior
- Test your integration — thorough testing checklist
- Troubleshoot issues — common problems and solutions

