About the Reignite JS API

This API is designed for tracking web and app based events and identity resolution of visitors. For example an ecommerce site may wish to track who visits the site (and the traffic source that referred them), product page views, searches, items added to basket and any items ordered.


These events are then available to use within Reignite to create enriched customer profiles & analysis, and for creating personalised content through recipes and AI product recommendations.

Before you begin


API Key

Request your API key from your account manager.


Create Events

Each event you wish to track must be created in Reignite before you can start capturing data for it. The ID of the event type will then need to used in the track event tag.


Define 'customer_id' & Identity Resolution

Your Reignite account requires a single identifier to be used to identify a customer. Typically this is a CRM ID or email address. Your account manager will discuss with you the most appropriate choice of ID here.


Events do not need to have this 'customer_id' included, and the API will include the 'visitor_id' within the event properties. This allows the Reignite identity resolution functionality to append the 'customer_id' at a later stage once the 'visitor_id' has been matched.


This can be achieved by using the 'identity' API call to match the 'visitor_id' with any other identities at key moments such as when the visitor logs into the website, when they fill in a form with their email address or even when they click thru from an email marketing campaign that appends an identifier to the query string.


This identity does not need to be the 'customer_id' of the account but could be another type of identifier linked to the 'customer_id'. For example, the JS API tracks product page views with 'visitor_id'. They then complete an email signup form that calls the track identity to match 'visitor_id' with 'email'. Separately the company has imported to Reignite a list of 'customer_id' and their associated email addresses, allowing Reignite to find the 'customer_id'  of each 'visitor_id' through the 'email' identity.


Visit Tag:

This tag is required on every page and run before any subsequant track of event or identity.

This records any new visits and the traffic source as events in Reignite, but also loads the code required for additional API calls.


<script>
        var _reignite = _reignite || [];
        
        // Record Visit
        _reignite.push(['account', "[ENTER API KEY HERE]"]);
        _reignite.push(['visit']);

        // Create Reignite Tag
        (function () {
            var b = document.createElement('script'); b.type = 'text/javascript'; b.async = true;
            b.src = '//js.reignitehq.com/reignite.js';
            var a = document.getElementsByTagName('script')[0]; a.parentNode.insertBefore(b, a);
        })();

</script>


This is what gets tracked as part of the visit event:


event_idA unique string generated by Reignite
event_timestampThe datetime of the visit
uaThe user agent of the visitor to allow identifcation of browser/device
urlThe landing page URL
ipThe visitors IP address
visitor_idThe unique ID Reignite gives each visitor, determined by a 1st party cookie
channelDetermined by utm_medium or the referrer
referrerThe referring URL such as the search engine, or 'Direct' for direct visits.
campaignPopulated with utm_campaign if this exists in the query string
creativePopulated with utm_creative if this exists in the query string
keywordPopulated with the utm_term query string if this exists, or if the referrer exposes the seacrh term


Track Event

Use this to track key events such as product page views, searches, orders and add to basket. Reignite automatically generated a unique ID for each of these events.


event_type:

Each event type needs creating in Reignite before an API call can be made. Once created in Reignite use the ID value Reignite has assigned to the event to specify the event type.


customer_id:

This is an optional value. Only use the same type of identifier as used for the single customer ID in Reignite.


event_properties:

This is a JSON object that contains information relating to the event such as details of the page viewed or the product added to the basket.


This JSON does not support nested data, therefore for events such as an online order where multiple items have been purchased, send each of the items ordered as separate events. You may also want a single event to record the entire order and revenue associated with the order.


Additional data:

Reignite also automatically records the timestamp of the event, and adds the visitor ID to the event properties allowing you to view the traffic source and landing page that relates to this event.


Example Tag

Below is an example tag for an event to capture website visitors browsing a product page. 

<script>
  _reignite.push([

  // Reignite API Command
  'track', 

  // Enter the event type ID for this type of event  
  '[event type ID]', 

  // Enter the customer_id, or leave empty if not known
  '[Optional customer_id]', 

  // Event Properties Object  
  {"productid": "[ProductCode]", "productname": "[productname]"}
]);
</script>


Identity:

This API call allows you to match anomynous website visitors to a known customer identifier such as customer ID or email address.


2 values are required:

1) The identity type such as 'email' or to use the same as the unique ID for customer records in Reignite 'customer_id'. Speak to your account manager to understand the correct value to use here.

2) The actual value of the identifier

<script>
  _reignite.push(['identity', '[identity type]', '[identity value]']);
</script>