|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.facebook.InsightsLogger
public class InsightsLogger
The InsightsLogger class allows the developer to log various types of events back to Facebook. In order to log
events, the app must create an instance of this class via a newLogger
method, and then call
the various "log" methods off of that. Note that a Client Token for the app is required in calls to newLogger so
apps that have not authenticated their users can still get meaningful user-demographics from the logged events
on Facebook.
Method Summary | |
---|---|
void |
logConversionPixel(String pixelId,
double valueOfPixel)
Log, or "Fire" a Conversion Pixel. |
void |
logPurchase(BigDecimal purchaseAmount,
Currency currency)
Logs a purchase event with Facebook, in the specified amount and with the specified currency. |
void |
logPurchase(BigDecimal purchaseAmount,
Currency currency,
Bundle parameters)
Logs a purchase event with Facebook, in the specified amount and with the specified currency. |
static InsightsLogger |
newLogger(Context context,
String clientToken)
Build an InsightsLogger instance to log events through. |
static InsightsLogger |
newLogger(Context context,
String clientToken,
String applicationId)
Build an InsightsLogger instance to log events through. |
static InsightsLogger |
newLogger(Context context,
String clientToken,
String applicationId,
Session session)
Build an InsightsLogger instance to log events through. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static InsightsLogger newLogger(Context context, String clientToken)
context
- Used to access the applicationId and the attributionId for non-authenticated users.clientToken
- The Facebook app's "client token", which, for a given appid can be found in the Security
section of the Advanced tab of the Facebook App settings found
at public static InsightsLogger newLogger(Context context, String clientToken, String applicationId)
context
- Used to access the attributionId for non-authenticated users.clientToken
- The Facebook app's "client token", which, for a given appid can be found in the Security
section of the Advanced tab of the Facebook App settings found
at applicationId
- Explicitly specified Facebook applicationId to log events against. If null, the
applicationId embedded in the application metadata accessible from 'context' will
be used.
public static InsightsLogger newLogger(Context context, String clientToken, String applicationId, Session session)
context
- Used to access the attributionId for non-authenticated users.clientToken
- The Facebook app's "client token", which, for a given appid can be found in the Security
section of the Advanced tab of the Facebook App settings found
at applicationId
- Explicitly specified Facebook applicationId to log events against. If null, the
applicationId embedded in the application metadata accessible from 'context' will
be used.session
- Explicitly specified Session to log events against. If null, the activeSession
will be used if it's open, otherwise the logging will happen via the "clientToken"
and specified appId.
public void logPurchase(BigDecimal purchaseAmount, Currency currency)
purchaseAmount
- Amount of purchase, in the currency specified by the 'currency' parameter. This value
will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346).currency
- Currency used to specify the amount.public void logPurchase(BigDecimal purchaseAmount, Currency currency, Bundle parameters)
purchaseAmount
- Amount of purchase, in the currency specified by the 'currency' parameter. This value
will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346).currency
- Currency used to specify the amount.parameters
- Arbitrary additional information for describing this event. Should have no more than
10 entries, and keys should be mostly consistent from one purchase event to the next.public void logConversionPixel(String pixelId, double valueOfPixel)
pixelId
- Numeric ID for the conversion pixel to be logged. See
https://www.facebook.com/help/435189689870514 to learn how to create a conversion pixel.valueOfPixel
- Value of what the logging of this pixel is worth to the calling app. The currency that this
is expressed in doesn't matter, so long as it is consistent across all logging for this
pixel. This value will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |