-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from zype/akamai-analytics
Akamai analytics
- Loading branch information
Showing
22 changed files
with
4,034 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
'Beacon system will handle operations related to sending a beacons | ||
|
||
'Function : AkaMA_isBeaconInOrder | ||
'Params : None. | ||
'Return : Returns BeaconOrders which defines valid order for the beacons | ||
'Description : Use this as a reference for beacon order | ||
function AkaMA_isBeaconInOrder() | ||
return { | ||
BeaconReported:{ | ||
iLineReported : &H0001 | ||
sLineReported : &H0002 | ||
pLineReported : &H0004 | ||
cLineReported : &H0008 | ||
eLineReported : &H0010 | ||
vLineReported : &H0020 | ||
} | ||
} | ||
end function | ||
|
||
|
||
'Function : AkaMA_MABeacons | ||
'Params : None. | ||
'Return : Returns function sendBeacon to send beacon | ||
'Description : Use this while sending beacons | ||
function AkaMA_MABeacons() | ||
return { | ||
'Function : sendBeacon | ||
'Params : iBeacon. string with complete URL which will be sent to | ||
' back end | ||
'Return : Returns an error code if failed else success | ||
'Description : Send's I-Line and sets beacon status to iLineSent | ||
' Which maintains the status of the beacon system | ||
' this can be used to check if it is right time to send | ||
' a particular beacon | ||
sendBeacon : function(beacon as string) as integer | ||
beaconRequest = AkaMA_NewHttp(beacon) | ||
if (beaconRequest.Http.AsyncGetToString()) | ||
event = wait(0, beaconRequest.Http.GetPort()) | ||
if type(event) = "roUrlEvent" | ||
str = event.GetString() | ||
'print "Returned string = ";str | ||
if event.getResponseCode() <> 200 | ||
print "Http Request failed" | ||
return AkaMAErrors().ERROR_CODES.AKAM_beacon_request_failed | ||
else if event.getResponseCode() = 200 | ||
print "Beacon sent successfully!!!" | ||
endif | ||
else if event = invalid | ||
beaconRequest.Http.AsyncCancel() | ||
' reset the connection on timeouts | ||
else | ||
print "roUrlTransfer::AsyncGetToString(): unknown event" | ||
endif | ||
endif | ||
return AkaMAErrors().ERROR_CODES.AKAM_Success | ||
end function | ||
|
||
} | ||
end function |
Oops, something went wrong.