Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel3

CardioLog SaaS Client-Side API

The CardioLog SaaS Tracking Agent offers a client-side API to send custom events, such as button clicks, banner clicks, navigation links or interactions with other UI components that display content dynamically (without redirecting to the actual content page URL). 

...

You can call the sendEvent JavaScript function on any monitored page to send events to CardioLog SaaS via the client browser. 

Info
iconfalse
/**
* @method sendEvent
* @param {JSON object} data
* @param {Function} [optional] function to be executed after the event is sent
*/
CardioLogAgent.API.sendEvent(data, eventCallback);

The sendEvent function accepts the following parameters:

...

Code Sample

...

 

In order to send a click event on the DOWNLOAD button with the form fields values, add a call to the sendEvent function to the button onclick event as seen below:

 
Info
iconfalse

<input type="button" value="DOWNLOAD" onclick="openDownloadForm();

CardioLogAgent.API.sendEvent({e: 'Button Click', u: 'http://www.intlock.com/download/form.aspx', metaData: {name: 'DOWNLOAD NOW', firstName: 'John', lastName: 'Smith', email: 'john.smith@intlock.com', phone:1800800800, country: 'USA'}}, function () {console.log('event sent successfully');});" />

 

When clicking on the button, a custom event of type ''Button Click" will be sent, indicating that the download button has been clicked on by the user. An "event sent" message will appear in the browser console.

...

 

 

With the CardioLog SaaS API you can:

  • Track visitor actions within the browser such as button and banner clicks, form field data entries and more by implementing some simple JavaScript.
  • Send custom events to CardioLog from any application.
  • Track visitor actions from non-browser applications, including mobile apps.