Versions Compared

Key

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

...

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 {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:

Info
iconfalse

<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

...