Versions Compared

Key

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

...

4. Create a custom report to display the number of items sold using the CardioLog SDK.

 

Anchor
#rest api
#rest api
The REST API

In order to track visitor actions for non-browser apps, developers must send usage event objects to the CardioLogAgent web application through HTTP POST requests in JSON format. The JSON string must be embedded in the request body. The POST response is provided in JSON format as well.

  • The request must include a "Content-Type: application/json" header
  • The request may optionally include an "Accept: application/json" header

The Event Object

CardioLog Analytics usage event objects have the following properties:

  • u - URL of the page the event is related to. For example, the URL of a "View" event will be the current page; the URL of a search result will be the clicked link.
  • X - Holds the following event dependent information:
    • Search event - The search term
    • View event:
      • If __Referrer parameter was passed to this page, __Referrervalue 
      • If there is a Referrer cookie, sends the ReferrerReason cookie value 
      • If this is the first page the user views in this session, sends "First In Session" and appends the data from __Referreragent
    • Duration event - Time on page in seconds
  • Y - Holds the following information:
    • In Search event - Number of total results
    • In Visit event - If there is a Referrer cookie, sends its content
    • In Duration event - Last visit event ID
  • Z - In Search event - First result on page (number of results)
  • RI - Last event ID
  • et - Event type code (eg., Goal event is 20, Leave event is 1, etc.)
  • events - The event can have sub events sent with it. Typically, this is used when a search event is sent or with saved events.

In addition to event objects, the request body may include the following properties:

  • browserType - The user-agent information
  • sessionid - Any string format accepted.
  • un - User ID. Any string format accepted.

The JSON Request Format

The full JSON request format is as follows:

{
    "events": {
      "event": [
        {
          "u": "http://www.intlock.com/",
          "X": "|referral|blog.intlock.com|/about/||",
          "et": 0,
          "RI": 564940
        },
        {
          "X": "1",
          "Y": "7",
          "et": 23,
          "RI": 0
        }
      ]
    },
    "browserType": "Apple-iPhone5C2/1001.525",
    "sessionid": "861529144.325047542",
    "un": "INTLOCK\\tomj"
}

The API URL

The default API URL for a SharePoint site is:

https://[SharePoint WFE]/_layouts/CardioLogAgent/tunnel.aspx?random=895.3324414324015

  • Replace [SharePoint WFE] with your SharePoint URL address
  • The random param is used as a cache buster