Migrating from a Rejoiner 1 implementation should be straightforward for the Javascript API. The Rejoiner 2 is mostly a superset of features from Rejoiner 1 and the api calls are backwards compatible.
For most simple integrations, all that will need to be changed is to update the base snippet which loads the Javascript Library. While this snippet remains mostly the same, there are two lines that need to be changed.
setAccount
call.<script type="text/javascript">
var _rejoiner = _rejoiner || [];
_rejoiner.push(['setAccount', '{{ YOUR SITE ID }}']); // <-- REPLACE WITH RJ2 SITE ID
_rejoiner.push(['setDomain', '{{ YOUR SITE DOMAIN }}']);
(function() {
var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true;
s.src = '//cdn.rejoiner.com/js/v4/rj2.lib.js'; // <-- REPLACE WITH NEW RJ2 URL
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})();
</script>
While the API remains mostly the same, there are some differences in the application regarding how Rejoiner 2 handles the data received from the Javascript Library.
Additional customer parameters passed to
setCartItem
are stored in a metadata
field, rather than at the same level as the standardized fields.
There are some additional new features that may be useful that are highlighted below:
In addition to setCartItem
,
setCartData
accepts custom parameters which are stored in a metadata
field.
Additionally, there is a
setSessionMetadata
call which provides a way to store custom data which does not necessarily apply to carts or cart items.
There is a new
setSessionDate
call which provides a way to store some dates related to a customer's session (transaction) that don't necessarily occur
where Rejoiner is able to track them, or may occur in the future.
Rejoiner currently does not make any assumptions about
these dates, leaving it up to you to decide how to use them (e.g. delivery_date
doesn't necessarily have to be when
an item is delivered, it could be a travel date, booking date, etc.)
Currently, the following dates are supported:
payment_date
fulfillment_date
delivery_date