mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,22 @@
|
||||
package libraries.uanalytics.tracker
|
||||
{
|
||||
public class DataSource
|
||||
{
|
||||
|
||||
public static const WEB:String = "web";
|
||||
|
||||
public static const APP:String = "app";
|
||||
|
||||
public static const DESKTOP:String = "desktop";
|
||||
|
||||
public static const MOBILE:String = "mobile";
|
||||
|
||||
public static const COMMAND_LINE:String = "commandline";
|
||||
|
||||
public function DataSource()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,432 @@
|
||||
package libraries.uanalytics.tracker
|
||||
{
|
||||
import flash.system.ApplicationDomain;
|
||||
import flash.utils.Dictionary;
|
||||
import libraries.uanalytics.tracker.senders.LoaderHitSender;
|
||||
import libraries.uanalytics.tracking.Configuration;
|
||||
import libraries.uanalytics.tracking.HitModel;
|
||||
import libraries.uanalytics.tracking.HitSampler;
|
||||
import libraries.uanalytics.tracking.RateLimitError;
|
||||
import libraries.uanalytics.tracking.RateLimiter;
|
||||
import libraries.uanalytics.tracking.Tracker;
|
||||
import libraries.uanalytics.utils.generateUUID;
|
||||
import libraries.uanalytics.utils.getHostname;
|
||||
|
||||
public class DefaultTracker extends Tracker
|
||||
{
|
||||
|
||||
public function DefaultTracker(param1:String = "", param2:Configuration = null)
|
||||
{
|
||||
super();
|
||||
if(!param2)
|
||||
{
|
||||
param2 = new Configuration();
|
||||
}
|
||||
_config = param2;
|
||||
_ctor(param1);
|
||||
}
|
||||
|
||||
protected function _ctor(param1:String = "") : void
|
||||
{
|
||||
var _loc2_:Class = null;
|
||||
_model = new HitModel();
|
||||
_temporary = new HitModel();
|
||||
if(_config.senderType != "")
|
||||
{
|
||||
_loc2_ = ApplicationDomain.currentDomain.getDefinition(_config.senderType) as Class;
|
||||
_sender = new _loc2_(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
_sender = new LoaderHitSender(this);
|
||||
}
|
||||
_limiter = new RateLimiter(100,10);
|
||||
if(param1 != "")
|
||||
{
|
||||
set("trackingId",param1);
|
||||
}
|
||||
var _loc3_:String = _getClientID();
|
||||
if(_loc3_ != "")
|
||||
{
|
||||
set("clientId",_loc3_);
|
||||
}
|
||||
}
|
||||
|
||||
protected function _getClientID() : String
|
||||
{
|
||||
return generateUUID();
|
||||
}
|
||||
|
||||
protected function _getCacheBuster() : String
|
||||
{
|
||||
var _loc1_:Date = new Date();
|
||||
var _loc2_:Number = Math.random();
|
||||
return String(_loc1_.valueOf() + _loc2_);
|
||||
}
|
||||
|
||||
override public function send(param1:String = null, param2:Dictionary = null) : Boolean
|
||||
{
|
||||
if(trackingId == "" || trackingId == null)
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("tracking id is missing.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(clientId == "" || clientId == null)
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("client id is missing.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var _loc5_:HitModel = _model.clone();
|
||||
_loc5_.add(_temporary);
|
||||
_temporary.clear();
|
||||
if(param2 != null)
|
||||
{
|
||||
for(var _loc3_:String in param2)
|
||||
{
|
||||
_loc5_.set(_loc3_,param2[_loc3_]);
|
||||
}
|
||||
}
|
||||
if((param1 != "" || param1 != null) && HitType.isValid(param1))
|
||||
{
|
||||
_loc5_.set("hitType",param1);
|
||||
if(_config && _config.enableSampling)
|
||||
{
|
||||
if(HitSampler.isSampled(_loc5_,String(_config.sampleRate)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(_config && _config.enableThrottling)
|
||||
{
|
||||
if(!_limiter.consumeToken())
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new RateLimitError();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(_config && _config.enableCacheBusting)
|
||||
{
|
||||
_loc5_.set("cacheBuster",_getCacheBuster());
|
||||
}
|
||||
if(_config && _config.anonymizeIp)
|
||||
{
|
||||
_loc5_.set("anonymizeIp","1");
|
||||
}
|
||||
if(_config && _config.overrideIpAddress != "")
|
||||
{
|
||||
_loc5_.set("ipOverride",_config.overrideIpAddress);
|
||||
}
|
||||
if(_config && _config.overrideUserAgent != "")
|
||||
{
|
||||
_loc5_.set("userAgentOverride",_config.overrideUserAgent);
|
||||
}
|
||||
if(_config && _config.overrideGeographicalId != "")
|
||||
{
|
||||
_loc5_.set("geographicalOverride",_config.overrideGeographicalId);
|
||||
}
|
||||
var _loc4_:Error = null;
|
||||
try
|
||||
{
|
||||
_sender.send(_loc5_);
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
_loc4_ = e;
|
||||
}
|
||||
if(_config && _config.enableErrorChecking && _loc4_)
|
||||
{
|
||||
throw _loc4_;
|
||||
}
|
||||
if(_loc4_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("hit type \"" + param1 + "\" is not valid.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
override public function pageview(param1:String, param2:String = "") : Boolean
|
||||
{
|
||||
if(param1 == null || param1 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("path is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var _loc4_:Dictionary = new Dictionary();
|
||||
_loc4_["documentPath"] = param1;
|
||||
if(param2 && param2.length > 0)
|
||||
{
|
||||
if(param2.length > 1500)
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("Title is bigger than 1500 bytes.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
_loc4_["documentTitle"] = param2;
|
||||
}
|
||||
var _loc3_:String = get("documentHostname");
|
||||
if(_loc3_ == null)
|
||||
{
|
||||
if(!("documentHostname" in _loc4_))
|
||||
{
|
||||
_loc3_ = getHostname();
|
||||
if(_loc3_ == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("hostname is not defined.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
_loc4_["documentHostname"] = _loc3_;
|
||||
}
|
||||
}
|
||||
return send("pageview",_loc4_);
|
||||
}
|
||||
|
||||
override public function screenview(param1:String, param2:Dictionary = null) : Boolean
|
||||
{
|
||||
if(param1 == null || param1 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("name is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var _loc5_:Dictionary = new Dictionary();
|
||||
if(param2 != null)
|
||||
{
|
||||
for(var _loc3_:String in param2)
|
||||
{
|
||||
_loc5_[_loc3_] = param2[_loc3_];
|
||||
}
|
||||
}
|
||||
var _loc4_:String = get("appName");
|
||||
if(_loc4_ == null)
|
||||
{
|
||||
if(!("appName" in _loc5_))
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("Application name is not defined.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
_loc5_["screenName"] = param1;
|
||||
return send("screenview",_loc5_);
|
||||
}
|
||||
|
||||
override public function event(param1:String, param2:String, param3:String = "", param4:int = -1) : Boolean
|
||||
{
|
||||
if(param1 == null || param1 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("category is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(param2 == null || param2 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("action is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var _loc5_:Dictionary = new Dictionary();
|
||||
_loc5_["eventCategory"] = param1;
|
||||
_loc5_["eventAction"] = param2;
|
||||
if(param3 != "")
|
||||
{
|
||||
_loc5_["eventLabel"] = param3;
|
||||
}
|
||||
if(param4 > -1)
|
||||
{
|
||||
_loc5_["eventValue"] = param4;
|
||||
}
|
||||
return send("event",_loc5_);
|
||||
}
|
||||
|
||||
override public function transaction(param1:String, param2:String = "", param3:Number = 0, param4:Number = 0, param5:Number = 0, param6:String = "") : Boolean
|
||||
{
|
||||
if(param1 == null || param1 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("id is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var _loc7_:Dictionary = new Dictionary();
|
||||
_loc7_["transactionId"] = param1;
|
||||
if(param2 != "")
|
||||
{
|
||||
_loc7_["transactionAffiliation"] = param2;
|
||||
}
|
||||
_loc7_["transactionRevenue"] = param3;
|
||||
_loc7_["transactionShipping"] = param4;
|
||||
_loc7_["transactionTax"] = param5;
|
||||
if(param6 != "")
|
||||
{
|
||||
_loc7_["currencyCode"] = param6;
|
||||
}
|
||||
return send("transaction",_loc7_);
|
||||
}
|
||||
|
||||
override public function item(param1:String, param2:String, param3:Number = 0, param4:int = 0, param5:String = "", param6:String = "", param7:String = "") : Boolean
|
||||
{
|
||||
if(param1 == null || param1 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("transaction id is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(param2 == null || param2 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("name is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var _loc8_:Dictionary = new Dictionary();
|
||||
_loc8_["transactionId"] = param1;
|
||||
_loc8_["itemName"] = param2;
|
||||
_loc8_["itemPrice"] = param3;
|
||||
_loc8_["itemQuantity"] = param4;
|
||||
if(param5 != "")
|
||||
{
|
||||
_loc8_["itemCode"] = param5;
|
||||
}
|
||||
if(param6 != "")
|
||||
{
|
||||
_loc8_["itemCategory"] = param6;
|
||||
}
|
||||
if(param7 != "")
|
||||
{
|
||||
_loc8_["currencyCode"] = param7;
|
||||
}
|
||||
return send("item",_loc8_);
|
||||
}
|
||||
|
||||
override public function social(param1:String, param2:String, param3:String) : Boolean
|
||||
{
|
||||
if(param1 == null || param1 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("network is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(param2 == null || param2 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("action is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(param3 == null || param3 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("target is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var _loc4_:Dictionary = new Dictionary();
|
||||
_loc4_["socialNetwork"] = param1;
|
||||
_loc4_["socialAction"] = param2;
|
||||
_loc4_["socialTarget"] = param3;
|
||||
return send("social",_loc4_);
|
||||
}
|
||||
|
||||
override public function exception(param1:String = "", param2:Boolean = true) : Boolean
|
||||
{
|
||||
var _loc3_:Dictionary = new Dictionary();
|
||||
if(param1 != "")
|
||||
{
|
||||
_loc3_["exceptionDescription"] = param1;
|
||||
}
|
||||
if(param2)
|
||||
{
|
||||
_loc3_["exceptionFatal"] = "1";
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_["exceptionFatal"] = "0";
|
||||
}
|
||||
return send("exception",_loc3_);
|
||||
}
|
||||
|
||||
override public function timing(param1:String, param2:String, param3:int, param4:String = "", param5:Dictionary = null) : Boolean
|
||||
{
|
||||
if(param1 == null || param1 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("category is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(param2 == null || param2 == "")
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("name is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(param3 < 0)
|
||||
{
|
||||
if(_config && _config.enableErrorChecking)
|
||||
{
|
||||
throw new ArgumentError("value is empty");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var _loc7_:Dictionary = new Dictionary();
|
||||
_loc7_["userTimingCategory"] = param1;
|
||||
_loc7_["userTimingVar"] = param2;
|
||||
_loc7_["userTimingTime"] = param3;
|
||||
if(param4 != "")
|
||||
{
|
||||
_loc7_["userTimingLabel"] = param4;
|
||||
}
|
||||
if(param5 != null)
|
||||
{
|
||||
for(var _loc6_:String in param5)
|
||||
{
|
||||
_loc7_[_loc6_] = param5[_loc6_];
|
||||
}
|
||||
}
|
||||
return send("timing",_loc7_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package libraries.uanalytics.tracker
|
||||
{
|
||||
import flash.system.System;
|
||||
import flash.utils.describeType;
|
||||
|
||||
public class HitType
|
||||
{
|
||||
|
||||
public static const PAGEVIEW:String = "pageview";
|
||||
|
||||
public static const SCREENVIEW:String = "screenview";
|
||||
|
||||
public static const EVENT:String = "event";
|
||||
|
||||
public static const TRANSACTION:String = "transaction";
|
||||
|
||||
public static const ITEM:String = "item";
|
||||
|
||||
public static const SOCIAL:String = "social";
|
||||
|
||||
public static const EXCEPTION:String = "exception";
|
||||
|
||||
public static const TIMING:String = "timing";
|
||||
|
||||
public function HitType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function isValid(param1:String) : Boolean
|
||||
{
|
||||
var _loc3_:String = null;
|
||||
var _loc5_:XML = describeType(HitType);
|
||||
var _loc2_:Boolean = false;
|
||||
for each(var _loc4_:XML in _loc5_.constant)
|
||||
{
|
||||
_loc3_ = String(_loc4_.@name);
|
||||
if(HitType[_loc3_] == param1)
|
||||
{
|
||||
_loc2_ = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
System.disposeXML(_loc5_);
|
||||
if(_loc2_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package libraries.uanalytics.tracker
|
||||
{
|
||||
import flash.events.NetStatusEvent;
|
||||
import flash.net.SharedObject;
|
||||
import flash.system.ApplicationDomain;
|
||||
import libraries.uanalytics.tracker.senders.LoaderHitSender;
|
||||
import libraries.uanalytics.tracking.Configuration;
|
||||
import libraries.uanalytics.tracking.HitModel;
|
||||
import libraries.uanalytics.tracking.RateLimiter;
|
||||
import libraries.uanalytics.utils.generateUUID;
|
||||
|
||||
public class WebTracker extends DefaultTracker
|
||||
{
|
||||
|
||||
protected var _storage:SharedObject;
|
||||
|
||||
public function WebTracker(param1:String = "", param2:Configuration = null)
|
||||
{
|
||||
super(param1,param2);
|
||||
}
|
||||
|
||||
override protected function _ctor(param1:String = "") : void
|
||||
{
|
||||
var _loc2_:Class = null;
|
||||
_model = new HitModel();
|
||||
_temporary = new HitModel();
|
||||
if(_config.senderType != "")
|
||||
{
|
||||
_loc2_ = ApplicationDomain.currentDomain.getDefinition(_config.senderType) as Class;
|
||||
_sender = new _loc2_(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
_sender = new LoaderHitSender(this);
|
||||
}
|
||||
_limiter = new RateLimiter(20,2,1);
|
||||
if(param1 != "")
|
||||
{
|
||||
set("trackingId",param1);
|
||||
}
|
||||
var _loc3_:String = _getClientID();
|
||||
if(_loc3_ != "")
|
||||
{
|
||||
set("clientId",_loc3_);
|
||||
}
|
||||
set("dataSource","web");
|
||||
}
|
||||
|
||||
override protected function _getClientID() : String
|
||||
{
|
||||
var _loc2_:String = null;
|
||||
var _loc1_:String = null;
|
||||
_storage = SharedObject.getLocal(_config.storageName);
|
||||
if(!_storage.data.clientid)
|
||||
{
|
||||
_loc2_ = generateUUID();
|
||||
_storage.data.clientid = _loc2_;
|
||||
_loc1_ = null;
|
||||
try
|
||||
{
|
||||
_loc1_ = _storage.flush(1024);
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
}
|
||||
if(_loc1_ != null)
|
||||
{
|
||||
switch(_loc1_)
|
||||
{
|
||||
case "pending":
|
||||
_storage.addEventListener("netStatus",onFlushStatus);
|
||||
break;
|
||||
case "flushed":
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = _storage.data.clientid;
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
protected function onFlushStatus(param1:NetStatusEvent) : void
|
||||
{
|
||||
_storage.removeEventListener("netStatus",onFlushStatus);
|
||||
switch(param1.info.code)
|
||||
{
|
||||
case "SharedObject.Flush.Success":
|
||||
case "SharedObject.Flush.Failed":
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
package libraries.uanalytics.tracker.senders
|
||||
{
|
||||
import flash.display.Loader;
|
||||
import flash.display.LoaderInfo;
|
||||
import flash.errors.IOError;
|
||||
import flash.errors.IllegalOperationError;
|
||||
import flash.events.ErrorEvent;
|
||||
import flash.events.Event;
|
||||
import flash.events.HTTPStatusEvent;
|
||||
import flash.events.IOErrorEvent;
|
||||
import flash.events.UncaughtErrorEvent;
|
||||
import flash.net.URLRequest;
|
||||
import libraries.uanalytics.tracking.AnalyticsTracker;
|
||||
import libraries.uanalytics.tracking.HitModel;
|
||||
import libraries.uanalytics.tracking.HitSender;
|
||||
|
||||
public class LoaderHitSender extends HitSender
|
||||
{
|
||||
|
||||
protected var _tracker:AnalyticsTracker;
|
||||
|
||||
public function LoaderHitSender(param1:AnalyticsTracker)
|
||||
{
|
||||
super();
|
||||
_tracker = param1;
|
||||
}
|
||||
|
||||
protected function _hookEvents(param1:Loader) : void
|
||||
{
|
||||
param1.uncaughtErrorEvents.addEventListener("uncaughtError",onUncaughtError);
|
||||
param1.contentLoaderInfo.addEventListener("httpStatus",onHTTPStatus);
|
||||
param1.contentLoaderInfo.addEventListener("ioError",onIOError);
|
||||
param1.contentLoaderInfo.addEventListener("complete",onComplete);
|
||||
}
|
||||
|
||||
protected function _unhookEvents(param1:Loader) : void
|
||||
{
|
||||
param1.uncaughtErrorEvents.removeEventListener("uncaughtError",onUncaughtError);
|
||||
param1.contentLoaderInfo.removeEventListener("httpStatus",onHTTPStatus);
|
||||
param1.contentLoaderInfo.removeEventListener("ioError",onIOError);
|
||||
param1.contentLoaderInfo.removeEventListener("complete",onComplete);
|
||||
}
|
||||
|
||||
protected function onUncaughtError(param1:UncaughtErrorEvent) : void
|
||||
{
|
||||
var _loc3_:Error = null;
|
||||
var _loc2_:ErrorEvent = null;
|
||||
_unhookEvents(param1.target as Loader);
|
||||
if(param1.error is Error)
|
||||
{
|
||||
_loc3_ = param1.error as Error;
|
||||
}
|
||||
else if(param1.error is ErrorEvent)
|
||||
{
|
||||
_loc2_ = param1.error as ErrorEvent;
|
||||
_loc3_ = new Error(_loc2_.text,_loc2_.errorID);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = new Error("a non-Error, non-ErrorEvent type was thrown and uncaught");
|
||||
}
|
||||
if(_tracker.config.enableErrorChecking)
|
||||
{
|
||||
throw _loc3_;
|
||||
}
|
||||
}
|
||||
|
||||
protected function onHTTPStatus(param1:HTTPStatusEvent) : void
|
||||
{
|
||||
}
|
||||
|
||||
protected function onIOError(param1:IOErrorEvent) : void
|
||||
{
|
||||
var _loc3_:* = null;
|
||||
var _loc2_:LoaderInfo = param1.target as LoaderInfo;
|
||||
_unhookEvents(_loc2_.loader);
|
||||
if(_tracker.config.enableErrorChecking)
|
||||
{
|
||||
throw new IOError(param1.text,param1.errorID);
|
||||
}
|
||||
}
|
||||
|
||||
protected function onComplete(param1:Event) : void
|
||||
{
|
||||
var _loc2_:LoaderInfo = param1.target as LoaderInfo;
|
||||
_unhookEvents(_loc2_.loader);
|
||||
}
|
||||
|
||||
override public function send(param1:HitModel) : void
|
||||
{
|
||||
var _loc5_:String = _buildHit(param1);
|
||||
var _loc7_:String = "";
|
||||
var _loc3_:Boolean = false;
|
||||
if(_tracker.config.forcePOST || _loc5_.length > _tracker.config.maxGETlength)
|
||||
{
|
||||
_loc3_ = true;
|
||||
}
|
||||
if(_loc5_.length > _tracker.config.maxPOSTlength)
|
||||
{
|
||||
throw new ArgumentError("POST data is bigger than " + _tracker.config.maxPOSTlength + " bytes.");
|
||||
}
|
||||
if(_tracker.config.forceSSL)
|
||||
{
|
||||
_loc7_ = _tracker.config.secureEndpoint;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc7_ = _tracker.config.endpoint;
|
||||
}
|
||||
var _loc2_:URLRequest = new URLRequest();
|
||||
_loc2_.url = _loc7_;
|
||||
if(_loc3_)
|
||||
{
|
||||
_loc2_.method = "POST";
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_.method = "GET";
|
||||
}
|
||||
_loc2_.data = _loc5_;
|
||||
var _loc6_:Loader = new Loader();
|
||||
_hookEvents(_loc6_);
|
||||
var _loc4_:§--UNKNOWN--§ = null;
|
||||
try
|
||||
{
|
||||
_loc6_.load(_loc2_);
|
||||
}
|
||||
catch(e:IOError)
|
||||
{
|
||||
_unhookEvents(_loc6_);
|
||||
_loc4_ = e;
|
||||
}
|
||||
catch(e:SecurityError)
|
||||
{
|
||||
_unhookEvents(_loc6_);
|
||||
_loc4_ = e;
|
||||
}
|
||||
catch(e:IllegalOperationError)
|
||||
{
|
||||
_unhookEvents(_loc6_);
|
||||
_loc4_ = e;
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
_unhookEvents(_loc6_);
|
||||
_loc4_ = e;
|
||||
}
|
||||
if(_loc4_)
|
||||
{
|
||||
throw _loc4_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user