User Information - GameAnalytics/GA-SDK-JAVASCRIPT GitHub Wiki

During the game it is possible to set information about your users that will then be annotated to all other events.

  • gender
  • Facebook ID
  • birthyear (age)

:information_source: These user values will persist cross session/game-launch. Set them to nil to reset.

 

Set gender.

<!-- Traditional way -->
gameanalytics.GameAnalytics.setGender(gameanalytics.EGAGender.Female);
<!-- Command queue -->
GameAnalytics("setGender", "Female");

Set birthyear.

<!-- Traditional way -->
gameanalytics.GameAnalytics.setBirthYear(1980);
<!-- Command queue -->
GameAnalytics("setBirthYear", 1980);

Set Facebook ID.

<!-- Traditional way -->
gameanalytics.GameAnalytics.setFacebookId("123456789012345");
<!-- Command queue -->
GameAnalytics("setFacebookId", "123456789012345");

 

Field Type Description Example
gender string Gender of player. gameanalytics.EGAGender.Female, gameanalytics.EGAGender.Male
birthYear integer The year the player was born. 1980
facebookId string Facebook Id of the player. 123456789012345

 

NEXT  →