Playbooks

Implementing Moments via the Moments JS SDK (Embedded)

19min

Overview

This playbook serves as a comprehensive guide for implementing the MomentScience Moments JS SDK as an embedded unit within your web page or mobile app. The goal is to provide detailed instructions and best practices to help you maximize revenue and enhance customer engagement post-transaction.

Moments JS SDK

MomentScience Moments JS SDK is designed to integrate seamlessly into your existing web infrastructure. It provides a powerful tool to deliver personalized offers to your customers at crucial moments in their purchasing journey. By embedding the SDK, you can transform the post-transaction experience into an opportunity for increased engagement and revenue.

Key Features

  • Personalized Offers:
    Deliver targeted Offers based on user data to increase relevance and engagement.
  • Embedded Mode:
    Integrate Offers directly into your webpage or app for a seamless user experience.
  • Customization Options:
    Use the MomentScience dashboard to easily tailor the appearance and behavior of your Offers.
  • Advanced Targeting:
    Enhance your targeting capabilities by passing payload values and using macros for personalization.
  • Real-time Tracking:
    Implement postbacks and callback functions to track user interactions and conversions in real-time.

Background

By default, the MomentScience Moments JS SDK has the following characteristics:

  • Single Offer Display: By default, the SDK shows one Offer at a time in a sequential manner.
  • Modal (Pop-up) Container: The Offers are displayed in a modal or pop-up container. This modal appears over the current content on the page.

Default JS SDK Implementation

Document image
ο»Ώ

Desired Implementation as an Embedded Unit

Document image
ο»Ώ

Steps

To implement the MomentScience Moments JS SDK as an embedded unit on your web page or inside a webview in a mobile app, follow these detailed steps:

Step 1: Identify/Create the Container Element

1. Identify or Create a <div> Element:

  • Determine where you want the MomentScience unit to be displayed on your page.
  • Create a <div> element that will serve as the container for the MomentScience unit.

Example HTML:

HTML
ο»Ώ

Step 2: Copy & Paste the Moments JS SDK Code Snippet

  1. Obtain the SDK Code:
  2. Insert the SDK Code into Your Web Page:
    • Paste the obtained SDK code into the <head>section of your web page to ensure it loads correctly.

Step 3: Enable Embedded Mode

1. Configure the SDK for Embedded Mode:

  • Modify the SDK initialization code to specify that it should operate in Embedded Mode.

Step 4. Customize the interface and behavior

Once you've followed the steps above, you should have an embedded MomentScience unit on your site - but it may not match your desired style guides (colors, etc). To better match your overall user experience, MomentScience provides a convenient way to change these settings directly from the MomentScience dashboard.

  1. Access Customization Options:
  2. Adjust Appearance and Behavior:
    • Use the dashboard settings to customize the look and feel of the MomentScience unit to match your site’s design guidelines.
Document image
ο»Ώ

Step 5: Change the Number of Ads and Other Properties

  1. Modify Display Settings:
    • In the MomentScience dashboard, go to the Configuration Section.ο»Ώ
    • Adjust the "Number of Ads" to control the number of Offers to present at a time as needed without changing the code.
Document image
ο»Ώ

Step 6: Pass Payload Values for Targeting, Reporting, and Personalization (Optional)

Enhancing or optimizing your implementation of MomentScience can be achieved by passing payload information when the MomentScience unit is loaded. This additional data allows the platform to:

  • Target Offers More Effectively:
    Using payload values helps MomentScience deliver more relevant offers to users, increasing the chances of conversion and overall yield.
  • Improve Reporting:
    Payload values can be utilized to segment and analyze performance across different dimensions, providing deeper insights into how various user groups interact with your offers.
  • Personalize the Moments Experience:
    By passing specific information about users, you can tailor the content and presentation of Offers to better meet individual preferences and behaviors.
ο»Ώ

Further Recommendations

To maximize the effectiveness and efficiency of your MomentScience Moments JS SDK implementation, consider the following best practices and advanced techniques:

Use Macros to Personalize Your Moments

Macros can be used to dynamically insert user-specific data into your Offers, enhancing personalization and relevance. Common macros include user names, order references, and purchase amounts.

Using Macros
Using Macros
ο»Ώ

Utilize Callback Functions

The Moments JS SDK supports callback functions that can be triggered at various points in the Offer lifecycle. This allows for greater control over user interactions and can be used to integrate with your internal tracking systems.

Implement Postbacks

Postbacks provide real-time data on conversions related to your Offers. They are essential for tracking the effectiveness of your campaigns and optimizing them for better performance.

ο»Ώ

πŸ“’ If you're running into any issues while going through the integration process, feel free to contact us at help@momentscience.comο»Ώ