API

Have feedback or questions on this section? Just click the Help tab on the right side of your screen.

API/Code/EventMetrics

Contents

Quick Links

Enable Api Access

AppMetrics API

AppInfo API

EventMetrics API

The EventMetrics API allows you to request information about your Events

Making a request


Requests could have the following forms:

1) http://api.flurry.com/eventMetrics/Summary?apiAccessCode=APIACCESSCODE
&apiKey=APIKEY&startDate=STARTDATE&endDate=ENDDATE&versionName=VERSIONNAME


This will return a list of all events for the specified application with the following information for each:

Event Name The name of the event.
Users Last Day Total number of unique users for the last complete day.
Users Last Week Total number of unique users for the last complete week.
Users Last Month Total number of unique users for the last complete month.
Avg Users Last Day* The average of the number of unique users for each day in the interval.
Avg Users Last Week* The average of the number of unique users for each week in the interval.
Avg Users Last Month* The average of the number of unique users for each month in the interval.
Total Counts Total number of time the event occurred.
Total Sessions Total number of sessions.

* There is no guarantee of uniqueness of users for each period. For example, a unique user counted on day 1 could be counted again on day 2 if he uses the app on both days.

2) http://api.flurry.com/eventMetrics/Event?
apiAccessCode=APIACCESSCODE&apiKey=APIKEY&startDate=STARTDATE&endDate=ENDDATE&eventName=EVENTNAME
&versionName=VERSIONNAME


The metrics returned are:

Unique Users Total number of unique users.
Total Sessions Total number of sessions.
Total Count Total number of time the event occurred.
Duration Total Duration of the event (Will be displayed only if the event is timed).
Parameters This will return a list of key/values. The key is the name of the parameter.
The values have the following metrics: name (the event name) and totalCount (the number of sessions).

APIACCESSCODE is the unique code given to you to access Flurry APIs. This can be found by logging into the Flurry website or contacting support.

EVENTNAME is the unique event name you gave the event. </br></br> APIKEY is the unique code for each application. This can be found by logging into the Flurry website or contacting support.

STARTDATE and ENDDATE should be in YYYY-MM-DD format.

VERSIONNAME, an optional parameter, is the name set by the developer for each version of the application. This can be found by logging into the Flurry website or contacting support.

Response format


Flurry APIs current support two output formats: XML and JSON.

The format of the response data depends on the value of the Accept header you send in the HTTP request. If you specify "application/xml" you will receive an XML-formatted response similar to the following:

1) FOR SUMMARY:

<eventMetrics type="Summary" version="1.0" generatedDate="3/1/10 2:10 PM" 
        versionName="1.0" startDate="2010-03-01" endDate="2010-04-15">
	<event eventName="Logout" usersLastDay="123" usersLastWeek="123" 
          usersLastMonth="123" avgUsersLastDay="123" 
          avgUsersLastWeek="123" avgUsersLastMonth="123" 
          totalCount="123" totalSessions="123"/>
	<event eventName="OnClick" usersLastDay="123" usersLastWeek="123" 
          usersLastMonth="123" avgUsersLastDay="123" 
          avgUsersLastWeek="123" avgUsersLastMonth="123" 
          totalCount="123" totalSessions="123"/>
	...
</eventMetrics>


If you specify "application/json" you will receive a JSON-formatted response similar to the following.

{"@type":"Summary",
 "@version":"1.0",
 "@generatedDate":"3/1/10 2:10 PM",
 "@startDate":"2010-03-01",
 "@endDate":"2010-04-15",
 "@versionName":"1.0",
 "event":[{"@eventName":"Logout",
 		 "@usersLastDay":"123", 
 		 "@usersLastWeek":"123", 
 		 "@usersLastMonth":"123", 
		 "@avgUsersLastDay":"123", 
 		 "@avgUsersLastWeek":"123", 
 		 "@avgUsersLastMonth":"123"
 		 "@totalCount":"123",
 		 "@totalSessions":"123",
 		 "@date":"2010-03-01"},
        {"@eventName":"OnClick",
                 "@usersLastDay":"123", 
 		 "@usersLastWeek":"123", 
 		 "@usersLastMonth":"123", 
		 "@avgUsersLastDay":"123", 
 		 "@avgUsersLastWeek":"123", 
 		 "@avgUsersLastMonth":"123"
 		 "@totalCount":"123",
 		 "@totalSessions":"123",
 		 "@date":"2010-03-02"},
 		 ...
		]
}


In both cases, you retrieve some top level attributes:

  • type - The purpose of your call. ('Revenue' or 'Campaign')
  • version - The version of this response format.
  • generatedDate - The date when the response was generated.
  • startDate - The start date of the report.
  • endDate - The end date of the report.
  • versionName - The name of the version of the application.

2) FOR EVENT:

<eventMetrics type="Event" versionName="1.0" eventName="Logout" version="1.0" 
        generatedDate="3/1/10 2:10 PM" startDate="2010-03-01" 
        endDate="2010-04-15">
	<day date="2010-03-01" totalSessions="123" totalCount="123" 
          duration="123"/>
	<day date="2010-03-02" totalSessions="123" totalCount="123" 
          duration="123"/>
 
	...
	<parameters>
	   <key name="domain">
	      <value name="p.com" totalCount="3"/>
	      <value name="dd.com" totalCount="3"/>
	   </key>
	   <key name="test">
	      <value name="hello" totalCount="3"/>
	      <value name="hey" totalCount="3"/>
	   </key>
	</parameters>
</eventMetrics>


If you specify "application/json" you will receive a JSON-formatted response similar to the following.

{"@type":"Event",
 "@version":"1.0",
 "@generatedDate":"3/1/10 2:10 PM",
 "@startDate":"2010-03-01",
 "@endDate":"2010-04-15",
 "@eventName":"Logout",
 "@versionName":"1.0",
 "day":[{"@totalSessions":"123", 
 		 "@totalCount":"123", 
 		 "@duration":"123", 
 		 "@revenue":"123"},
        {"@totalSessions":"123", 
 		 "@totalCount":"123", 
 		 "@duration":"123", 
 		 "@date":"2010-03-02"},
 		 ...
		],
 "parameters":[{"key":
	[{"@name":"domain", 
	  "value":[{"@name":"p.com", 
	  		   "@totalCount":"3"},
  		       {"@name":"dd.com", 
  			    "@totalCount":"3"},
  			...
	  	]  
	   }, 
	  {"@name":"test", 
	   "value":[{"@name":"hello", 
		  		"@totalCount":"3"}, 
	  		   {"@name":"hey", 
	  			"@totalCount":"3"},
	  			...
		  	]
	   }, 
	   ...
	 ]
	}
   ]
}


In both cases, you retrieve some top level attributes:

  • type - The purpose of your call. ('Revenue' or 'Campaign')
  • version - The version of this response format.
  • generatedDate - The date when the response was generated.
  • startDate - The start date of the report.
  • endDate - The end date of the report.
  • eventName - The name of the event.
  • versionName - The name of the version of the application.

Error codes


If something is wrong with the request or if there is a system problem, you will receive an error response instead of the expected response. This is signified by an HTTP response code other than 200 (OK) and is accompanied by content similar to the following:

<error>
	<code>100</code>
	<message>API Key not found</message>
</error>


If you receive one of these errors and are unable to determine the cause from the message provided, please contact Flurry support (support@flurry.com) along with the error code you receive.

In some cases, a system error will occur that prevents even an error message from being returned. In these cases you will receive a 500 server failure response code.