JS SDK (for Websites)
🎉 AdsPostX is now MomentScience! 🎉
We're thrilled to announce our rebranding as MomentScience, capturing value at key moments with renewed energy. Our commitment to enhancing user journeys and driving product adoption through intelligent offer decisioning and native creative experiences remains stronger than ever. Enjoy the journey with us!
Integrating MomentScience into your online store, website, mobile app, or other user experience is designed to be easy and quick. This guide will provide you with the needed steps to integrate our JavaScript SDK.
Before starting the integration process with the JS SDK, ensure you have the following:
The following playable demo will guide you through the steps required to integrate the MomentScience JavaScript SDK with a website.
- Access the Integration Code: Navigate to the Moments Integration section and click "JS SDK", Here you can configure, view, download, and preview the JavaScript SDK, Just copy the code provided to you.
- Integrate the Code Into Your Website: Paste the integration code provided by the MomentScience dashboard from the previous step before closing the </head>tag on your website.
Before proceeding, ensure that the value in accountIdin your integration code matches the one provided to you. This ensures proper association with your MomentScience account.
The initfunction supports the following attributes:
Name | Type | Description |
---|---|---|
accountId | String required | Your unique account ID, use your SDK ID. Learn how to retrieve your SDK ID. |
autoLoad | Boolean optional | Default: true. Determines whether the MomentScience SDK automatically fetches available Offers when it's ready.
Learn more about Delaying the Moments Unit |
autoShow | Boolean optional | Default: true. Determines whether the Offers overlay is automatically displayed when the MomentScience SDK is ready.
Learn more about Showing the Moments Unit. |
dev | Boolean optional | Default: false. Enables testing mode. Will return Offers for testing purposes but no activity will be recorded. In this mode, geo-targeting is ignored for publishers, ensuring that all Offers are returned in Offer responses for comprehensive testing |
settings | Object optional | It can be used to override some Dashboard settings and to configure the presentation of the Moments Unit. Learn more about Override Settings |
styles | Object optional | It can be used to apply custom styling at runtime. Learn more about Overide Styles |
Initialization (init) configuration options must be specified within the properties of the window.AdpxConfig object.
Want to embed the Web SDK into your website? Check out our guide here to learn how.
With MomentScience, you can easily pass payload values through the JavaScript SDK. Whether you're working on the server side or the client side, you have full control over the payload. Additionally, you can customize your payload by including your own key-value pairs.
Passing in payload values can enable the following:
- Offer Personalization: You can use passed payload values to personalize our Offer messaging to making their experience more personal.
- Enhanced Targeting: With payload values, you can target Offers more effectively, ensuring that the right content reaches the right audience.
- Customized Reporting: You can pass payload values to attribute your implementations to generate reports to segregate performance and give you deeper insights into your business performance.
- Supporting LoyaltyBoost Offers: Payload values facilitate rewarding users for engaging with partners through LoyaltyBoost Offers.
Payload values are specified within the properties of the window.AdpxUser object.
You can fill in these values either by using a server-side routine or by adding them client-side before initializing the SDK with thewindow.Adpx.init() call.
For detailed information about passing payload values using the JS SDK, refer to Passing Payload Values
To ensure that your integration code has correctly been implemented:
- Visit the page containing the integration code to confirm that Offers are displaying.
- If you are passing payload values, verify that the preferred parameters are provided in the window.AdpxUser object.
📢 If you're running into any issues while going through the integration process, feel free to contact us at help@momentscience.com