sendUserEvents

Version 2024-04-01

Overview

Send user events to analytics by providing SendEventInput.

Response

Return type SendUserEventOutput

Arguments

ArgumentDescription
input (SendUserEventInput required)

Examples


Complete Send User Events Mutation

Request

mutation sendEvents {
    sendUserEvents(input : {
        events:[
            {
                eventType: "page-load",
                eventId: "11c7e59a-d462-4254-bc7e-3e44528ef6d0",
                eventTime: "2023-12-03T10:15:30Z"
                clientType: WEBSITE_CLIENT,
                clientVersion: "1.0",
                additionalProperties: {
                    additionalProperties: [
                        {
                            property: "current_url",
                            value: "https://example.com"
                        }
                    ]
                }
            }
        ]
    }
    ) {
        status
    }
}

Response

{
  "data": {
    "sendUserEvents": {
      "status": "successful"
    }
  }
}

Send User Events Validation Exception

Request

mutation sendEvents {
    sendUserEvents(input : {
        events:[
            {
                eventType: "page-load",
                eventId: "11c7e59a-d462-4254-bc7e-3e44528ef6d0",
                eventTime: "2023",
                clientType: WEBSITE_CLIENT,
                clientVersion: "1.0",
            }
        ]
    }
    ) {
        status
    }
}

Response

{
  "errors": [
    {
      "message": "Input request is not valid, the following issues were encountered: [eventTime 2023 is invalid local ISO 8601 UTC time format.]",
      "locations": [
        {
          "line": 2,
          "column": 68
        }
      ],
      "path": [
        "sendUserEvents"
      ],
      "extensions": {
        "classification": {
          "type": "ValidationError",
          "code": "UnspecifiedError",
          "details": {},
          "errorType": "ValidationException",
          "errorCode": 400
        }
      }
    }
  ],
  "data": {
    "sendUserEvents": null
  }
}