Getting Started

Welcome to OpenWeb: your unified, end-to-end suite for building a community.

The first step to implementing any OpenWeb product is the launcher code. The launcher code is a JavaScript library that enables and configures OpenWeb products and features on your pages:

  • Configuring when products and features load
  • Navigating users to a specific thread from a notification or a shared link
  • Embedding multiple instances of products on an infinite scroll page with multiple articles
  • Defining topics for products, such as Popular in the Community, Reactions, and Topic Tracker


Implementation

When you implement the launcher code, enabled OpenWeb products appear where the default position script has been placed on page.

๐Ÿ“˜

The Launcher code should not be lazy-loaded or otherwise deferred to ensure the correct behavior of OpenWeb products:

  • Navigating users directly to the conversation from a notification
  • Generating accurate analytics
  • Providing monetization opportunities

OpenWeb optimizes the loading of its different components to negate any impact on page load performance while maintaining a streamlined user experience.


To add the launcher code to your site, use the following steps:

  1. Add the launcher code to the<head>section of your page.
    <script async src="https://launcher.spot.im/spot/SPOT_ID"></script>
    
  2. Replace the SPOT_ID placeholder with your Spot ID. Your Spot ID is your unique OpenWeb identifier. When you log into your OpenWeb Admin Portal, you can copy your Spot ID from the URL: https://admin.spot.im/spot/SPOT_ID/...

  1. Add the default positioning <div> element where your enabled OpenWeb products should appear on the page.
    <div 
        data-spotim-module="default"
        data-spot-id="SPOT_ID"
        data-post-id="POST_ID"
        data-post-url="ARTICLE_URL"
        data-article-tags="ARTICLE_TOPIC1, ARTICLE_TOPIC2">
    </div>
    
  2. Define the article identifier (data-post-id).
  3. (Recommended) Define the URL of the page (data-post-url).
  4. (Optional) Define the topics of the article (data-article-tags).
  5. (Optional) To delay enabled products from displaying automatically, add data-spotim-autorun: "false" to the relevant HTML element. To display the product, either dynamically remove this attribute or change its value to "true".

    ๐Ÿ“˜

    Once the product has been displayed, resetting data-spotim-autorun to "false" will have no effect.


Customize the product location

To customize the on-page placement of specific OW products, you can add a positioning <div> element for each product you want to position differently from the default.

The following table lists the available positioning <div> elements for each OW product.

ProductPositioning
ConversationRegular: <div data-spotim-module="conversation" data-spot-id="SPOT_ID" data-post-id="POST_ID"></div>
Community SpotlightRegular: <div data-spotim-module="spotlight"></div>
Sidebar: <div data-spotim-module="spotlight" data-spotlight-sidebar></div>
Popular in the CommunityHorizontal: <div data-spotim-module="pitc"></div>
Vertical: <div data-spotim-module="pitc" data-vertical-view="true"></div>
ReactionsHorizontal: <div data-spotim-module="reactions"></div>
Vertical: <div data-spotim-app="reactions" data-vertical-view="true"></div>
Topic TrackerRegular: <div data-spotim-module="topic-tracker"></div>
Sidebar: <div data-spotim-module="topic-tracker" data-vertical-view="true"></div>
Standalone AdStandard: <div data-openweb-ad data-row="1" data-column="1"></div>
Dynamic: When using this implementation method, you can choose one or more named <div> elements to use for monetization.


Customization Attributes

Use these attributes to customize your OW experience. These apply to all embedded OpenWeb products.

Attribute Description
data-article-tags string Informs OpenWeb of the main topics of the article

Multiple topics can be added by delimiting with a comma. The values of this attribute should usually align with the KEYWORDS metadata schema.
data-post-id string Unique article identifier that is specific to the article page

The ideal POST_ID has the following characteristics:
  • Aligns with the URL slug (an-article-title) or article ID (14325)
  • Is less than 50 characters, ideally 15 characters
  • Uses a combination of letters, numbers, dashes (-), or hyphens (_)
  • Except for the regex [^\w\s\-\:\.\$\~], does not include special characters
data-post-url string Full URL address of the page in which the launcher code is embedded

The post URL helps OpenWeb know the source URL of a post ID. This is especially useful when post IDs are reused across multiple pages, single page applications, and infinite scroll implementations. Each post ID should have only one post URL.

NOTE: This attribute must match the actual URL of the original page where the launcher code is embedded, even if that page has a different canonical URL. For example, a news aggregator that uses canonical URLs to mark the original source of an article, must still use the reprintโ€™s actual URL for this attribute.
data-spotim-autorun boolean Determines if an OpenWeb product loads automatically during page load

Possible values:
data-theme string On a specific page, sets the theme of the product

Possible values:
  • light: (Default) Light OpenWeb theme. Use this theme for pages that have a light background. If using the default theme, this attribute does not need to be included in the launcher code.
  • dark: Dark OpenWeb theme. Use this theme for pages with a dark background

To set the background for all products site-wide, use the Admin Panel.
data-custom-CUSTOMPARAM string Custom reporting parameter for a specific pageview or page type

This is useful to provide additional granularity to data exports and BI reports. When using this attribute, replace CUSTOMPARAM with the name of the custom parameter.

The attributes are taken from the first launcher script element found on the page. Subsequent launcher script elements are ignored.

Conversation-specific Attributes

The following launcher code attributes apply only Conversation implementations. You can also add one of the general launcher code attributes.

Attribute Description
data-author-id string Controls the display of an Author Badge next to the author's name
data-messages-count number Controls the initial number of displayed messages in Conversation
data-post-staleness-days number Controls the number of days after which the post becomes read-only
data-read-only boolean Controls if additional comments could be added to an article

This attribute must be set to true to disallow any additional comments or replies from being posted.
data-seo-enabled boolean Controls if OpenWeb makes an API call to the SEO API when a page is rendering and embeds the SEO markup into the HTML of your page

OpenWeb recommends a backend integration for improved indexing results.
data-social-reviews string Controls displaying a star rating that allows users to provide feedback on and to rate the content



Possible values:
  • true
  • false
data-sort-by string Controls the sorting for an article, overriding the default sort setting of the site

Possible values:
  • best
  • newest
  • oldest