ActionScript3 Reference
Class PlayerInsight
Namespace: playerio
Language: ActionScript 3
Provides access to the PlayerInsight services provided by Player.IO.
Properties | |||
---|---|---|---|
public |
Exposes how many unique users are currently online, as counted by PlayerInsight |
||
Methods | |||
public |
Get the value of a specific PlayerInsight segment |
||
public |
Refreshes PlayerInsight, including online and segments |
||
public |
Set segments for the current user |
||
public |
Track custom events. |
||
public |
Track payments from external payment sources. |
||
public |
Track invitation and social retention relations. Should be called when a user replies on an asynchronous action initialized by another user. |
PlayerInsight.playersOnline
public |
|
Exposes how many unique users are currently online, as counted by PlayerInsight
PlayerInsight.getSegment
public |
|
Get the value of a specific PlayerInsight segment
Arguments
segmentGroup:String | |
Segment to read. |
PlayerInsight.refresh
public |
|
Refreshes PlayerInsight, including online and segments
Arguments
callback:Function (Default = null) | |
method called when PlayerInsight has successfully refreshed | |
errorHandler:Function (Default = null) | |
method called if refreshing PlayerInsight resulted in an error |
PlayerInsight.setSegments
public |
|
Set segments for the current user
Arguments
segments:Array | |
Array of PlayerInsight segments formated as ["segment1:value", "segment2:value"] where both segment name and value is optional. | |
callback:Function (Default = null) | |
Method called when the segments have been successfully set. | |
errorHandler:Function (Default = null) | |
method called if setting segment failed. |
PlayerInsight.trackEvents
public |
|
Track custom events.
Arguments
events:Array | |
events to track, passed as an alternating array of event type and value. E.g. if the user reached level 1 and bought 3 upgrades the array would look as follows: ["level1", 1, "buy_upgrade",3] | |
callback:Function (Default = null) | |
Method called when the event has been successfully tracked. | |
errorHandler:Function (Default = null) | |
Method called if tracking the event failed. |
PlayerInsight.trackExternalPayment
public |
|
Track payments from external payment sources.
Arguments
currency:String | |
Name of currency, E.g. "USD", "FBC", etc. | |
amount:int | |
Amount of currency purcached. | |
callback:Function (Default = null) | |
Method called when the external payment has been successfully tracked | |
errorHandler:Function (Default = null) | |
Method called if the external payment failed. |
PlayerInsight.trackInvitedBy
public |
|
Track invitation and social retention relations. Should be called when a user replies on an asynchronous action initialized by another user.
Arguments
invitingUserId:String | |
The user which created the action we are responding to. | |
invitationChannel:String | |
Optional channel description, E.g. "facebook_feed" | |
callback:Function (Default = null) | |
Method called when the action has been successfully tracked. | |
errorHandler:Function (Default = null) | |
Method called if tracking the event failed. |