Skip to main content

Embed (Widget) Installation Instructions (v2)

Display product updates directly in your application

Chelsea Davis avatar
Written by Chelsea Davis
Updated over a week ago

Add LaunchNotes to your website or app so customers can access announcements, roadmap items, and ideas without leaving your product. The embed appears either inline as part of your page or as a popup drawer triggered by a button or link.

Embed main features:

Announcements

Roadmap items

Ideas

Feedback collection

Category segmentation

Coming soon

Pop-up & inline style

CSS customization

Advanced

Installation

Simple copy/paste snippet

Installation steps:

  1. Get your embed code

    1. Open your LaunchNotes Management Portal

    2. Navigate to Settings → API, Embed & RSS

    3. Click Embed tab

    4. Configure your widget's Title and Subtitle, then click Create

    5. We automatically will generate a token for you that will be included in your embed code.

    6. Scroll down and select if you'd like either a Popup or Inline embed style type

    7. Click Copy code

      Note: The embed codes for Popup and Inline are different

  2. Add embed code to your HTML

    1. For the Popup Embed:

      1. Paste the code at the bottom of your page or app, just inside the closing <body> tag.

    2. For the Inline Embed:

      1. Paste the code in the <body> section where you want the widget to appear.

  3. Set Up the Trigger or Target Element

    1. Add data-target="ln-embed" to the HTML element that will either trigger the popup or be replaced with the inline widget.

    2. This element will also display the unread indicator.

  4. Optional: Add a Unique User Identifier

    1. If you want to utilize a custom identifier for viewers, update the data-viewer-id="YOUR_ANON_ID" attribute with a unique, consistent identifier for each user, such as their primary key ID or email address.

    2. For added security, consider hashing this value before using it.

      Note: This unique user identifier is not required for the unread indicator to function.

  5. Optional: Add custom CSS

    1. To add custom CSS to your embed, navigate to Settings → Customize Page → Custom HTML & CSS

    2. Scroll down to the bottom of the page and the last two boxes have areas to add Custom Embed CSS and Custom Embed Header.

View this video for a walkthrough of setting the embed up on a webpage:

Example Embed Snippet

 <launchnotes-embed
data-id="emb_app_YOUR_EMBED_ID"
data-token="YOUR_EMBED_TOKEN"
data-embed-type="popup"
id="ln-embed"
data-viewer-id="YOUR_ANON_ID"
data-unread-indicator-id="YOUR_ANON_ID"
></launchnotes-embed>
<script
id="ln-embed-script"
src="https://embed.launchnotes.io/embed_v2/latest/embed.js"
type="text/javascript"
></script>

Component Parameters

data-viewer-id // Anonymous viewer ID
data-id // The unique html element ID for the embed
data-embed-type // Version of embed: Popup or Inline
data-token // API token
data-unread-indicator-id // Unique ID for user to get unread indicator
data-target // The HTML element ID for the click target

React or Dynamic DOM Updates

If your website or app uses React (or similar frameworks) that dynamically update the DOM, an additional step is necessary to ensure the embed works correctly, particularly for the unread indicator and click handlers.

The embed script automatically attaches a click event to the target you set with the data-target=ln-embed attribute. However, if you use React or something similar that dynamically updates the DOM, you can use our toggle function that is provided through window.launchnotesEmbed.togglePanel() to handle opening and closing the panel. We still require the data-target=ln-embed to attach the unread indicator.

Additional Notes

  • Content Reflected in the Widget: The embedded widget dynamically displays content from your LaunchNotes Audience Page, including Announcements, Roadmap items, and Ideas.

  • Unread Indicator Considerations: If your application dynamically updates the DOM, ensure that the unread indicator’s unique user identifier (anonymous-user-id) is retained and the embed container persists. Additional testing in production mode may be required to validate proper functionality in your environment.

Did this answer your question?