Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Dengan layanan peristiwa Google Play Game, Anda mengumpulkan data
kumulatif yang dihasilkan oleh pemain selama gameplay dan menyimpannya di server Google
untuk analisis game. Anda dapat menentukan data pemain yang harus dikumpulkan
game secara fleksibel; dan data ini dapat mencakup metrik seperti seberapa sering:
Pemain menggunakan item tertentu
Pemain mencapai level tertentu
Pemain melakukan beberapa tindakan game tertentu
Anda dapat menggunakan data peristiwa sebagai masukan tentang cara meningkatkan game. Misalnya,
Anda dapat menyesuaikan tingkat kesulitan level tertentu dalam game
yang menurut pemain terlalu sulit untuk diselesaikan.
Untuk mempelajari cara menerapkan peristiwa untuk platform Anda, lihat
Implementasi klien.
Mengintegrasikan peristiwa dalam game Anda
Alur kerja berikut menjelaskan cara menerapkan peristiwa dalam
game:
Menentukan peristiwa. Untuk menentukan peristiwa baru yang akan direkam dalam game:
Klik tombol Tambahkan peristiwa baru dan konfigurasikan properti peristiwa.
Publikasikan definisi peristiwa Anda dengan mengikuti langkah-langkah yang dijelaskan dalam
Memublikasikan perubahan game.
Menerapkan rekaman peristiwa di game Anda menggunakan API peristiwa. Misalnya,
dalam kode Android, panggil metode increment peristiwa setiap kali
game Anda mendeteksi bahwa peristiwa yang penting untuk kode telah dipicu.
Melihat data peristiwa. Buka halaman Peristiwa untuk game Anda di
Konsol Google Play guna melihat statistik untuk peristiwa yang ditangkap.
Dasar-dasar peristiwa
API peristiwa memberi Anda cara untuk menentukan dan mengumpulkan metrik
gameplay yang menarik serta mengupload metrik ini ke Play Game SDK.
Peristiwa SDK Play Game berisi properti utama berikut:
Properti
Deskripsi
ID
String unik yang dibuat oleh Konsol Google Play untuk peristiwa ini.
Gunakan ID unik ini untuk merujuk ke peristiwa di klien game Anda.
Nama
Nama pendek peristiwa. Nama dapat berisi maksimal 100 karakter.
Nilai ini digunakan oleh Konsol Google Play dan dapat ditampilkan di
game Anda.
Contoh:
"Zombi yang Terbunuh"
"Permata Merah yang Dikumpulkan"
Deskripsi
Deskripsi peristiwa yang lebih lama (misalnya, "Berapa kali
pemain membunuh zombie" atau "Total jumlah permata merah yang telah
dihilangkan dan dicocokkan oleh pemain"). Deskripsi dapat berisi hingga 500 karakter.
Nilai ini digunakan oleh Konsol Google Play dan dapat ditampilkan di game Anda.
Jenis peristiwa
Kolom yang mendeklarasikan jenis data yang dilacak oleh peristiwa.
Nilai ini digunakan oleh Konsol Google Play untuk mendukung pelaporan
Analisis Pemain.
Dua jenis peristiwa didukung:
Sumber mata uang premium
Pilih jenis ini untuk peristiwa yang melacak sumber
mata uang premium. Misalnya:
"Koin emas yang diperoleh"
"Zamrud yang dibeli"
Penurunan nilai mata uang premium
Pilih jenis ini untuk peristiwa yang melacak penurunan atau
penggunaan mata uang premium. Misalnya:
"Koin emas yang dibelanjakan"
"Zamrud yang digunakan"
Ikon
Ikon persegi yang akan dikaitkan dengan peristiwa Anda.
Membuat peristiwa
Untuk membuat peristiwa baru untuk game Anda, ikuti langkah-langkah berikut:
Di Konsol Google Play,
klik ikon Layanan game di sebelah kiri dan
pilih entri untuk game Anda.
Pilih tab Events di sebelah kiri, lalu klik tombol Add event.
Isi detail untuk peristiwa yang ingin Anda buat.
Klik Save. Jika tidak ada error, peristiwa Anda akan ditempatkan dalam
status "Siap dipublikasikan". Anda dapat melanjutkan untuk
memublikasikan perubahan game.
Mengedit peristiwa
Untuk mengedit peristiwa yang Anda buat:
Di Konsol Google Play,
buka tab Events, lalu pilih
entri untuk peristiwa yang ingin Anda edit. Anda akan melihat formulir yang sama dengan formulir yang digunakan
saat membuat peristiwa.
Buat perubahan.
Setelah selesai mengedit peristiwa, klik tombol Save.
Anda dapat menghapus peristiwa yang berstatus draf atau yang telah dipublikasikan. Untuk
menghapus peristiwa di Konsol Google Play, klik tombol berlabel Delete
di bagian bawah formulir untuk peristiwa tersebut.
Mereset data peristiwa
Anda dapat mereset data progres pemain untuk penguji peristiwa.
Untuk mereset peristiwa draf di Konsol Google Play, klik tombol berlabel Reset event progress di bagian bawah formulir untuk peristiwa tersebut.
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)"]]