You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

CardioLog SaaS Client-Side API

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

The sendEvent JavaScript Function

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

/**
* @method sendEvent
* @param {String} eventName
* @param {String} URL
* @param {Function} [optional] function to be executed after the event is sent
*/
CardioLogAgent.API.sendEvent(eventName, URL, eventCallback);

The sendEvent function accepts the following parameters:

  • eventName - Required. The event type name (e.g, 'pageview').
  • URL - Required. The content page URL.
  • eventCallback - Optional. Function to be executed after the event is sent.
Code Sample

Send a click event on a DOWNLOAD button:

<input type="button" value="DOWNLOAD" onclick="openDownloadForm();CardioLogAgent.API.sendEvent('pageview', 'http://www.intlock.com/pages/download.aspx', function () { console.log('event sent'); } ); />

In this example, when a user clicks on the DOWNLOAD button a popup window is opened with the download form, and an event of type ''pageview" is sent, indicating that the download button has been clicked on by the user.


Download Button


Download Form

 

  • No labels