Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Il servizio di eventi di Google Play Giochi ti consente di raccogliere i dati cumulativi generati dai tuoi giocatori durante il gameplay e di archiviarli nei server di Google per l'analisi dei giochi. Puoi definire in modo flessibile i dati dei giocatori che il tuo gioco deve raccogliere. Potrebbero essere incluse metriche come la frequenza con cui:
I giocatori usano un determinato articolo
I giocatori raggiungono un determinato livello
I giocatori eseguono un'azione di gioco specifica
Puoi utilizzare i dati sugli eventi come feedback su come migliorare il tuo gioco. Ad esempio, puoi modificare il livello di difficoltà di alcuni livelli del tuo gioco che i giocatori trovano troppo difficili da completare.
Per scoprire come implementare gli eventi per la tua piattaforma, consulta
Implementazioni client.
Integrare gli eventi nel gioco
Il seguente flusso di lavoro descrive come applicare gli eventi nel
tuo
gioco:
Definire gli eventi. Per definire nuovi eventi da acquisire nel tuo gioco:
Implementa l'acquisizione di eventi nel tuo gioco utilizzando le API Events. Ad esempio, nel codice Android, chiama il metodo events increment ogni volta che il gioco rileva che è stato attivato un evento che lo interessa.
Visualizza i dati sugli eventi. Vai alla pagina Eventi del tuo gioco in Google Play Console per visualizzare le statistiche relative agli eventi acquisiti.
Nozioni di base sugli eventi
Le API di eventi ti consentono di definire e raccogliere metriche di gameplay interessanti e di caricarle nell'SDK Play Games.
Un evento dell'SDK Play Games contiene le seguenti proprietà chiave:
Proprietà
Descrizione
ID
Una stringa univoca generata da Google Play Console per questo evento.
Utilizza questo ID univoco per fare riferimento all'evento nei client di gioco.
Nome
Un nome breve per l'evento. Il nome può contenere fino a 100 caratteri.
Questo valore viene utilizzato da Google Play Console e può essere visualizzato nel
tuo gioco.
Esempi:
"Zombie uccisi"
"Rubine raccolte"
Descrizione
Una descrizione più lunga dell'evento (ad esempio, "Numero di volte in cui un giocatore ha ucciso uno zombie" o "Numero totale di gemme rosse eliminate e accoppiate dal giocatore"). La descrizione può contenere fino a 500 caratteri.
Questo valore viene utilizzato da Google Play Console e può essere visualizzato nel gioco.
Tipo di evento
Un campo che dichiara il tipo di dati monitorati dall'evento.
Questo valore viene utilizzato da Google Play Console per supportare i report di Player Analytics.
Sono supportati due tipi di eventi:
Origine valuta premium
Seleziona questo tipo per gli eventi che monitorano le origini di una valuta premium. Ad esempio:
"Monete d'oro guadagnate"
"Smeraldi acquistati"
Sink di valuta premium
Seleziona questo tipo per gli eventi che monitorano gli importi o il consumo di una valuta premium. Ad esempio:
"Monete d'oro spese"
"Smeraldi utilizzati"
Icona
Un'icona quadrata che verrà associata al tuo evento.
Creare un evento
Per creare un nuovo evento per il tuo gioco:
In Google Play Console,
fai clic sull'icona Servizi per i giochi a sinistra e
seleziona la voce relativa al tuo gioco.
Seleziona la scheda Eventi a sinistra e fai clic sul pulsante Aggiungi evento.
Inserisci i dettagli dell'evento che vuoi creare.
Fai clic su Salva. Se non sono presenti errori, l'evento viene inserito nello stato "Pronto per la pubblicazione". Ora puoi procedere con la pubblicazione delle modifiche al gioco.
Modifica un evento
Per modificare un evento che hai creato:
In Google Play Console,
apri la scheda Eventi e seleziona la
voce relativa all'evento da modificare. Dovresti visualizzare lo stesso modulo utilizzato
quando hai creato l'evento.
Apporta le modifiche.
Quando hai finito di modificare l'evento, fai clic sul pulsante Salva.
Puoi eliminare gli eventi in stato di bozza o che sono stati pubblicati. Per eliminare un evento in Google Play Console, fai clic sul pulsante Elimina nella parte inferiore del relativo modulo.
Reimposta i dati sugli eventi
Puoi reimpostare i dati sui progressi dei giocatori per i tester dei tuoi eventi.
Per reimpostare gli eventi in stato di bozza in Google Play Console, fai clic sul pulsante Reimposta avanzamento evento nella parte inferiore del modulo relativo all'evento.
Per reimpostare i dati sugli eventi in modo programmatico, chiama i metodi dell'API di gestione Events.
Implementazioni client
Per scoprire come implementare gli eventi per la tua piattaforma, consulta le seguenti risorse:
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-26 UTC."],[],[],null,["# Events\n\nThe Google Play Games events service allows you to collect cumulative\ndata generated by your players during gameplay and store them in Google's\nservers for game analytics. You can flexibly define what player data your game\nshould collect; this might include metrics such as how often:\n\n- Players use a particular item\n- Players reach a certain level\n- Players perform some specific game action\n\nYou can use the events data as feedback on how to improve your game. For\nexample, you can adjust the difficulty level of certain levels in your game\nthat players are finding too hard to complete.\n\nTo learn how to implement events for your platform, see\n[Client implementations](#implement-event).\n\nIntegrate events in your game\n-----------------------------\n\nThe following workflow describes how you can apply events in your\ngame:\n\n1. **Define events** . To define new events to capture in your game:\n 1. Go to the *Events* page for your game in the [Google Play Console](//play.google.com/apps/publish/).\n 2. Click the *Add new event* button and configure the [event properties](#event-basics).\n 3. Publish your event definitions by following the steps described in [Publishing your game changes](/games/pgs/console/publish).\n2. **Implement event capturing in your game using the events APIs** . For\n example, in your Android code, call the events `increment` method whenever\n your game detects that an event that it cares about has been triggered.\n\n | **Note:** On mobile clients, Play Games SDK updates events in batches, so you will see cumulative, rather than fine-grained, changes to your events. When using the REST API, implement your own batching to avoid sending event updates too frequently, as this might cause you to quickly exceed your [rate limits](/games/pgs/quota).\n3. **View events data** . Go to the *Events* page for your game in\n Google Play Console to view statistics for the captured events.\n\nEvent basics\n------------\n\nThe events APIs provide you with a way to define and collect interesting gameplay\nmetrics and upload these metrics to Play Games SDK.\n\nA Play Games SDK event contains these key properties:\n\n| Property | Description |\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **ID** | A unique string generated by Google Play Console for this event. Use this unique ID to refer to the event in your game clients. |\n| **Name** | A short name of the event. The name can be up to 100 characters. This value is used by Google Play Console and can be displayed in your game. Examples: - *\"Zombies Killed\"* - *\"Red Gems Collected\"* |\n| **Description** | A longer description of the event (for example, \"Number of times a player has killed a zombie\" or \"The total number of red gems the player has eliminated and matched\"). The description can be up to 500 characters. This value is used by Google Play Console and can be displayed in your game. |\n| **Event type** | A field that declares the type of data the event is tracking. This value is used by Google Play Console to support Player Analytics reporting. Two event types are supported: Premium currency source : Select this type for events that track sources of a premium currency. For example: - *\"Gold coins earned\"* - *\"Emeralds bought\"* Premium currency sink : Select this type for events that track sinks, or consumption, of a premium currency. For example: - *\"Gold coins spent\"* - *\"Emeralds used\"* \u003cbr /\u003e |\n| **Icon** | A square icon that will be associated with your event. |\n\n### Create an event\n\nTo create a new event for your game, follow these steps:\n\n1. In the [Google Play Console](https://play.google.com/apps/publish/), click the **Game services** icon on the left and select the entry for your game.\n2. Select the **Events** tab on the left, and click the **Add event** button.\n3. Fill in the details for the event you want to create.\n4. Click **Save** . If there are no errors, your event is placed in the \"Ready to publish\" state. You can now proceed to [publish your game changes](/games/pgs/console/publish).\n\n### Edit an event\n\nTo edit an event that you've created:\n\n1. In the [Google Play Console](https://play.google.com/apps/publish/), open the **Events** tab and select the entry for the event you want to edit. You should see the same form you used when creating the event.\n2. Make your edit changes.\n3. When you've finished editing the event, click the **Save** button.\n4. Test your game to verify the modified event. If it is working correctly, [republish your game changes](/games/pgs/console/publish).\n\n### Delete an event\n\nYou can delete events that are in draft state or that have been published. To\ndelete an event in Google Play Console, click the button labeled **Delete**\nat the bottom of the form for that event.\n\n### Reset event data\n\nYou can reset player progress data for testers of your events.\n\n- To reset draft events in Google Play Console, click the button labeled **Reset event progress** at the bottom of the form for that event.\n- To reset event data programmatically, call the [Management API `Events` methods](/games/services/management/api/events).\n\nClient implementations\n----------------------\n\nTo learn how to implement events for your platform, see the following resources:\n\n- [Android](/games/pgs/android/events)\n- [Web](/games/services/web/api/rest#rest-resource:-events)"]]