Versions Compared

Key

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

...

  • 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 In this example, when a user clicks on the DOWNLOAD button on the home page, a popup window is opened with the download form:

Image Added
Download Button

Image Added
Download Form

In order to send a click event on the DOWNLOAD button, 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('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 When clicking on the button, an event of type ''pageview" is will be sent, indicating that the download button has been clicked on by the user.
Image Removed
Download Button
Image Removed
Download FormAn "event sent" message will appear in the browser console.

In order to confirm that the event was sent successfully, open the browser Network tab and confirm that the request to the CardioLog Analytics SaaS events service returned the 200 status code as seen below:

Image Added