Packageyourminis.api
Classpublic class Reporting
Implementsyourminis.api.IReporting

The Reporting class exposes widget tracking APIs to your widget. View and Interaction tracking are handled automatically by the container.


Example
The following code tracks a URL
 var widget = ...
 widget.reporting.trackURL("http://www.yourminis.com");

See also

Widget.reporting
http://www.yourminis.com/partners/analyze.aspx


Public Properties
 PropertyDefined by
  trackdata : XML
[read-only] Read-only access to the tracking data as a result of the call getTrackData();
Reporting
Public Methods
 MethodDefined by
  
Get user-specific tracking data including username, ipaddress, and geolocation information:
Reporting
  
trackClick(x:Number, y:Number, w:Number, h:Number):void
Used to track clicks within the widget.
Reporting
  
trackCopy(destination:String):void
Used to track the copying of a widget to a destination This is automatically called from the syndication panel.
Reporting
  
trackCustom(path:String, param:String = ""):void
Used to track custom actions within the widget
Reporting
  
Used to track the start of widget interaction by the user.
Reporting
  
trackURL(url:*, target:String = "_blank", track:Boolean = true, navigate:Boolean = true):void
Used to both track URLs within a widget and/or navigate the user to the URL in the browser.
Reporting
Public Constants
 ConstantDefined by
  REPORT_ONCLICK : String = "report-onclick"
Reporting
  REPORT_ONCOPY : String = "report-oncopy"
Reporting
  REPORT_ONGETURL : String = "report-ongeturl"
Reporting
  REPORT_ONINTERACTION : String = "report-oninteraction"
Reporting
  REPORT_ONVIEW : String = "report-onview"
Reporting
  REPORT_TRACKDATA : String = "report-trackdata"
Reporting
Property detail
trackdataproperty
trackdata:XML  [read-only]

Read-only access to the tracking data as a result of the call getTrackData();

Implementation
    public function get trackdata():XML

See also

Method detail
getTrackingData()method
public function getTrackingData():void

Get user-specific tracking data including username, ipaddress, and geolocation information:

See also


Example
The following is an example of how to get user tracking information
  var widget = ...
  
  function onTrackData(evt:Event)
  {
   var trackdata:XML = evt.target.reporting.trackdata;
   
   var ipaddress = trackdata.net.ipaddress;
   
   ...
  }
  
  widget.addEventListener(widget.reporting.REPORT_TRACKDATA,onTrackData);
  widget.reporting.getTrackingData();
 

Example xml response
<tracking>
 <user><loginname>yourminis/jeremy</loginname></user>
 <i18n><lang>en-us</lang><lang>en</lang></i18n>
 <net><ipaddress>192.168.1.101</ipaddress></net>
 <geo>
     <country code='US'>United States</country>
     <region>CT</region>
     <city>Fairfield</city>
     <lat>41.1854</lat>
     <long>-73.2645</long>
     <postalcode></postalcode>
     <areacode>203</areacode>
     <dmacode>501</dmacode>
 </geo>
</tracking>

trackClick()method 
public function trackClick(x:Number, y:Number, w:Number, h:Number):void

Used to track clicks within the widget. Called automatically whenever the mouse is clicked over the widget (link, button, etc).

Parameters
x:Number
 
y:Number
 
w:Number
 
h:Number

See also

trackCopy()method 
public function trackCopy(destination:String):void

Used to track the copying of a widget to a destination This is automatically called from the syndication panel. If your widget allows custom copying, then you can use this method to track it.

Parameters
destination:String

See also


Example
The following code tracks a user search for "cool products"
  var widget = ...
  widget.reporting.trackCopy("some-cool-destination");
 

trackCustom()method 
public function trackCustom(path:String, param:String = ""):void

Used to track custom actions within the widget

Parameters
path:String — The unique name given for the action to track
 
param:String (default = "") — An optional parameter to record for reporting filtering/grouping of this custom action

See also


Example
The following code tracks a user search for "cool products"
  var widget = ...
  widget.reporting.trackCustom("search","cool products");
 

trackInteraction()method 
public function trackInteraction():void

Used to track the start of widget interaction by the user. This is automatically called when a user hovers over the widget.

See also


Example
The following code tracks a user search for "cool products"
  var widget = ...
  widget.reporting.trackInteraction();
 

trackURL()method 
public function trackURL(url:*, target:String = "_blank", track:Boolean = true, navigate:Boolean = true):void

Used to both track URLs within a widget and/or navigate the user to the URL in the browser. (required for external URL support in myspace.com)

Parameters
url:* — The URL to track and/or navigate to
 
target:String (default = "_blank") — An optional parameter to specify the target window name
 
track:Boolean (default = true) — An optional parameter to enable/disable tracking
 
navigate:Boolean (default = true) — An optional parameter to enable/disable browser navigation

See also


Example
The following code tracks a URL request and opens it in the user's browser
  var widget = ...
  widget.reporting.trackURL("http://www.yourminis.com/developers/");
 

The following is an example of how to add tracking of a URL without browser navigation.
  var widget = ...
  widget.reporting.trackURL("http://www.example.com/api/some-api-call",null,true,false);
 

Constant detail
REPORT_ONCLICKconstant
public const REPORT_ONCLICK:String = "report-onclick"
REPORT_ONCOPYconstant 
public const REPORT_ONCOPY:String = "report-oncopy"
REPORT_ONGETURLconstant 
public const REPORT_ONGETURL:String = "report-ongeturl"
REPORT_ONINTERACTIONconstant 
public const REPORT_ONINTERACTION:String = "report-oninteraction"
REPORT_ONVIEWconstant 
public const REPORT_ONVIEW:String = "report-onview"
REPORT_TRACKDATAconstant 
public const REPORT_TRACKDATA:String = "report-trackdata"