Tracking Events in a Conversation

Events

You may wish to track certain events in conversations, such as:

  • External URL Clicks
  • Social Shares
  • Revenue
  • Anything else…

JSON Format

The JSON that you can send to track an event is:
  • name – string (required)
  • userId – string (required)
  • conversationId – string (optional)
  • type – enum (required)
    • customEvent
    • revenueEvent
    • shareEvent
    • pageLaunchEvent
For each event type, you can pass additional properties:
customEvent
  • extraInfo – object (optional)
revenueEvent
  • amount – number (required)
  • referenceNumber – string (optional)
  • metadata – object (optional)
pageLaunchEvent
  • extraInfo – object (optional)
shareEvent
  • sharedMessage – object (optional)
referralEvent
  • name – string (required)
  • ref – string the referral tag (optional)
  • source – string the referral source (eg. ADS, WEB) (optional)
  • ad_id – string an ID to identify the ad (optional)
  • referer_uri – string the URI that sent the referer(optional)

Tracking Custom Events

Post to the endpoint

https://tracker.dashbot.io/track?platform=twitter&v=10.1.1-rest&type=event&apiKey=API_KEY_HERE

The data to POST should pass the following data:

{
  "name": "trackMeEvent",
  "type": "customEvent",
  "userId": "967295313370594",
  "extraInfo": {
    "start": 1500504070512,
    "difference": 374,
    "end": 1500504070886
  }
}

Sample cURL

curl -X POST -H "Content-Type: application/json" \
     -d '{"name":"trackMeEvent","type":"customEvent","userId":"967295313370594","extraInfo":{"start":1500504070512,"difference":374,"end":1500504070886}}' \
     'https://tracker.dashbot.io/track?platform=twitter&v=10.1.1-rest&type=event&apiKey=API_KEY_HERE'

Tracking Revenue Events

Post to the endpoint

https://tracker.dashbot.io/track?platform=twitter&v=10.1.1-rest&type=event&apiKey=API_KEY_HERE

The data to POST should pass the following data:

{
  "name": "boughtSandwich",
  "type": "revenueEvent",
  "userId": "967295313370594",
  "amount": 17.45,
  "metadata": {
    "productName": "Ham Sandwich",
    "sku": "abc123123"
  }
}

Sample cURL

curl -X POST -H "Content-Type: application/json" \
     -d '{"name":"boughtSandwich","type":"revenueEvent","userId":"967295313370594","amount":17.45,"metadata":{"productName":"Ham Sandwich","sku":"abc123123"}}' \
     'https://tracker.dashbot.io/track?platform=twitter&v=10.1.1-rest&type=event&apiKey=API_KEY_HERE'

Tracking Page Launch Events

Post to the endpoint

https://tracker.dashbot.io/track?platform=twitter&v=10.1.1-rest&type=event&apiKey=API_KEY_HERE

The data to POST should pass the following data:

{
  "name": "Launched Detail Page",
  "type": "pageLaunchEvent",
  "userId": "967295313370594",
  "extraInfo": {
    "url": "https://www.dashbot.io/"
  }
}

Sample cURL

curl -X POST -H "Content-Type: application/json" \
     -d '{"name":"Launched Detail Page","type":"pageLaunchEvent","userId":"967295313370594","extraInfo":{"url":"https://www.dashbot.io/"}}' \
     'https://tracker.dashbot.io/track?platform=twitter&v=10.1.1-rest&type=event&apiKey=API_KEY_HERE'

Tracking Share Events

Post to the endpoint

https://tracker.dashbot.io/track?platform=facebook&v=10.1.1-rest&type=event&apiKey=API_KEY_HERE

The data to POST should pass the following data:

{
  "name": "sharedLink",
  "type": "shareEvent",
  "userId": "967295313370594",
  "sharedMessage": {
    "text": "come check out this bot"
  }
}

Sample cURL

curl -X POST -H "Content-Type: application/json" \
     -d '{"name":"sharedLink","type":"shareEvent","userId":"967295313370594","sharedMessage":{"text":"come check out this bot"}}' \
     'https://tracker.dashbot.io/track?platform=twitter&v=10.1.1-rest&type=event&apiKey=API_KEY_HERE'
Close Menu