Using Telemetry Keys
You can manage the keys configured for your title from theTelemetry Keys tab under the Data section in GameManager.
Once you’ve created a key, you can use it from your game client when calling WriteTelemetryEvents by including it via HTTP header X-TelemetryKey:
The caller should provide either a Telemetry Key, OR an Entity Token. If both are provided, the Telemetry Key will be ignored, and the request will be processed as though one weren’t provided.
Limitations
The following restrictions apply when using Telemetry Keys:- A title can configure up to five Telemetry Keys.
- Telemetry Keys can only be used to send telemetry events via the WriteTelemetryEvents API. They can’t be used to send PlayStream events via the WriteEvents API.
- Titles that have set their Insights Retention to be greater than 30 days can’t configure Telemetry Keys at this time.
Specifying Entities for Events
PlayFab events indicate the subject of the event via theirEntity property. When you send telemetry using Entity Token authentication, this field is automatically populated with information about the signed-in entity. However, when you use a Telemetry Key, there’s no entity that is signed-in. Telemetry events sent using a Telemetry Key are therefore not allowed to specify PlayFab Built-In Entities as their subject.
When using Telemetry Keys, you might still want to associate your telemetry events with some subject, for example, a custom player identifier used in your game. To do that, you can specify an external entity when forming the events in your client.
External entities are simply entities you specify with type set to external. They aren’t formally part of PlayFab’s entity system. They’re only used in this context to provide a convenient mechanism to associate telemetry events with subject identifiers that make sense in your system.
To specify an external entity as the subject when forming the event in your code, you should:
- Set the event’s
Entity.typefield toexternal(case sensitive). - Set the event’s
Entity.idfield to your custom subject identifier, up to a maximum of 64 characters in length.
The
OriginInfo.Key property of the event will contain the name of the key that was used to ingest the event. If you have configured multiple Telemetry Keys, you can use this property to see which key was used to ingest the event.