Class EventRequest
An event representing something happening in your game. This schema describes the default top-level fields but most events will be accepted.
Inherited Members
Namespace: Unity.Services.Apis.Analytics
Assembly: Unity.Services.Apis.dll
Syntax
[DataContract(Name = "EventRequest")]
[Preserve]
public class EventRequest
Constructors
EventRequest(string, string, string, string, string, string, string, int, object)
Initializes a new instance of the Event
Declaration
[Preserve]
public EventRequest(string eventName = null, string userID = null, string unityInstallationID = null, string unityPlayerID = null, string sessionID = null, string eventUUID = null, string eventTimestamp = null, int eventVersion = 0, object eventParams = null)
Parameters
Type | Name | Description |
---|---|---|
string | eventName | The name of the event.. |
string | userID | A unique string that identifies the player and is consistent across their subsequent play sessions. (required). |
string | unityInstallationID | The installation ID is provided by the Unity package and used internally by Unity services. It can be safely omitted. The primary use case is identifying where multiple distinct users share a device. . |
string | unityPlayerID | The authenticated playerID, provided by the Unity authentication service. This can be useful to link analytics data to player accounts if you're using other Unity services (such as Cloud Save). If you're not using the Unity authentication service, this field should be omitted. . |
string | sessionID | A unique string value that’s persisted for the duration of each player gameplay session and regenerated with each new gameplay session. The sessionID should be sent with every event the player triggers in their session. There might be occasions when you want to send events containing valuable player information outside a player session and don’t have access to a sessionID. These are called GHOST events and you should omit the sessionID parameter and value on these events to ensure that they're not included in any player session calculations. . |
string | eventUUID | Adding eventUUID to an event will prevent the event being inserted twice within a 24 hour period. This may happen when e.g. a network time-out occurs, even if the event has already been processed by Unity Analytics. Should be unique per event. (required). |
string | eventTimestamp | If eventTimestamp is missing, the server will infer the timestamp based on the time the event was received. The date format should be as follows: |
int | eventVersion | The version of the standard event only. . |
object | eventParams | A JSON object containing information about the event that conforms to the event schema (Event Parameters).. |
Properties
EventName
The name of the event.
Declaration
[DataMember(Name = "eventName", EmitDefaultValue = false)]
[Preserve]
public string EventName { get; set; }
Property Value
Type | Description |
---|---|
string | The name of the event. |
EventParams
A JSON object containing information about the event that conforms to the event schema (Event Parameters).
Declaration
[DataMember(Name = "eventParams", EmitDefaultValue = false)]
[Preserve]
public object EventParams { get; set; }
Property Value
Type | Description |
---|---|
object | A JSON object containing information about the event that conforms to the event schema (Event Parameters). |
EventTimestamp
If eventTimestamp is missing, the server will infer the timestamp based on the time the event was received. The date format should be as follows: yyyy-MM-dd HH:mm:ss.SSS ±[hh]:[mm]
where ±[hh]:[mm]
can be included to indicate offset from UTC.
Declaration
[DataMember(Name = "eventTimestamp", EmitDefaultValue = false)]
[Preserve]
public string EventTimestamp { get; set; }
Property Value
Type | Description |
---|---|
string | If eventTimestamp is missing, the server will infer the timestamp based on the time the event was received. The date format should be as follows: |
EventUUID
Adding eventUUID to an event will prevent the event being inserted twice within a 24 hour period. This may happen when e.g. a network time-out occurs, even if the event has already been processed by Unity Analytics. Should be unique per event.
Declaration
[DataMember(Name = "eventUUID", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public string EventUUID { get; set; }
Property Value
Type | Description |
---|---|
string | Adding eventUUID to an event will prevent the event being inserted twice within a 24 hour period. This may happen when e.g. a network time-out occurs, even if the event has already been processed by Unity Analytics. Should be unique per event. |
EventVersion
The version of the standard event only.
Declaration
[DataMember(Name = "eventVersion", EmitDefaultValue = false)]
[Preserve]
public int EventVersion { get; set; }
Property Value
Type | Description |
---|---|
int | The version of the standard event only. |
SessionID
A unique string value that’s persisted for the duration of each player gameplay session and regenerated with each new gameplay session. The sessionID should be sent with every event the player triggers in their session. There might be occasions when you want to send events containing valuable player information outside a player session and don’t have access to a sessionID. These are called GHOST events and you should omit the sessionID parameter and value on these events to ensure that they're not included in any player session calculations.
Declaration
[DataMember(Name = "sessionID", EmitDefaultValue = false)]
[Preserve]
public string SessionID { get; set; }
Property Value
Type | Description |
---|---|
string | A unique string value that’s persisted for the duration of each player gameplay session and regenerated with each new gameplay session. The sessionID should be sent with every event the player triggers in their session. There might be occasions when you want to send events containing valuable player information outside a player session and don’t have access to a sessionID. These are called GHOST events and you should omit the sessionID parameter and value on these events to ensure that they're not included in any player session calculations. |
UnityInstallationID
The installation ID is provided by the Unity package and used internally by Unity services. It can be safely omitted. The primary use case is identifying where multiple distinct users share a device.
Declaration
[DataMember(Name = "unityInstallationID", EmitDefaultValue = false)]
[Preserve]
public string UnityInstallationID { get; set; }
Property Value
Type | Description |
---|---|
string | The installation ID is provided by the Unity package and used internally by Unity services. It can be safely omitted. The primary use case is identifying where multiple distinct users share a device. |
UnityPlayerID
The authenticated playerID, provided by the Unity authentication service. This can be useful to link analytics data to player accounts if you're using other Unity services (such as Cloud Save). If you're not using the Unity authentication service, this field should be omitted.
Declaration
[DataMember(Name = "unityPlayerID", EmitDefaultValue = false)]
[Preserve]
public string UnityPlayerID { get; set; }
Property Value
Type | Description |
---|---|
string | The authenticated playerID, provided by the Unity authentication service. This can be useful to link analytics data to player accounts if you're using other Unity services (such as Cloud Save). If you're not using the Unity authentication service, this field should be omitted. |
UserID
A unique string that identifies the player and is consistent across their subsequent play sessions.
Declaration
[DataMember(Name = "userID", IsRequired = true, EmitDefaultValue = true)]
[Preserve]
public string UserID { get; set; }
Property Value
Type | Description |
---|---|
string | A unique string that identifies the player and is consistent across their subsequent play sessions. |