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 step 2 creating google analytics data streams 📘 google analytics https //analytics google com/ 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 please write the worldid on where you write the url when the data stream creation is complete, you can verify the measurement id to generate api key values, you must enter the measurement protocol api secrets menu after pressing the create button on the right, complete the nickname entry to generate the secret value 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 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 please select google analytics as the analytics type and enter api key and measurement id 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 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 import { zepetoscriptbehaviour } from 'zepeto script'; import { analyticstype, zepetoanalyticscomponent } from 'zepeto analytics'; import { button } from 'unityengine ui'; export default class customevent extends zepetoscriptbehaviour { public zepetoanalytics zepetoanalyticscomponent; public mybutton button; start() { this mybutton onclick addlistener(() => { // when the button is clicked, a random event is fired to google analytics const ga = this zepetoanalytics analytics(analyticstype googleanalytics); interface customevent { param 01 string; param 02 number; } const event customevent = { param 01 "param string val 01", param 02 3, } ga logevent\<customevent>("custom sub param", event); }); } } 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 from the reports > realtime overview menu, you can see that values for custom events are stacked in real time 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 if you create a custom event that does not fit your google specification, validation will fail in debug mode 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 google analytics https //developers google com/analytics/devguides/collection/protocol/ga4/sending events?hl=en\&client type=gtag https //developers google com/analytics/devguides/collection/protocol/ga4/sending events?hl=en\&client type=gtag google analytics dev tools https //ga dev tools web app/ga4/event builder/ https //ga dev tools web app/ga4/event builder/ 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 https //developers google com/analytics/devguides/collection/protocol/ga4/validating events?client type=gtag https //developers google com/analytics/devguides/collection/protocol/ga4/validating events?client type=gtag 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 for the event you are sending, you can add a custom user property https //developers google com/analytics/devguides/collection/protocol/ga4/user properties?hl=en\&client type=gtag https //developers google com/analytics/devguides/collection/protocol/ga4/user properties?hl=en\&client type=gtag 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 https //support google com/analytics/answer/9213390 by default, each user is automatically collected by mapping to (ga4) session units in zepeto userid units