Main

JSON Sample Events-Removed

The Ninja Metrics JSON API allows you to push your application’s Event data into our pipeline.

All JSON Event payloads are POSTed to the following URL base:
https://api.ninjametrics.com/event

All queries to server-side endpoints require the following parameters:
?client_id=[client id from account manager]&app_id=[app id from account manager]&api_client=[self identified lib version]

For example:
https://api.ninjametrics.com/event?client_id=100&app_id=100&app_pwd=1234567890&api_client=CoolCompany/ruby_1.2a

We also collect, for deployment tracking purposes to provide better support to our customers, any data in the User-Agent HTTP header field.

The value for the timestamp key in any Event JSON payload should always be in the ISO-8601 standard (UTC): YYYY-MM-DDTHH:mm:ss.sssZ. JavaScript’s Date.toJSON() accomplishes this perfectly.

For example:
HTTPS POST https://api.ninjametrics.com/event?client_id=1&app_id=1&api_client=Spot/js_1.5.u
with JSON payload body...
{
"timestamp":"2012-12-05T03:12:15.319Z",
"data":{
        ...
}
}

The values used for the account_id, character_id, and shard_id keys must be initialized with the respective #9, #11, and #13 dimensional data loader Events before use in any Event payloads. Event type #9-15, 31, 35, 36 are used in initializing DIM data. REMEMBER: When not making use of a numeric key, you must put 0 for its value.


Note:

JSON Content Type - When sending JSON data to the Ninja Metrics API it is required to properly set the "Content Type" header to "application/json". A lot of packages do this automatically, but if you receive a 415 error then that is likely the cause.

Using JSON Samples

The first line is a sample function call for the event using one of our provided libraries.

        nameOfFunction(var1, var2, var3, var4, var5)

The next section is a pure JSON sample POST body that could be sent.

        {
                "timestamp":"2013-11-14T13:43:06.308Z",
                 "data":{
                        "type":##,
                        "var1":"cool_guy@example.com",
                        "var2":"Wizard",
                        "var3":987653,
                        "var4":"Something here",
                        "var5":12345
                }
        }

They are independent. The function is just there as a reference of what you would use in one of the libraries.

Example

The following is an example of a complete JSON only request.

1. Create a POST request to the appropriate url making sure to set the header Content-Type = "application/json":
http://api.ninjametrics.com/event?client_id=1234&app_id=5678&app_pwd=somepassword&api_client=JSON
2. The body of the post request format should match one of the following JSON examples found below. In each example the one field that should remain unchanged is the "type" key/value pair. This is the event id.

NOTE: The order of the JSON key/value pairs is important. Changing the order will result in the request being rejected.

Back to Top


Login (Event 1)

Logs that a Login event occurred.

 logLogin(EventTimestamp, AccountId, CharacterId, ShardId, ClientPlatform, AreaId, AreaName)
        {
                "timestamp":"2013-11-14T13:43:06.308Z",
                 "data":{
                        "type":1,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42,
                        “platform":"Facebook Mobile",
                        "area_id":0
                        “area_name”:"Area_Name"
                }
        }

Optional Parameters: shard_id, area_id, area_name

Notes

  • platform is an open-ended String field that should be used consistently throughout the application integration.
  • FUTURE: area_id must match numeric identifier given from map loading process.
  • One could have just the type and account_id parameters in the data section and only have to initialize the account_id parameter.

Back to Top


Logout (Event 2)

Logs that a Logout event occurred.

 logLogout(EventTimestamp, AccountId, CharacterId)
        {
                "timestamp":"2013-11-14T13:51:53.035Z",
                "data":{
                        "type":2,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                }
        }

Notes

  • platform is an open-ended String field that should be used consistently throughout the application integration.
  • FUTURE: area_id must match numeric identifier given from map loading process.
  • One could have just the type and account_id parameters in the data section and only have to initialize the account_id parameter.

Back to Top


Subscription Change (Event 3)

Updates the Ninja Metrics service with new information about an account subscription.

 putSubChange(EventTimestamp, AccountId, SubscriptionStatus, SubscriptionType, SubscriptionValue, ExpireTimestamp)
        {
                "timestamp":"2013-11-10T06:00:00.000Z",
                "data":{
                        "type":3,
                        "account_id":"cool_guy@example.com",
                        "account_status":"Active",
                        "account_sub_type":"Paid",
                        "account_sub_value":10,
                        "account_sub_expires_timestamp":"2016-02-01T06:00:00.000Z"
                }
        }

Optional parameters: account_sub_value

Notes

  • Valid options for subscription_status: Active, Stopped, Expired, Failed, Cancelled
  • Valid options for subscription_type: Free, Paid, Premium
  • subscription_value: how much does the subscription over this period cost?
  • expire_timestamp - timestamp = subscription period length

Back to Top


Social Group Enter (Event 4)

Logs a Group Entry event.

 logEnterGroup(EventTimestamp, AccountId, CharacterId, ShardId, GroupId, CharacterLevel)
        {
                "timestamp":"2013-11-14T14:10:36.792Z",
                "data":{
                        "type":4,
                        "account_id":"cool_guy@example.com",
                        "character_id":"wizard",
                        "character_lvl":50,
                        "shard_id":42,
                        "group_id":42
                }
        }

Optional parameters: shard_id

Notes

  • group_id parameter values do not have to be initialized beforehand. They will automatically be created if they don't exist.
  • character_level must be numeric and should be set to 0 if unused

Back to Top


Social Group Exit (Event 5)

Logs a Group Exit event.

 logExitGroup(EventTimestamp, AccountId, CharacterId, ShardId, GroupId, CharacterLevel)
        {
                "timestamp":"2013-11-14T14:16:15.375Z",
                "data":{
                        "type":5,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "character_lvl":50,
                        "shard_id":42,
                        "group_id":42
                }
        }

Optional parameters: shard_id

Notes

  • group_id parameter values do not have to be initialized beforehand. They will automatically be created if they don't exist.
  • character_level must be numeric and should be set to 0 if unused

