Getting Started with Embedded Messaging
Welcome to Embedded Messaging, the comprehensive tool for delivering rich, targeted content directly within your web application. This guide will provide you with a high-level overview of the core concepts and steps required to integrate Embedded Messaging into your site.
Initial Setup: Integrating the SDK
To get started, you must integrate the Optimove Web SDK into your website.
- Update Your Script Tag: Ensure the
script
tag on your website points to thev2
version of the websdk.- Example:
<script async src="[https://sdk.optimove.net/v2/websdk/?tenant_id=](https://sdk.optimove.net/v2/websdk/?tenant_id=)<YOUR_TENANT_ID>&tenant_token=<YOUR_TENANT_TOKEN>"></script>
- Example:
- Local Development: To test your integration, you will need to run a local web server and add
localhost
to your brand's domain mapping within your Optimove settings.- For a full walkthrough, see theSDK Setup & Local Development guide.
Using the SDK for Messaging
The SDK provides a simple and powerful API for managing messages.
- Fetch Messages: You can retrieve all messages or filter for messages in specific containers.
- Manage Message State: Programmatically mark messages as read or unread.
- Report Engagement: Send metrics for clicks and other interactions to track campaign performance.
- For detailed code examples, see theUsing the SDK for Embedded Messaging guide.
Advanced: Direct API Integration & Custom UIs
For implementations that require a completely custom UI, you can interact with the V2 REST API directly.
- V2 Endpoints:
[POST] /api/v2/embedded-messages/get
: Fetches messages for one or more containers for a given user.[POST] /api/v2/embedded-messages/report-events
: Reports user interactions likeread
,clicked
, anddeleted
events.
- Required IDs: All API calls require your
tenantId
andbrandId
. To fetch messages, you must provide either acustomerId
for a known customer or avisitorId
for an anonymous visitor.- For complete technical details, see theEmbedded Messaging API Reference.
Styling and Customization
The out-of-the-box UI components are delivered via a Shadow DOM to prevent style conflicts with your site. You can customize their appearance using CSS custom properties.
- Example:
:root { --optimove_inbox_header_background_color: #F10A69; --optimove_inbox_badge_background_color: #F10A69; }
- For a full list of variables, see theStyling & Customization guide.
Updated 1 day ago