Follow

Accessing Device ID Through MokiTouch

Moki has released a new feature in MokiTouch Android to enhance your own analytics and tracking per device. Moki has introduced a JavaScript object that is available to your web applications when displayed in MokiTouch. The object contains the device ID and allows you to inject it as you see fit. The code is very simple and there is an example page where you can see it in action (https://storage.googleapis.com/qatest/getMokiDeviceId.html). In order for this to work you must view this in MokiTouch for it to work. Here is the example HTML behind the code:

<!DOCTYPE html>
<html>
<head>
<script>
function clicked() {
try {
document.getElementById("output").innerHTML = getMokiDeviceId();
} catch (err) {
document.getElementById("output").innerHTML = "getMokiDeviceId(): not found";
}
}
</script>
</head>
<body>

<h1>Test getMokiDeviceId() javascript function</h1>

<p id="output">Click the button to get the device id</p>

<button type="button" onclick="clicked()">Device Id</button>

</body>
</html>

The script in red above shows a simple example of how to access the device id. What is returned is Moki's assigned ID for that device seen below:

The device ID can be coupled with the Moki Android API (https://moki-api.3scale.net/) to get more information about the device if needed. We hope this helps you take your tracking to the next level!

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.