Back to Top


Social Interactions (Event 6)

Logs an in-app Social event and not for game invites, messages, group enter/exit, store gifts or clan enter/exit.

 logSocialEvent(EventTimestamp, AccountId, SenderCharacterId, ShardId, SenderLevel, ReceiverAccountId, ReceiverCharacterId, ReceiverLevel, EventName, EventType)
        {
                "timestamp":"2013-11-14T14:28:54.832Z",
                "data":{
                        "type":6,
                        "sender_account_id":"cool_guy@example.com",
                        "sender_character_id":"sharer",
                        "sender_character_level":1,
                        "receiver_account_id":"cool_guy1@example.com",
                        "receiver_character_id":"advertiser",
                        "receiver_character_level":1,
                        "shard_id":42,
                        "social_event_name":"rebate_share",
                        "social_event_type":"share"
                }
        }

Optional parameters: shard_id

Notes

  • event_name and event_type will accept any string.
  • event_type examples: “clan invite”, “group invite”, “barter”. This should be used for social events not already explicitly called out. Do NOT use this for tracking Guild (#41,42) or Group (#4,5) Enter/Exit, Recruitment (#33,34) Send/Response.

Back to Top


Off Game Interaction (OGI) Sender (Event 7)

Logs the start (sending) of a social transaction outside of the application aka an Off-Game Interaction.

logOgiSend(EventTimestamp, SenderAccountId, SenderCharacterId, ReceiverAccountId, ReceiverCharacterId, ShardId, Category, Location)
        {
                "timestamp":"2013-11-14T14:48:56.718Z",
                "data":{
                        "type":7,
                        "sender_account_id":"cool_guy@example.com",
                        "sender_character_id":"wizard",
                        "receiver_account_id":"small_cat@example.com",
                        "receiver_character_id":"mage",
                        "shard_id":42,
                        "ogi_location":"https://www.facebook.com/wall/42",
                        "ogi_category":"wall post"
                }
        }

Optional parameters: shard_id

Notes

  • See Event#8 for suggested values for location and category.

Back to Top


Off Game Interaction (OGI) Receiver (Event 8)

Logs the end (receiving) of a social transaction outside of the application aka an Off-Game Interaction.

logOgiRecv(EventTimestamp, SenderAccountId, SenderCharacterId, ReceiverAccountId, ReceiverCharacterId, ShardId, Category, Location, ReceiverAction)
        {
                "timestamp":"2013-11-14T15:00:53.806Z",
               "data":{
                        "type":8,
                        "sender_account_id":"cool_guy@example.com",
                        "sender_character_id":"wizard",
                        "receiver_account_id":"small_cat@example.com",
                        "receiver_character_id":"mage",
                        "shard_id":42,
                        "ogi_category":"wall post",
                        "ogi_location":"https://www.facebook.com/wall/42",
                        “ogi_receiver_action”:”other”
                }
        }

Optional parameters: shard_id

Notes

  • location, category, and receiver_action will accept any string, so be sure to use them appropriately.
  • We suggest you use a URI for location to specify where the off-game-interaction occurred.
  • category examples: “forum post”, “wall post”, “service cancel”.
  • receiver_action examples: “post response”, “cancel request”.

Back to Top


Create Account (Event 9)

Loads Account creation data, and must be run once per Account Id, before referencing said Account Id in any other logging statements.

 loadAccountCreate(EventTimestamp, AccountId, ClientLanguage, ClientCountry, ClientGender, ClientDob, ClientPlatform, BankedCurrency, AccountType, OldAccountId)
        {
                "timestamp":"2013-11-14T15:18:30.726Z",
                "data":{
                        "type":9,
                        "account_id":"cool_guy@example.com",
                        "account_sub_type":"Free",
                        "account_lang":"NA",
                        "account_country":"de",
                        "account_gender":"N",
                        "account_dob":"1900-01-01T00:00:00.000Z",
                        "account_currency_balance":55,
                        "platform":"Social",
                        "old_account_id":"small_cat@example.com"
                }
        }	

Optional parameters: banked_currency, old_account_id

Notes

  • account_type: Free, Paid, Premium
  • client_lang - 2 to 4 letter language code from http://www.geonames.org/countries/ - examples: ar-YE, en-US, fr
  • client_country - ISO-3166 alpha2 country-code from http://www.geonames.org/countries/ - examples: YE, US, VE
  • client_gender: “M”, “F”, “T”, or “”
  • client_platform is an open-ended String field that should be used consistently by the integrator

Back to Top


Delete Account (Event 10)

Logs a Delete Account event. Information regarding account delete as well as reason regarding account deletion in terms of churn, farming or account compromise. This must be run once per Account Id life cycle, to properly keep application metrics in-sync. This pseudo-event will remove the given account_id from dimension data, and is required for accurate Churn analysis.

 loadAccountDelete(EventTimestamp, AccountId, ChurnType)	
        {
                "timestamp":"1989-08-15T05:00:00.000Z",
                "data":{
                        "type":10,
                        "account_id":"cool_guy@example.com",
                        "account_status":"Failed",
                }
        }

Notes

  • account_status: Stopped, Expired, Failed, Cancelled

Back to Top


Create Character (Event 11)

Logs a Character Create event. Many games allow the user to create multiple characters or aliases. This must be run once per Character Id before referencing said Character Id in any other logging statements.

 loadCharacterCreate(EventTimestamp, CharacterId, AccountId, CharacterClass, CharacterSubclass, CharacterGender, CharacterRace, CharacterName, ShardId)
        {
                "timestamp":"2013-11-14T15:47:36.202Z",
                "data":{
                        "type":11,
                       "account_id":"cool_guy@example.com",
                        "character_id":"wizard",
                        "character_class":"magic",
                        "character_sub_class":"healer",
                        "character_gender":"N",
                        "character_race":"fish",
                        "character_name":"small_fish",
                        "shard_id":0
                }
        }

Optional parameters: shard_id

Notes

  • character_gender: “M”, “F”, “T”, “”

Back to Top


Delete Character (Event 12)

Logs a Character Delete event- This event refers to the character deletion info and the characters that are referred to here are the same as in event (11). This must be at the end of a Character lifecycle, to properly keep application metrics in-sync.

 loadCharacterDelete (EventTimestamp, CharacterId, AccountId,)
        {
                "timestamp":"2013-11-14T16:03:13.367Z",
                "data":{
                        "type":12,
                        "account_id":"cool_guy@example.com”,
		       "character_id":"Wizard”
                }
        }

Back to Top


Shard Initialization (Event 13)

Logs Shard Initialize event. This must occur before any logger or load command references the Shard Id.

 loadShardCreate(EventTimestamp, ShardId, ShardDescription)
        {
                "timestamp":"2013-11-14T16:15:08.347Z",
                "data":{
                        "type":13,
                        "shard_id":42,
                        "shard_desc":"the shard with answers to it all"
                }
        }

Back to Top


!!!! Virtual Currency Set (Event 14) - Automatically Created - No Need To Implement. Logs Virtual Currency Set event. This can be used to create a virtual currency and update an exchange rate of an existing currency. [ loadVirtualCurrency(EventTimestamp, VirtualCurrencyLabel) { "timestamp":"2013-11-14T16:57:39.193Z", "data":{

                        "type":14,

"virtual_currency_label":"MUCHA" } } ] Back to Top


Item Initialization (Event 15)

Logs an Item Initialize event. This event capture information regarding virtual items in the game. This must be used before referencing an item id in any other command.

 loadItem(EventTimestamp, ItemId, ItemName, ItemType, ItemSegment, CreatorAccountId, CreatorCharacterId)
        {
		"timestamp":"2013-11-14T17:11:33.720Z",
		"data":{
		        "type":15,
		        "item_id":66,
		        "item_name":"the big blaster gun",
		        "item_type":"weapon",
		        "item_segment":"UGC",
		        “creator_account_id":"cool_guy@example.com",
		        “creator_character_id":"Wizard"
		}
}

Optional parameters: creator_account_id, creator_character_id

Notes

  • item_type may be any string, but use it consistently. some examples: “Raw materials”, “Mounts and pets”, “armor”, “tools”, “containers”
  • item_value is a floating point value which would be used for the store price of the item
  • item_segment may be “UGC” when the item is user-generated or “INGAME” when part of the original application
  • IF the item_segment field is “UGC” then the creator_account_id and creator_character_id fields should be set appropriately, otherwise they should be empty strings

Back to Top


Item Used (Event 16)

Logs an Item Used event. This item captures usage of items in the game, additional information regarding the account and character of the user who used the item as well as location of the character that used the item is also recorded.

 logItem(EventTimestamp, AccountId, CharacterId, ShardId, ItemId, ItemName, CharacterLevel, AreaId, AreaName, ItemCount, PosX, PosY, PosZ)
        {
                "timestamp":"2013-11-14T17:42:49.185Z",
                "data":{
                        "type":16,
                        "account_id":"cool_guy@example.com",
                        "character_id":"wizard",
                        "shard_id":42,
                        "item_id":66,
                        "item_name":"The Blaster Gun",
                        "character_lvl":52,
                        "area_id":42,
                        "area_name”:”Area_Name”,
                        "item_count":1,
                        "position_x":678,
                        "position_y":231,
                        "position_z":517
                }
        }

Optional parameters: shard_id

Notes

  • item_count is used for the number of times the item is used in this particular location; useful for spells, bullets.
  • If pos_x, pos_y, or pos_z are unavailable, then the unavailable coordinate(s) should be assigned -1.0.

Back to Top ---- !!!! Item Transaction (Event 17) - To Be Completed. Logs an Item Transaction event. Information regarding purchase of items in the game. Depending upon the game, an item may be bought using real world money or virtual currency which may be exclusive to the game.

[ logItemTransaction(EventTimestamp, AccountId, CharacterId, ShardId, ItemId, ItemName, TransactionType, ItemPrice, CurrencyType, VirtualCurrencyLabel, CurrencyValue, VirtualCurrencyCount) { "timestamp":"2013-11-14T17:52:58.876Z", "data":{ "type":17, "account_id":"cool_guy@example.com", "character_id":"wizard", "shard_id":42, "item_id":66, "item_name":"the big blaster gun", "transaction_type":0, "item_price":3, "currency_type":0,

                        "virtual_currency_label":"",

"currency_value”:3, "virtual_currency_count”:”1” } } ]

Optional parameters: shard_id, virtual_currency_label, virtual_currency_count

Notes * Multiple Item Transaction events may have to be called for a single transaction if multiple currencies are used. Example: 4 gold, 5 silver, 3 copper for a fish trap. * item_price is the purchase price a user must pay for the item. * See Event#18 for information on the last four fields.

Back to Top


Currency Transaction (Event 18)

Logs a Currency Transaction event. Covers all types of transaction in the game or any other environment where real world money was used. Designed To Handle Most Currency Transactions. More Complicated Transactions Can Be Done Within Event #37.

 logCurrencyTransaction(EventTimestamp, AccountId, CharacterId, ShardId, TransactionType, CurrencyType, VirtualCurrencyLabel, CurrencyValue, Description, VirtualCurrencyCount)
        {
                "timestamp":"2013-11-14T18:10:14.808Z",
                "data":{
                        "type":18,
                        "account_id":"cool_guy@example.com",
                        "character_id":"wizard",
                        "shard_id":42,
                        "transaction_type":0,
                        "currency_type":0,
                        "virtual_currency_label":"mucha",
                        "currency_value":3.45,
                       "transaction_desc”:”spend 3.45USD"
                       "virtual_currency_count”:”1”
                }
        }

Optional parameters: shard_id, virtual_currency_label, currency_value, description, virtual_currency_count

Notes

  • transaction_type: 0 if currency is spent, 1 if currency is acquired
  • currency_type: 0 if real-world currency, 1 if virtual currency
  • virtual_currency_label: name of a virtual currency already initialized with Event#14, used in this transaction
  • currency_value: floating point representation of how much currency was transacted
  • description: optional description of the transaction limited to 200 characters

Back to Top


!!!! UGC Rating (Event 19) - To Be Completed. Logs a UGC Rating event. Some games allow players to create in-game items or other artifacts. This event covers such items and how such items are rated by other players.

[ loadUgcRating(EventTimestamp, AccountId, CharacterId, ShardId, ItemId, ItemName, Rating) { "timestamp":"2013-11-14T18:24:36.601Z", "data":{ "type":19,

                        "account_id":"cool_guy@example.com",

"character_id":"Wizard", "shard_id":42,"item_id":764, "item_name":"crafty button", "ugc_rating":"theUgcRating" } } ]

Optional parameters: shard_id

Notes * The rating field is an open-ended field that will accept any numeric or string value.

Back to Top ----

Message (Event 20)

Logs a Message event. A common feature in many games in the ability of players to message one another. Depending upon the game, multiple channels of communication may be used (e.g. it may be in the form of in-game chat, in-game mail, message broadcast to players in a group, etc). This event does not log any message content, just the interaction between two users.

 logMessage(Event, SenderAccountId, SenderCharacterId, ReceiverAccountId, ReceiverCharacterId, ShardId, MessageDescription, ChannelLabel, CharacterCount)
        {
                "timestamp":"2013-11-14T18:46:02.842Z",
                "data":{
                        "type":20,
                        "sender_account_id":"cool_guy@example.com",
                        "sender_character_id":"Wizard",
                        "receiver_account_id":"cool_guy@example.com",
                        "receiver_character_id":"Wizard",
                        "shard_id":0,
                        "message_desc”:”pulled from twitter",
                        “message_ch_label":"twitter",
                        “message_char_count":140
                }
        }

Optional parameters: shard_id, message_description

Notes

  • channel_label should be a unique string identifier for the channel/medium.

Back to Top


Begin Combat (Event 21)

Logs a Begin Combat event. This event refers to the start of combat between a player and a non-player character (NPC)kick off the beginning of combat.

 combatStart(EventTimestamp, AccountId, CharacterId, ShardId, NpcId, AreaId, AreaName, PosX, PosY, PosZ)
        {
                "timestamp":"2013-11-14T18:55:58.241Z",
                "data":{
                        "type":21,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42,
                        "npc_id":23456,
                        "area_id":552,
                        "area_name”:''Area Name'',
                        "position_x":678,
                        "position_y":231,
                        "position_z":517
                }
        }

Optional parameters: shard_id

Notes

  • Be sure to initialize the npc_id with Event#31.
  • area_id is the unique numeric identifier for area, which must be previously initialized using Event #TODO.
  • If pos_x, pos_y, or pos_z are unavailable, then the unavailable coordinate(s) should be assigned -1.0.

Back to Top


End Combat (Event 22)

Logs an End Combat event. This event refers to the end of combat between a player and a non-player character (NPC).

 combatEnd(EventTimestamp, AccountId, CharacterId, ShardId, NpcId, AreaId, AreaName, PosX, PosY, PosZ)
        {
                "timestamp":"2013-11-14T18:55:58.241Z",
                "data":{
                        "type":22,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42,
                        "npc_id":23456,
                        "area_id":552,
                        "area_name”:”Area Name”,
                        "position_x":678,
                        "position_y":231,
                        "position_z":517
                }
        }

Optional parameters: shard_id

Notes

  • See notes on the fields in Event#21 documentation.

Back to Top


NPC Kill (Event 23)

Logs a Kill NPC event. Refers to an event when a non-player character (NPC) is killed by a player in the game.

 logKillNpc(EventTimestamp, CharacterId, AccountId, ShardId, CharacterLevel, NpcId)
        {
                "timestamp":"2013-11-15T13:08:45.954Z",
                "data":{
                        "type":23,
                        "character_id":"wizard",
                        "account_id":"cool_guy@example.com",
                        "shard_id":52,
                        "character_lvl":42,
                        "npc_id":23456
                }
        }

Optional parameters: shard_id

Notes

  • See field notes from previous Events.

Back to Top


Player Points (Event 24)

Logs a Player Points event. Information regarding when a player gains experience points in the game. In many games experience points are used as an indicator of how well the player is doing in the game and how much she has progressed. In many games gaining enough experience points leads the player to level up to a higher level.

 playerPoints(EventTimestamp, AccountId, CharacterId, ShardId, Points, CharacterLevel, GroupedFlag, PointType)
        {
                "timestamp":"2013-11-15T13:17:01.847Z",
                "data":{
                        "type":24,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42,
                        “xp_amount”:34.45,
                        "character_lvl":1,
                        "grouped_flag":"Y",
                        "point_type":"Point_Type"
                }
        }

Optional parameters: shard_id, grouped_flag

Notes

  • The points field is an unsigned whole number with maximum size of 18.
  • The grouped_flag is used to tell if XP points were awarded for individual or group behaviors: “Y” or “N”.

Back to Top


PVP Duel (Event 25)

Logs a PVP Duel event. Information regarding when a player enters a combat against another player. This type of event is only applicable to environments or games, where a player is allowed to fight against another player since not all environments are competitive in nature.

Please use Social Interactions Event #6 to record Player Versus Player actions. [ logPvpDuel(EventTimestamp, AccountId, CharacterId, ShardId, Winner) { "timestamp":"2013-11-15T13:26:39.832Z", "data":{ "type":25, "account_id":"cool_guy@example.com", "character_id":"Wizard", "shard_id":42, “win_flag”:”Y” } } ]

Optional parameters: shard_id Back to Top


PVP Death (Event 26)

Logs a Player Death event. Information regarding the death of player by a non-player character (NPC).

 logPlayerDeath(EventTimestamp, AccountId, CharacterId, ShardId, AreaId, NpcId, PosX, PosY, PosZ, DeathType, AreaName)
        {
                "timestamp":"2013-11-15T13:32:33.452Z",
                "data":{
                        "type":26,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42,
                        "area_id":512,
                        "npc_id":23456,
                        "position_x":678,
                        "position_y":231,
                        "position_z":517,
                        "death_type":"Immolation",
                        "area_name”:”Area Name”
                }
        }

Optional parameters: shard_id

Back to Top


Level Begin (Event 27)

Logs a level Begin event. A large number of games are organized in terms of levels which reflect the. difficulty of game play. This event captures the time at which a player begins a level.

 levelBegin(EventTimestamp, AccountId, CharacterId, ShardId, CharacterLevel, AreaId, PosX, PosY, PosZ, AreaName)
        {
                "timestamp":"2013-11-15T13:41:08.559Z",
                "data":{
                        "type":27,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42,
                        "character_lvl":52,
                        "area_id":2,
                        "position_x":678,
                        "position_y":231,
                        "position_z":517,
                        "area_name”:”Area_Name”
                }
        }

Optional parameters: shard_id

Back to Top


Level End (Event 28)

Logs a Level End event. Refers to the level in event (27) but instead of the beginning of levels it refers to the end of levels. Log the player completing a level.

 levelEnd(EventTimestamp, AccountId, CharacterId, ShardId, CharacterLevel,  AreaId, PosX, PosY, PosZ, AreaName)
        {
                "timestamp":"2013-11-15T13:41:08.559Z",
                "data":{
                        "type":28,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42,
                        "character_lvl":52,
                        "area_id":2,
                        "position_x":678,
                        "position_y":231,
                        "position_z":517,
                        "area_name”:”Area_Name”
                }
        }

Optional parameters: shard_id

Back to Top


Area Enter (Event 29)

Logs an Area Enter event. Many games are organized in the form of virtual worlds where there are many. geographical areas. This event refers to the time when a player enters such an area.

 areaEnter(EventTimestamp, AccountId, CharacterId, ShardId, AreaId, CharacterLevel, PosX, PosY, PosZ, AreaName)
        {
                "timestamp":"2013-11-15T14:04:32.369Z",
                "data":{
                        "type":29,
                        "account_id":"cool_guy@example.com",
                        "character_id":"wizard",
                        "shard_id":42,
                        "area_id":200,
                        "character_lvl":52,
                        "position_x":678,
                        "position_y":231,
                        "position_z":517,
                        "area_name":"Area_Name"
                }
        }

Optional parameters: shard_id

Back to Top


Area Exit (Event 30)

Logs an Area Exit event. Similar to event (29) but with the difference that it refers to the time when a player exits an area. Logs the player exiting an area.

 areaExit(EventTimestamp, AccountId, CharacterId, ShardId, AreaId, CharacterLevel, PosX, PosY, PosZ, AreaName)
        {
                "timestamp":"2013-11-15T14:04:32.369Z",
                "data":{
                        "type”:30,
                        "account_id":"cool_guy@example.com",
                        "character_id":"wizard",
                        "shard_id":42,
                        "area_id":200,
                        "character_lvl":52,
                        "position_x":678,
                        "position_y":231,
                        "position_z":517,
                        "area_name":"Area_Name"
                }
        }

Optional parameters: shard_id

Back to Top


NPC Interaction (Event 31)

Logs a NPC Interaction event. A large class of games have non-player characters (NPCs) which interact with the player in the gaming environment. They have different levels of difficulty and may be friendly or aggressive. This event is used to populate the dimension tables for NPCs and is referred to by all the other events that refer to NPCs.Logs the interaction between an in-game NPC and a player.

 logNpcInteraction(EventTimestamp, AccountId, CharacterId, ShardId, EventName, EventType, NpcId, NpcName, NpcType, MinLevel, MaxLevel, Toughness, ToughnessEnum)
        {
                "timestamp":"2013-11-15T14:22:57.102Z",
                "data":{
                        "type":31,
                        "account_id":"cool_guy@example.com",
                        "character_id":"wizard",
                        "shard_id":42,
                        "npc_event_name":"npcEventName",
                        "npc_event_type":"Combat",
                        "npc_id":2345,
                        "npc_name":"the Mort of T",
                        "npc_type":"Enemy",
                        “npc_level_min”:5,
                        "npc_level_max”:10,
                        "npc_toughness":0.25,
                        "npc_toughness_enum":"Quarter"
                }
        }

Optional parameters: shard_id, min_level, max_level

Back to Top


Challenge (Event 32)

Logs a Challenge event. Challenges are elements of games where a player or even a group of players can perform a tasks or a set of tasks to get some reward within the game. Alternatively completing a challenge may be necessary to level up in the games. In some genres of games e.g., MMORPGs a challenge may be referred to as a quest. Logs a player challenge - starting/working/done.

 logChallenge(EventTimestamp, AccountId, CharacterId, ShardId, ChallengeId, ChallengeType, ChallengeStatus)
        {
                "timestamp":"2013-11-15T14:31:40.633Z",
                "data":{
                        "type":32,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42,
                        "challenge_id":"challenge_Id",
                        "challenge_type":"Kill NPC",
                        "challenge_status":"Abandoned"
                }
        }

Optional parameters: shard_id

Back to Top


Send Recruitment (Event 33)

Logs a Recruitment Send event. There are certain types of activities or interactions in games where a player may invite other players to join him/her in finishing a certain task. This event captures such events where a person may recruit others to join them in those activities. Logs that a recruitment message was sent.

 recruitmentSend(EventTimestamp, SenderAccountId, SenderCharacterId, ReceiverAccountId, ReceiverCharacterId, RecruitmentType)
        {
                "timestamp":"2013-11-15T14:37:55.545Z",
                "data":{
                        "type":33,
                        "sender_account_id":"cool_guy@example.com",
                        "sender_character_id":"Wizard",
                        "receiver_account_id":"small_cat@example.com",
                        "receiver_character_id":"Wizard",
                        "recruitment_type":"mobile ad"
                }
        }

Back to Top


Receive Recruitment (Event 34)

Logs a Recruitment Receive event. This event refers to the result of the recruitment action from event (33) i.e., if the person to whom the message was sent accepted the invite or declined it. Logs that a recruitment message was responded to.

 recruitmentReceive(EventTimestamp, SenderAccountId, SenderCharacterId, ReceiverAccountId, ReceiverCharacterId, RecruitmentType, RecruitmentOutcome)
        {
                "timestamp":"2013-11-15T14:37:55.545Z",
                "data":{
                        "type":34,
                        "sender_account_id":"cool_guy@example.com",
                        "sender_character_id":"Wizard",
                        "receiver_account_id":"small_cat@example.com",
                        "receiver_character_id":"Wizard",
                        "recruitment_type":"mobile ad"
                        "recruitment_outcome:"trial account"
                }
        }

Back to Top


Create Store (Event 35)

Logs a Store Create event. Some games allow players to set up in-game stores where they can sell items. This event refers to the creation of such stores.

 storeCreate(EventTimestamp, StoreId, StoreDescription, StoreAddress, StoreCity, StoreState, StoreCountry, StoreZip)
        {
                "timestamp":"2013-11-15T15:03:32.064Z",
                "data":{
                        "type":35,
                        "store_id":8729,
                        "store_desc":"the cool store", 
                        "map_real_address":"123 Fake St", 
                        "map_real_city":"Walla Walla", 
                        "map_real_state":"Tuvalu", 
                        "map_real_country":"United States", 
                        "map_real_postal_code":"55667"
                }
        }

Back to Top


Delete Store (Event 36)

Logs a Store Delete event. This event refers to scenarios where the stores from event (35) are deleted.

 storeDelete(EventTimestamp, StoreId, StoreDescription, StoreAddress, StoreCity, StoreState, StoreCountry, StoreZip)
        {
                "timestamp":"2013-11-15T15:11:15.847Z",
                "data":{
                        "type":36,
                        "store_id":8729
                }
        }

Back to Top


Buy Store Item (Event 37)

Logs a Store Buy Item event. This event refers to transactions which involve items which are bought from a store. This includes information about the type of currency which is used to buy these items i.e., real world currency or virtual currency.

 storeBuyItem(EventTimestamp, StoreId, AccountId, CharacterId, ShardId, ReceiverAccountId, ReceiverCharacterId, ItemId, ItemName, ItemPrice, CurrencyType, VirtualCurrencyLabel, CurrencyValue, VirtualCurrencyCount)
        {
                "timestamp":"2013-11-15T15:18:44.377Z",
                "data":{
                        "type":37,
                        "sender_account_id":"cool_guy@example.com",
                        "sender_character_id":"Wizard",
                        "receiver_account_id":"small_cat@example.com",
                        "receiver_character_id":"Wizard",
                        "shard_id":42,
                        "store_id":1,
                        "item_id":66,
                        "item_name":"The Blaster Gun",
                        "item_price":3,
                        "currency_type":1,
                        "virtual_currency_label":"MCH",
                        "currency_value”:”4”,
                        "virtual_currency_count”:1
                }
        }

Optional parameters: shard_id, virtual_currency_name, virtual_currency_count

Sample Use

Example: If you had $1 per 100 tokens, and you bought an item for 200 tokens, you will send:

Item Price: 200
Currency Type: 1
Virtual Currency Name: Tokens
Currency Value: 2
Virtual Currency Count: 200

Example: If a user buys an item using $5 in real money then send:

Item Price: 5
Currency Type: 0
Virtual Currency Name: (null)
Currency Value: 5
Virtual Currency Count: 0

Example: If a user buys an item for 500 tokens send:

Item Price: 500
Currency Type: 1
Virtual Currency Name: Tokens
Currency Value: 0
Virtual Currency Count: 500

Back to Top


Store Login (Event 38)

Logs a Store Login event. The time at which a player logs into a virtual store. Logs a store login occurrence.

 storeLogin(EventTimestamp, StoreId, AccountId, CharacterId, ShardId)
        {
                "timestamp":"2013-11-15T15:31:43.299Z",
                "data":{
                        "type":38,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42,
			"store_id":1
                }
        }

Optional parameters: shard_id

Back to Top


Store Logout (Event 39)

Logs a Store Logout event. The time at which a player logs out from a virtual store. Logs a store logout occurrence.

 storeLogout(EventTimestamp, StoreId, AccountId, CharacterId, ShardId)
        {
                "timestamp":"2013-11-15T15:31:43.299Z",
                "data":{
                        "type":39,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42,
                        "store_id":1
                }
        }

Optional parameters: shard_id

Back to Top


Store Add to Cart (Event 40)

Logs a Store Add To Cart event. This event refers to the case when the user adds an item to his/her cart. It should be noted that this event is not the same as buying an item but it is only about selecting an item. In some games selection may be a prerequisite for buying an item. Logs an add to cart event.

 storeAddToCart(EventTimestamp, StoreId, AccountId, CharacterId, ItemId, ItemName, ItemType)
        {
                "timestamp":"2013-11-15T16:01:45.370Z",
                "data":{
                        "type":40,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "store_id":1,
                        "item_id":66,
                        "item_name":"Sword",
                        "item_type":"Weapon"
                }
        }

Back to Top


Enter Guild (Event 41)

Logs a Guild Enter event. Guilds are analogous to organizations in many online games. This event records information regarding when a player becomes part of a guild and if he/she is the leader of the guild.

 logEnterGuild(EventTimestamp, AccountId, CharacterId, ShardId, GuildId, CharacterLevel)
        {
                "timestamp":"2013-11-15T16:21:24.890Z",
                "data":{
                        "type":41,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "character_lvl":52,
                        "shard_id":1,
                        "guild_id":42
                }
        }

Optional parameters: shard_id

Back to Top


Exit Guild (Event 42)

Logs a Guild Exit event. The event records information regarding exiting a guild (see event 41) and the reason for leaving a guild e.g., leaving voluntarily, being evicted etc

 logExitGuild(EventTimestamp, AccountId, CharacterId, ShardId, GuildId, CharacterLevel, ExitReason)
        {
                "timestamp":"2013-11-15T16:21:24.890Z",
                "data":{
                        "type":42,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "character_lvl":52,
                        "shard_id":1,
                        "guild_id":42,
                        "guild_exit_reason":"hacking"
                }
        }

Optional parameters: shard_id

Back to Top


Add Friend (Event 43)

Logs a Friend Addition event. Many online games also allow adding other players as friends. This event captures information about friending other players. It should be noted that this relationship may or may not be reciprocated.

  logFriendAdd(EventTimestamp, AccountId, CharacterId, ReceiverAccountId, ReceiverCharacterId)
        {
                "timestamp":"2013-11-15T17:35:00.091Z",
                "data":{
                        "type":43,
                        "sender_account_id":"cool_guy@example.com",
                        "sender_character_id":"Wizard",
                        "receiver_account_id":"small_cat@example.com",
                        "receiver_character_id":"Wizard"
                }
        }

Back to Top


Delete Friend (Event 44)

Logs a Friend Delete event. This event captures information about the end of a friend relationship (see event 43)

 logFriendDelete(EventTimestamp, AccountId, CharacterId, ReceiverAccountId, ReceiverCharacterId)
        {
                "timestamp":"2013-11-15T17:35:00.091Z",
                "data":{
                        "type":44,
                        "sender_account_id":"cool_guy@example.com",
                        "sender_character_id":"Wizard",
                        "receiver_account_id":"small_cat@example.com",
                        "receiver_character_id":"Wizard"
                }
        }

Back to Top


Guild Leader (Event 45)

Logs a Guild Leader event. Information regarding whether the player is the leader of the guild with the given guild id.

 putGuildLeader(EventTimestamp, AccountId, CharacterId, GuildId)
        {
                "timestamp":"2013-11-15T17:45:12.627Z",
                "data":{
                        "type":45,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "guild_id":777
                }
        }

Back to Top


!!!! UGC Copy (Event 46) - To Be Completed. Logs a UGC Copy event. Information regarding copying of an item that was created by a player. This event is not applicable to items that are built in by the gaming company. Tracks when User Generated Content is copied to another account. [ trackUgcCopy(EventTimestamp, AccountId, CharacterId, ShardId, ItemId, ItemName) { "timestamp":"2013-11-15T17:50:53.188Z", "data":{ "type":46, "account_id":"cool_guy@example.com",

                        "character_id":"Wizard",
                        "shard_id":42.42,
                        "item_id":8729,

"item_name":"GMO Grain" } } ] Optional parameters: shard_id Back to Top ---- !!!! Farmer (Event 47) - To Be Completed Logs a Farmer event. Indicates whether the player is a gold farmer and if so what type of gold farmer is he [ logFarmer(EventTimestamp, AccountId, CharacterId, ShardId, FarmerType) { "timestamp":"2013-11-15T17:55:57.747Z", "data":{ "type":47, "account_id":"cool_guy@example.com", "character_id":"Wizard", "shard_id":52, "farmer_type":"Banker" } } ] Optional parametesr: shard_id Back to Top ---- !!!! Integrity (Event 48) - To Be Completed Logs an Integrity event. Indicates whether this account was compromised and if so when was this account compromised and the type of integrity violation that resulted in compromising this account. [ logIntegrity(EventTimestamp, AccountId, CharacterId, ShardId, IntegrityType)

        {

"timestamp":"2013-11-15T17:55:57.747Z", "data":{ "type":48, "account_id":"cool_guy@example.com", "character_id":"Wizard", "shard_id":52, “integrity_type":"Banker"

                }

} ] Optional parameters: shard_id Back to Top ---- !!!! Reward (Event 49) - To Be Completed. Logs a Reward event. Relates to where a player may be awarded a certain reward for completing a certain task or a reward given based on seniority or some other reason. [ logReward(EventTimestamp, AccountId, CharacterId, ShardId, RewardType, RewardId, ItemType, RewardCount) { "timestamp":"2013-11-15T18:07:14.132Z", "data":{ "type":49, "account_id":"cool_guy@example.com", "character_id":"Wizard", "shard_id":42.42, "reward_type":1, "reward_id":"1", "item_type":2, "reward_count":50.5 } } ] Optional parameters: shard_id, item_type Back to Top ----

Area DIM (Event 50)

Logs a Area DIM event. Some games have maps associated with them. This event saves the dimension information about these maps.

 logAreaDim(EventTimestamp, AreaName, AreaId, MapId, MapName, MinX, MinY, MinZ, MaxX, MaxY, MaxZ)
        {
                "timestamp":"2013-11-15T18:13:04.432Z",
                "data":{
                        "type":50,
                        "area_name":"NA",
                        "area_id":2.2,
                        "map_id":-1,
                        "map_label":"map label",
                        "min_x":0,
                        "min_y":0,
                        "min_z":0,
                        "max_x":4,
                        "max_y":5,
                        "max_z":6
                }
        }

Optional parameters: min_z, max_z

Back to Top


!!!! Mob (Event 51) - To Be Completed Logs a Mob event. Mob refers to groupings of non-player characters (NPCs). This event captures the cases when the player confronts a mobs and kills that mob. This event captures the cases when the player confronts a mob and kills that mob. [ logMob(EventTimestamp, AccountId, CharacterId, ShardId, MobDescription) { "timestamp":"2013-11-15T18:18:12.933Z", "data":{ "type":51, "account_id":"cool_guy@example.com", "character_id":"Wizard", "shard_id":42.42, "mob_desc”:”mob_desc" } } ] Optional parameters: shard_id, mob_description Back to Top ---- !!!! CRM Action (Event 52) - To Be Completed. Logs a CRM Action event. This is generic field for CRM (Customer Relationship management) action that may be taken by a CRM person in the gaming company. Information regarding how the customer responded to the action is also saved [ logCrmAction(EventTimestamp, AccountId, CharacterId, ShardId, CrmAction, CrmActionType, FulfillmentTimestamp, FulfillmentStatus) { "timestamp":"2013-11-15T18:23:20.079Z", "data":{ "type":52, "account_id":"cool_guy@example.com", "character_id":"Wizard", "shard_id":42.42, "crm_action":"crm_action", "crm_action_type":"crm_action_type", “crm_fulfilled_timestamp":"2013-08-12T05:00:00.000Z”, "crm_fulfilled_status":"crm_fulfilled_status" } } ] Optional parameters: shard_id, crm_fulfillment_status, crm_fulfillment_timestamp Back to Top ---- !!!! Customer Service Action (Event 53) - To Be Completed. Logs a Customer Service Action event. This event captures all the events which are not described in any of the other events but still events which are within the game. [ logCustomerServiceAction(EventTimestamp, AccountId, CharacterId, ShardId, CsAction, CsActionType) { "timestamp":"2013-11-15T18:29:07.797Z", "data":{ "type":53, "account_id":"cool_guy@example.com", "character_id":"Wizard", "shard_id":42.42, "customer_service_action":"cs_action", "customer_service_action_type":"cs_action_type" } } ] Optional parameters: shard_id Back to Top ----

Custom Action (Event 54)

Logs a Custom Action event. This event captures all the events which are not described in any of the other events and the events are not with respect to actions in the game. Any Ninja Metrics customer has the freedom to define this event in any way that they want given the fields described here.

 logCustomAction(EventTimestamp, AccountId, CharacterId, CustomAction, CustomActionType, CustomActionValue)
        {
                "timestamp":"2013-11-15T18:35:36.006Z",
                "data":{
                        "type":54,
                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "custom_action":"custom_action",
                        "custom_action_type":"custom_action_type",
                        "custom_action_value":"custom_action_value"
                }
        }

Back to Top


!!!! Productivity (Event 55) - To Be Completed Logs a Productivity event. This event refers to a scenario where any time a player crafts, harvests etc an item within the game. [ logProductivity(EventTimestamp, AccountId, CharacterId, ShardId, ProductivityType) { "timestamp":"2013-11-15T18:42:06.056Z", "data":{ "type":55,

                        "account_id":"cool_guy@example.com",
                        "character_id":"Wizard",
                        "shard_id":42.42,

"productivity_type":"productivity_type" }

        }

] Optional parameters: shard_id Back to Top ---- !!!! Resource (Event 56) - To Be Completed. Logs a Resource event. Refers to events where any time a player acquires a non-item resource, e.g. coins, gold, power, etc. [ logResource(EventTimestamp, AccountId, CharacterId, ShardId, ResourceType, ResourceId, ResourceCount) { "timestamp":"2013-11-15T18:47:39.266Z", "data":{ "type":56, "account_id":"cool_guy@example.com", "character_id":"Wizard", "shard_id":42.42, "resource_type":0, "resource_id":"1", "resource_count":3 } } ] Optional parameters: shard_id Back to Top ---- !!!! Account Ad (Event 57) - To Be Completed. Logs an Account Ad event - This event is a record of the user who either clicks an ad or had already clicked the ad and then taking some subsequent action. [ logAccountAd(EventTimestamp, AccountId, AdTagName, ActionTimestamp) { "timestamp":"2013-11-15T18:52:37.557Z", "data":{ "type":57, "account_id":"cool_guy@example.com", "ad_tag_name":"Ad-Words", "ad_action_timestamp":"2013-08-12T05:00:00.000Z" } } ] Optional parameters: ad_tag_name, action_timestamp Back to Top ---- !!!! Economic (Event 58) - To Be Completed. Logs a Economic event - This item refers TO Economic Type: Buy item, Sell item, Trade away item, Trade acquire item, Create item. [ logEconomic(EventTimestamp, SenderAccountId, SenderCharacterId, ReceiverAccountId, ReceiverCharacterId, ShardId, ItemId, ItemName, EconomicType, EconomicValue, CurrencyType, VirtualCurrencyLabel, CurrencyValue, VirtualCurrencyCount) { "timestamp":"2013-11-15T18:58:59.893Z",

                "data":{

"type":58,

                        "sender_account_id":"cool_guy@example.com",
                        "sender_character_id":"advertiser",
                        "receiver_account_id":"cguy@aol.com",
                        "receiver_character_id":"customer",
                        "shard_id":1,
                        "item_id":124606,

"item_name":"Rebate for 124606", "economic_type":"rebate", "economic_value":52.281000000000006,

                        “currency_type":0,
                        "virtual_currency_label":"",
                        "currency_value":52.281000000000006,
                        “virtual_currency_count”:”1”

}

        }

] Optional parameters: shard_id, virtual_currency_label_ virtual_currency_count Back to Top ----

Traffic (Event 59)

Logs a Traffic Source event.

 logTrafficSource(EventTimestamp, AccountId, TrafficSource, ShardId, TrafficSourceType)
Example JSON payload: 
        {
                "timestamp":"2013-11-15T19:07:30.221Z",
                "data":{
                        "type":59,
                        "account_id":"cool_guy@example.com",
                        "traffic_source":"campaign_name | sub_site | publisher_name | sub_publisher",
                        "shard_id":0,
                        "traffic_source_type":"publisher_name"
                }
        }

==== {

                "timestamp":"2013-11-15T19:07:30.221Z",
                "data":{

"type":59, "account_id":"cool_guy@example.com", "traffic_source":"abcTrafficSource", "shard_id":42.42, "traffic_source_type":"traffic_source_type" } }

Optional parameters: shard_id

Back to Top