Skip to content

イベントのトラッキング

イベントは、ウェブサイトとのインタラクション、気象ステーションからのデータ、倉庫への製品返品など、あらゆるものをトラッキングするために使用できます。

カスタムイベント

  • event - イベントの名前。
  • properties - キーと値のペア。カスタムプロパティの値としては、stringnumberのみがサポートされています。
json
{
  "type": "track",
  "timestamp": "2022-12-19T18:24:16.238Z",
  "userId": "1be7675b-202b-4ff8-95c0-656da2c08d2d",
  "sessionId": "28eef5c8-1098-4f76-abe9-58a921cabfaf",
  "messageId": "a57016c7-9c33-4aa0-9534-c96384bbb51e",
  "pageId": "eca34e0f-4802-4fa4-8db1-11c727839dbd",
  "writeKey": "<WRITE_KEY>",
  "context": {
    "page": {
      "url": "https://www.weather-station.com/",
      "path": "/",
      "referrer": "",
      "title": "Weather Station - Get Weather"
    }
  },
  "event": "WeatherTracked",
  "properties": {
    "weather": "Rain",
    "temperature": 37
  }
}

セマンティックイベント + オブジェクト

セマンティックイベントセマンティックオブジェクトを使用することで、Fanplayr 360の追加機能を利用できます。この例では、"Product Viewed"イベントを、$productセマンティックオブジェクトとともに使用しています。

  • event - イベントの名前。
  • properties - キーと値のペア。ここでは、stringnumberだけでなく、より複雑な値を許可する$productを使用した例を示します。

INFO

セマンティックイベントとオブジェクトに加えて、カスタムプロパティを追加できます。ここでは、$productとともにweatherをトラッキングしています。

json
{
  "type": "track",
  "timestamp": "2022-12-19T18:29:18.906Z",
  "userId": "1be7675b-202b-4ff8-95c0-656da2c08d2d",
  "sessionId": "28eef5c8-1098-4f76-abe9-58a921cabfaf",
  "messageId": "42167d8e-5fa6-4188-9ec4-5179dab84d84",
  "pageId": "180cf0b4-da99-4f5e-9698-29af50c683cf",
  "writeKey": "<WRITE_KEY>",
  "context": {
    "page": {
      "url": "https://www.weather-station.com/store/vase_1/",
      "path": "/",
      "referrer": "",
      "title": "Weather Station - Store"
    },
    "libraryVersion": "1.7.1"
  },
  "event": "ProductViewed",
  "properties": {
    "$product": {
      "id": "XB35A",
      "name": "Beautiful Vase",
      "price": 12.99,
      "currency": "EUR"
    },
    "weather": "Rain"
  }
}