Gravito Ltd
Search…
Getting started
A brief intro to Gravito SDK.
Gravito SDK gives you all general powers to communicate with Gravito APIs. Include Gravito SDK to your project:
1
<script>
2
var gravitoSdkTag = document.createElement("script");
3
gravitoSdkTag.src = "https://cdn.gravito.net/sdk/gravitoSDK_latest.js";
4
document.body.appendChild(gravitoSdkTag);
5
</script>
Copied!
To test it out you can call Gravito API and fetch the profile about the current device (and user if logged in):
1
gravito.getProfile(function(data) { console.log(data); });
Copied!
To send data to profile:
1
gravito.sendEvent("<event name>","key1=value1&key2=value2");
Copied!
Above call will create a pixel call on which the second parameter is sent as query string parameters.
Last modified 7mo ago
Copy link