Contents
Setup
Download the SDK from: https://github.com/cooladata/cooladata-actionscript
Flash Development
- Add the cooladata-sdk-ac3-x.x.x.swc to the lib folder of your project.
- Right-click the file and choose “Add To Library”.
Adobe CS4 (and above)
- Save the cooladata-sdk-ac3-x.x.x.swc in a folder that is accessible to CS4.
- Go to the Publish Settings menu.
- Click on the Settings button.
- Click on the SWC file icon.
- Browse to the location of the cooladata-sdk-ac3-x.x.x.swc file.
- Select the cooladata-sdk-ac3-x.x.x.swc file.
In order to use CoolaDataTracker SDK for reporting events, it must be initialized first using the setup method:
CoolaDataTracker .getInstance() .setup(apiToken:String,serviceEndPoint:String,userId:String,sessionId:String);
Example:
CoolaDataTracker .getInstance() .setup("3r783b097dde47b592cd48697073b6dc" ,"https://api.cooladata.com" , "uid_12345","sid_12345");
Sending Events
After the Cooladata Tracker SDK is properly set up, you are ready to report events from your application. To start doing so, you need to call the trackEvent function with suitable parameters on every user’s action that you would like to track.
Example:
var paramsDictionary:Dictionary = new Dictionary(); paramsDictionary["paramName"] = "paramValue";
CoolaDataTracker.getInstance().trackEvent(eventNameTextInput.text, null, null, paramsDictionary, null, null);
Sending Event with Parameters:
var paramsDictionary:Dictionary = new Dictionary(); paramsDictionary["paramName"] = "paramValue"; CoolaDataTracker.getInstance().trackEvent(eventNameTextInput.text, null, null, paramsDictionary, null, null);
Parameters Descriptions:
Parameter Name Type Mandatory Description
eventName String Yes The name of the event to report.
userId String Yes The User ID relevant for this event. You must provide the userId either in the setup method or in the trackEvent method. This parameter is optional only if provided in the setup method.
sessionId String No The Session ID relevant for this event.
eventId String No An ID of the event.
dictionary Dictionary No The custom properties to be sent with the event.
callBackFunction Boolean No A CoolaDataDeliveryResult type result that will be returned when the data is sent.