MANAGE YOUR WORLD
World Distribution

ZEPETO Analytics

12min

ZEPETO Analytics is a package that makes statistical APIs easy to use.

Currently, Google Analytics is available.

👍 Google Analytics v4 specification is supported



STEP 1 : Install

Window → Package Manager → Please install ZEPETO.World Package 1.21.14 version first.

After that, install the ZEPETO Analytics package.

Document image




STEP 2 : Creating Google Analytics Data Streams

📘 Google Analytics https://analytics.google.com/

After you create your Google Analytics account, you must create a data stream to use in the World. (On average, it takes 1 day to activate the initial account.)

It is recommended that you create and manage one data stream per WorldId.

ZEPETO Analytics sends data using httpService, so please make sure to select the 'web' platform.

Document image




Please write the WorldId on where you write the URL.

Document image




When the data stream creation is complete, you can verify the Measurement ID.

Document image




To generate API Key values, you must enter the Measurement Protocol API secrets menu.

Document image




After pressing the Create button on the right, complete the Nickname entry to generate the Secret Value.

Document image




Please copy the Measurement ID and Secret Value values for the next process.



STEP 3 : How to Use

In the Hierarchy window, click the ZEPETO → Zepeto Analytics tab.

Document image




An object called Zepeto Analytics is automatically created as follows:

ZepetoAnalyticsComponent is the component responsible for sending statistics within a Scene.

In the Inspector window, you can enter the settings required to send statistics.

ZepetoAnalytics
ZepetoAnalytics




Please select Google Analytics as the Analytics Type and enter Api key and Measurement id.

Document image




When you play the Scene with the ZEPETO Analytics component added, the cumulative residence time values are automatically accumulated in Google Analytics.

You can view the engagement time value from the Reports > Realtime overview menu. (Report items excluding the Realtime tab take a certain amount of time to be reflected.)

If the scene is changed and the component is deleted, the statistics will not be sent. So if you want to keep it, please process as Don't Destroy.

❗️ Caution If you check debug mode during the editor test, the data will not be sent to the dashboard. When you want to stack data, make sure that the debug mode is turned off.

Document image




Adding Custom Event

You can stack statistics based on custom events.

Below is an example code that sends a custom event to the Google Analytics dashboard when you press a button.

TypeScript




Make sure to connect the Zepeto Analytics components after writing the script.

The screenshot below is an example of a component configured to make the example script work.

Document image




From the Reports > Realtime overview menu, you can see that values for custom events are stacked in real time.

Document image




Enable Debug Mode

Google Analytics validates the Payload Body for the CustomEvent you send. (If not valid, will not be sent)

Checking debug mode makes it easy to see the validation results for Payload that you send in the console window.

❗️ Caution If you check debug mode during the editor test, the data will not be sent to the dashboard. When you want to stack data, make sure that the debug mode is turned off.

Document image




If you create a custom event that does not fit your Google specification, validation will fail in debug mode.

Document image




For information on Google Specifications and Debug Mode, please visit:

📘 For information on Google Specifications and Debug Mode, please visit: For information on Google Specifications and Debug Mode, please visit:



ZepetoBaseAnalytics API

Functions

Description

LogEvent

Allows you to send custom events to the linked Google Analytics dashboard. Supports single parameters (string, number, boolean) and generic Payload. For Payload in generic format, only the forms that Google Analytics allows can be transferred.

SetAnalyticsCollectionEnabled

Enables/disables the Event transmission function of the ZEPETO Analytics Component. Can be used for dynamic control. By default, the Analytics Component becomes True when Enabled, and False when Disabled. (Basic residence time is automatically recorded from the time ZEPETO Analytics Component is enabled.)

SendDuration

For a particular Event name, you can transfer the residence time in milliseconds (ms). Can be used to manually record Engagement Time for a specific event. (Independent of the automatically measured residence time.) ex) Used to manually record 'I was in a specific area for 3 seconds (3000 ms)'

SetUserProperty

SetUserID

For the Event you are sending, you can set the UserID for Google Analytics to distinguish. Subsequent data is collected separately in the User section of the Google Analytics dashboard.

https://support.google.com/analytics/answer/9213390 By default, each user is automatically collected by mapping to (GA4) Session units in ZEPETO UserId units.