Skip to main content

Javascript

Javascript is a high-level, versatile programming language that is primarily used for web development. It enables interactive features on websites, allowing developers to create dynamic content such as animations, forms, and real-time updates without needing to reload the page.

Configuration

Integrate Javascript data into Boltic by using your Website URL

To connect with a Website:

  1. Enter a Source Name by which you want to refer to this Javascript integration.
  2. Give the URL of website you want to connect.
  3. Test and Save your source.
  4. You will get an API Key and Javascript Snippet.
  5. Copy the Javascript snippet and paste it high in the head of your website.
<script>
!function(){var e=window.stelios=window.stelios||[];if(!e.initialize){if(e.invoked)window.console&&console.error&&console.error("Stelios snippet included twice.");else{e.invoked=!0,e.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware",],e.factory=function(t){return function(){var i=Array.prototype.slice.call(arguments);return i.unshift(t),e.push(i),e}};for(var t=0;t<e.methods.length;t++){var i=e.methods[t];e[i]=e.factory(i)}e.load=function(i,o){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.onload=o,a.src="https://cdn.pixelbin.io/v2/fyndcloud/fyndpd/original/m1/stelios/v1.54.8/prod/stelios.min.index.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(a,r),e._loadOptions=t},e._writeKey="your_access_token",e._cdn="https://apiv2-streams.boltic.io",e.SNIPPET_VERSION="4.15.3",e.load("your_access_token",function(){window.stelios=window.stelios.AnalyticsBrowser.load({writeKey:e._writeKey}),window.stelios.page()})}}}();
</script>

Tracking Events

The SDK allows you to track events throughout your application. Ensure that you do not call these tracking methods on the main or UI thread to avoid UI blocking.

await window['stelios'].track("random-event-name", // event name in string
{
"key1": "val1",
"k2" : 0,
"k3": ["p1", "p2", "p3"],
"k4": {"p1": "p2"}
} // some event details along with event you want to track
);

await window['stelios'].identify('<user-id>', {
name: '<user name>',
email: '[email protected]'
});

You have now successfully integrated your Javascript Website to Boltic!