Pass data to Fresh Relevance with JavaScript.
The Fresh Relevance JavaScript API is included in the Fresh Relevance Tracking script and can be used to pass data and events from single page applications, without the need to rely on scraping or a data layer. This will allow you to pass data from an app built with a framework such as React, Angular or vue.js (or plain JavaScript).
The API allows your app (for example, one built using React) to inform Fresh Relevance of important changes. Your app should for example:
- When site visitors log in, you can also pass information about them to Fresh Relevance for use in triggered messages or in personalization.
- You can raise custom signals from your app to start custom trigger programs. This allows the system to respond to specified actions of your customer on your site, for example, ordered a brochure or viewed a particular page.
- You can pass data through to the signal, which is available all the way through to email send time, meaning it can be merged into an email.
Tracking activity
In addition to allow you to enrich data and trigger actions it is important to raise events so that Fresh Relevance can track user activity in your app. Please review all the events and raise those which are appropriate to your app and user activities.
Other functionality
There are also calls that allow you to:
- Notify Fresh Relevance when a page has changed (e.g. moved from a product list page to s product details page)
- Pass through the data of the item(s) on the current page
- Register for notifications when certain events occur within the Fresh Relevance script. You have the option of cancelling the event (e.g. if you want to block a slot from loading).