Actionscript Integration

Integration

Once you add the BmtSdkAS3.swc library, you need to add the following lines to the initialization code:

import bmt.sdk.BMTracker;
import bmt.sdk.ActionType;

private function init(e:Event = null):void
{
    removeEventListener(Event.ADDED_TO_STAGE, init);
    // entry point 
    
    BMTracker.AppID = "";
    //an identifier, assigned to your application;
    
    BMTracker.ConfigurationID =  "";
    //a tracking identifier, assigned to your application
    
    BMTracker.attachLoaderExceptionHandler(loaderInfo);
    // Registration of the global exception handler
    
    BMTracker.ExternalID = "user@email.com";
    // Installation of unique user identifier
    
    BMTracker.trackAction(ActionType.AT_SESSION_START);
    // Registration of the application download event
} 

Configuration

To control the working logic of Maxymizely tracking system, use these fields and methods:

Main configuration fields:

  • AppId – an identifier of the resource needed tracking
  • ConfigurationId – an identifier for user tracking
  • ExternalId – a unique user identifier (for example, an internal user ID in the database, email, login, Facebook ID, or any other information that helps identify a unique user)

Additional configuration methods:

BMTracker.sendUserAttribute(name:String, value:String)  

This method allows assigning a number of additional parameters to a user.

Event Registration

Event registration is implemented by calling the BMTracker.trackAction method in a tracker.

Parameters:

BMTracker.trackAction(actionType:uint,
// event type
                    
content:String = "",
// a description of a section/form of the tracked application

name:String  = "",
// description of the element where an event takes place

value:Number = 0,
// the value of the element, where an event takes place,
// is used for the following event types: AT_PURCHASE, AT_CHANGEELEMENT

customAttribute1:String = "",  
customAttribute2:String = "", 
customAttribute3:String = "",
// additional event parameters

referrer:String = "",
// the description of a section/form from which the transfer was made

title:String = "",
// the description of a section/form

windowId:String = ""
// the identifier of a section/form
);

A list of event values:

1.   ActionType.AT_BACKGROUNDMODEIN
2.   ActionType.AT_BACKGROUNDMODEOUT
3.   ActionType.AT_CHANGEELEMENT
4.   ActionType.AT_CHECKPOINT
5.   ActionType.AT_CLICK
6.   ActionType.AT_CLOSENOTIFICATIONWINDOW
7.   ActionType.AT_CONFIRMATION
8.   ActionType.AT_CRASH
9.   ActionType.AT_DOWNLOAD
10.  ActionType.AT_EMPTY
11.  ActionType.AT_ERROR
12.  ActionType.AT_INAPPPURCHASE
13.  ActionType.AT_INSTALL
14.  ActionType.AT_LOADPAGE
15.  ActionType.AT_LOG
16.  ActionType.AT_LOGIN
17.  ActionType.AT_NEWLEVEL
18.  ActionType.AT_OPENNOTIFICATIONWINDOW
19.  ActionType.AT_OTHER
20.  ActionType.AT_PURCHASE
21.  ActionType.AT_REGISTRATION 
22.  ActionType.AT_SEARCH
23.  ActionType.AT_SESSION_END
24.  ActionType.AT_SESSION_START
25.  ActionType.AT_SUBMIT
26.  ActionType.AT_UPLOAD
27.  ActionType.AT_VIEWELEMENT
28.  ActionType.AT_WARNING