Javascript Shuttle Usage - skpdi/sentinel-document GitHub Wiki

This is how to use the Shuttle library for Javascript created on the Sentinel Log Definitions page.

How to use

Shuttle file can be used after loading with <\script> like the below.

// Create shuttle instance
var shuttle = new SampleSentinelShuttle();

// Setting the field (column) value
// You can use setter method that the name is same as the column you need to record. 
// For example, if you need to record 'page_id' value, use 'setPage_id' method. 
shuttle.setPage_id("new page")
       .setAction_id("hello action");


// However, it is recommended to use setBodyOf method rather than the method above
// If you use like the above, calling a method could be omitted by accident.
// Since setBodyOf method must transfer all the necessary columns to parameter, the columns would not be omitted by accident. 
// If you use setBodyOf method, page_id, action_id would be recorded automatically.
shuttle.setBodyOf_event_purchase__event_purchase("event_name","purchase_id", purchase_amount);
 

// Since setBodyOf method records Body value, you need to chaining like the below in order to record additional Header value
shuttle.setSession_id("AFD0104")
       .setBodyOf_event_purchase__event_purchase("event_name","purchase_id", purchase_amount);

Use the code below to transfer Shuttle that values are entered to Rake Javascript (Refer to Rake-Web API )

rake.track(shuttle.getImmutableJSONObject());
⚠️ **GitHub.com Fallback** ⚠️