애널리틱스 API는 특정 상황에서 자동으로 애널리틱스 서비스에 이벤트를 보냅니다. 하지만 사용자 정의 트리거를 사용하여 커스텀 이벤트를 보낼 수도 있습니다. 트리거는 에디터에서 전부 설정과 구현이 가능하며, 스크립트를 통해서도 가능합니다.
애널리틱스 API를 통해 커스텀 이벤트를 보낼 임의의 게임 오브젝트에 Analytics Tracker를 부착해야 합니다.
프로퍼티: | 기능: |
---|---|
Event Name | 커스텀 이벤트의 이름을 설정합니다. |
Trigger | 이벤트가 보내지는 직접적인 원인을 명시하면 됩니다. 자세한 내용은 아래 트리거에 대한 참고 사항을 참조하십시오. |
Parameters | 키와 값의 리스트를 설정합니다. 파라미터 데이터는 고정된 문자열을 보내는 정적 파라미터 데이터이거나 주어진 게임 오브젝트에 부착된 임의의 컴포넌트의 임의의 필드일 수 있습니다. 자세한 내용은 아래 파라미터에 대한 참고 사항을 참조하십시오. |
Trigger 는 이벤트가 보내지는 직접적인 원인을 명시합니다.
이벤트는 대부분의 MonoBehaviour 수명 주기의 일반적인 메서드에 영향을 줄 수 있지만, 외부 소스에서 트리거될 수도 있습니다. 예를 들어, External 이벤트 트리거는 UI Button 컴포넌트의 클릭 이벤트에 아래와 같이 온전히 결속될 수 있으며, 이는 에디터를 통해서도 전부 가능합니다.
이 예제에서 MyAnalyticsTracker 게임 오브젝트는 Trigger 타입이 External 으로 설정된 Analytics Tracker 컴포넌트가 있습니다. 버튼 컴포넌트는 OnClick 이벤트에서 AnalyticsTracker.TriggerEvent 를 호출하여 이벤트를 트리거할 수 있습니다.
필드를 통해 키와 값의 리스트를 설정할 수 있습니다. 파라미터 데이터는 고정된 문자열을 보내는 Static 파라미터 데이터이거나 주어진 게임 오브젝트에 부착된 임의의 컴포넌트의 임의의 필드일 수 있습니다.
여기서 파라미터는 Static 입니다. 이 예제에서 키의 이름은 “name”이며 값의 이름은 “value”입니다. 이름은 원하는대로 변경할 수 있습니다. 파라미터에 대한 이벤트로 보내지는 데이터는 항상 동일합니다.
위 이미지는 이벤트 데이터로 등록된 파라미터 리스트입니다. 이 값은 사용자 지정 클래스인 TestAnalyticsDataObject 의 boolParameter 필드에서 설정되며, ExampleGameObject 게임 오브젝트에 부착됩니다. 이 이벤트는 이벤트가 보내지는 시점의 필드 콘텐츠를 포함합니다. 콘텐츠는 문자열, 숫자, 부울에 해당하는 임의의 공용 필드로 설정할 수 있습니다.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.