Integrating custom platforms with Remarkety

Remarkety needs access to your store's data in order to analyze and run the campaigns.

If you are using a popular e-commerce platform, we probably already have a plugin ready for you to use - just search for Remarkety in your platform's app store. If you have a bespoke platform, you may need to implement the following.

How to integrate with Remarkety

1. Contact us first - we may be able to help! 

2. Implement the server-side poll API

3. Implement the client-side JavaScript code (optional - required for Browse Abandonment campaigns)

4. Contact our technical team and we'll verify the integration with you and connect your store

Server-side Poll API

To get your store's data, Remarkety routinely performs an "ETL" process which reads the latest data from your store (products, shoppers, orders and abandoned cart), analyzes it and uses it to update shopper data and run campaigns.

In order for Remarkety to be able to fetch your store's data, your store must implement the REST API detailed here: Remarkety Poll API V2. Please note the following important points:

1. Most queries (products, orders, shoppers, carts) will pass a "updated_at_min" parameter. This is an ISO-8601 encoded date-time string, and we will use the GMT timezone. What this parameter means, is that Remarkety is requesting data that has been updated since this date.

2. The data returned to Remarkety must be sorted by the updated at time, in ascending order (older items first). 

3. All dates in all fields must either be returned as an ISO-8601 string (with timezone), or alternatively already be in the GMT timezone (UTC).

4. Authentication: The REST API must accept and check an API key. The API key will be sent on every request in the remarkety_api_key query parameter.

5. If you are a vendor and thus will serve distinct data for different stores, please be sure to encode the store ID as part of the endpoint URL, for example: https://api.your-platform.com/remarkety-api/<store_id>/products.

Client-side JavaScript Code

All pages in the website should include this piece of code, just before the </body> tag. Make sure to include the correct STORE_ID (this is the store ID as shown in Remarkety - if you are a vendor, you need a place for your users to be able to enter a distinct value to be set here). Also, the {% if customer %} .. {% endif %} is pseudo-code that identifies the logged-in customer (shopper) and sends us their email - you probably need to adapt this to your own platform here.

<script>
var _rmData = _rmData || [];
_rmData.push(['setStoreKey', '<<STORE_ID>>']);
{% if customer %}
_rmData.push(['setCustomer', '<<CUSTOMER_EMAIL>>']);
{% endif %}
</script>
<script>(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = 'https://s3.amazonaws.com/downloads.remarkety.com/webtracking/remarkety.js';
s.parentNode.insertBefore(g, s);
}(document, 'script'));
</script>

 In addition, product pages should also include this piece of JavaScript, right after the previous code:

var _rmData = _rmData || [];
       _rmData.push(['productView', {
         productId: PRODUCT_ID,
         productName: PRODUCT_NAME,
         productCategoriesIds: PRODUCT_CATEGORIES_ID_ARRAY,          productCategories: PRODUCT_CATEGORIES_ARRAY
       }]);

Where:

PRODUCT_ID - The id of the product shown. The id should correspond to the id's you send in the /products endpoint

PRODUCT_NAME - The name of the product.

PRODUCT_CATEGORIES_ID_ARRAY - A JSON array of the category ids this product belongs to

PRODUCT_CATEGORIES_ARRAY - A JSON array of the category names this product belongs to.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.