Questions? Feedback? powered by Olark live chat software

Device Recon

Device Recon is a JavaScript that collects the data from front-end applications and then sends the data to Simility’s software. Using Device Recon, you can collect data such as user actions, user details, browser details, device details, and so on from your application.

Simility provides two types of JavaScript programs: Standard Page Load and Event Trigger. Our Simility engineering team helps you choose the one that best suits your needs. You must copy and paste the corresponding JavaScript program within the body section of individual web pages from which you want to capture the data.

Standard Page Load JavaScript

When a web page including the Standard Page Load JavaScript loads, the JavaScript gets downloaded and triggered, and start capturing all actions performed on the web page along with the user details and sends the captured data to the Simility software.

Script Syntax
<script>
	var similityContext = {
		"customer_id": "<uuid>", 
		"session_id": "<session id>",
		"user_id": "<user_id>",
		"zone": "<zone>",
		"event_types": "<type>"
	};
</script>
<script type="application/javascript" src="https://cdn.simility.com/b.js"></script>
Parameters
Name Type Description
customer_id String Specify the UUID provided by Simility.
session_id String Specify a unique session ID assigned to the user session when a user accessed your application.
user_id String Optional. Specify the currently logged in user ID or email ID in case of anonymous transaction/activities. This can be internal identification you use in your organization.
Zone String Specify the zone where your data centers are hosted.
event_types String Specify the event or action that you want to associate with the JavaScript. You can specify multiple values separated with a comma.
Example
<script>
	var similityContext = {
		"customer_id": "5e295f6c-5fd2-11e7-907b-a6006ad3dba0", 
		"session_id": "lit3py55t21z5v55vlm25s55",
		"user_id": "1200583092",
		"event_types": "user_registration",
		"zone": "us"
	};
</script>
<script type="application/javascript" src="https://cdn.simility.com/b.js"></script>

Event Trigger JavaScript

Use the Event Trigger JavaScript to trigger the JavaScript execution when an event is performed on the web page, such as when a dialog box opens or on a button click.

You can use the Event trigger JavaScript synchronously and asynchronously.

  • Synchronous: the JavaScript gets downloaded when the web page loads, but gets executed only when the specified event is triggered on the web page.
  • Asynchronous: the JavaScript gets downloaded and executed only when the specified event is triggered.
Do not use the Event Trigger JavaScript for events that redirect to another page (for example, a login event) and might not allow the JavaScript to finish execution.
Synchronous Script Syntax
<script>
	$('#<dialog/action>').click(function() {
		if (window.SimilityScript) {
			var similityScriptContext = {
				"customer_id": "<UUID>", 
				"session_id": "<session ID>",
				"user_id": "<user_id>",
				"zone": "<zone>",
				"event_types": "<type>"
			};
			var ss = new SimilityScript(similityScriptContext);
			ss.execute();
		}
	});
</script>
<script type="application/javascript" src="https://cdn.simility.com/b.js"></script>
Asynchronous Script Syntax
<script>
	$('#<dialog/action>').click(function() {
		$.getScript('https://cdn.simility.com/b.js', function()
		{  
			var similityScriptContext = {
				"customer_id": "<UUID>", 
				"session_id": "<session ID>",
				"user_id": "<user_id>",
				"zone": "<zone>",
				"event_types": "<type>"
			};
			var ss = new SimilityScript(similityScriptContext);
			ss.execute();
		}); 
	});
</script>

In the above syntaxes, replace the <dialog/action> with the name of the dialog box or action – so that the JavaScript gets executed when the specified dialog box (user registration) opens or when the specified action (a button click) is performed.

Parameters
Name Type Description
customer_id String Specify the UUID provided by Simility.
session_id String Specify a unique session ID assigned to the user session when a user accessed your application.
user_id String Optional. Specify the currently logged in user ID or email ID in case of anonymous transaction/activity. This can be internal identification you use in your organization.
Zone String Specify the zone where your data centers are hosted.
event_types String Specify the event or action that you want to associate with the JavaScript. You can specify multiple values separated with a comma.
Synchronous Example
//Button widget with the ID, checkout-button
<button id="checkout-button">Checkout</button>

//JavaScript to execute when the button (checkout-button) is clicked
<script>
	$('#checkout-button').click(function() {
		if (window.SimilityScript) {
			var similityScriptContext = {
				"customer_id": "5e295f6c-5fd2-11e7-907b-a6006ad3dba0", 
				"session_id": "lit3py55t21z5v55vlm25s55",
				"user_id": "1200583092",
				"zone": "us",
				"event_types": "checkout_page"
			};
			var ss = new SimilityScript(similityScriptContext);
			ss.execute();
		}
	});
</script>
<script type="application/javascript" src="https://cdn.simility.com/b.js"></script>
Asynchronous Example
//Button widget with the ID, checkout-button
<button id="checkout-button">Checkout</button>

//JavaScript to download and execute when the button (checkout-button) is clicked
<script>
	$('#checkout-button').click(function() {
		$.getScript('https://cdn.simility.com/b.js', function(){  
			var similityScriptContext = {
				"customer_id": "5e295f6c-5fd2-11e7-907b-a6006ad3dba0", 
				"session_id": "lit3py55t21z5v55vlm25s55",
				"user_id": "1200583092",
				"zone": "us",
				"event_types": "checkout_page"
			};
			var ss = new SimilityScript(similityScriptContext);
			ss.execute();
		}); 
	});
</script>