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]
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.
{ "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.
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.
http://api.ninjametrics.com/event?client_id=1234&app_id=5678&app_pwd=somepassword&api_client=JSON
NOTE: The order of the JSON key/value pairs is important. Changing the order will result in the request being rejected.
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
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
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
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
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
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
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
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
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
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
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
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” } }
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" } }
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
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
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
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
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
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
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
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
Please use Social Interactions Event #6 to record Player Versus Player actions.
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
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
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
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
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
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
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
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" } }
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" } }
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" } }
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 } }
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
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
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
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" } }
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
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
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" } }
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" } }
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 } }
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
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" } }
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" } }
Optional parameters: shard_id