@@ -5,44 +5,47 @@ define([
55 'libs/proxino/proxino' ,
66 'clicky'
77] , function ( $ , EventBus , Events , norefProxino , noclickyref ) {
8-
9- // Clicky Tracking
10- try { clicky . init ( 66633495 ) ; } catch ( e ) { }
8+ var setup = function ( ) {
9+ // Clicky Tracking
10+ try { clicky . init ( 66633495 ) ; } catch ( e ) { }
1111
12- // Google analytics
13- EventBus . on ( 'all' , function ( event ) {
14- ga ( 'send' , {
15- hitType : 'event' ,
16- eventCategory : 'app' ,
17- eventAction : event
18- } )
19- } ) ;
12+ // Google analytics
13+ EventBus . on ( 'all' , function ( event ) {
14+ ga ( 'send' , {
15+ hitType : 'event' ,
16+ eventCategory : 'app' ,
17+ eventAction : event
18+ } )
19+ } ) ;
2020
21- // Proxino Error tracking
22- Proxino . key = "QI-BctdhtytsUUJERc5HfA" ;
23- Proxino . track_errors ( ) ;
21+ // Proxino Error tracking
22+ Proxino . key = "QI-BctdhtytsUUJERc5HfA" ;
23+ Proxino . track_errors ( ) ;
2424
25- // Server Error Failures
25+ // Server Error Failures
2626
27- $ ( "body" ) . ajaxError ( function ( ev , res , req ) {
28- if ( res . status >= 500 && res . status <= 600 ) {
29- var responseJSON = xhr . responseText ;
30- try {
31- responseJSON = JSON . parse ( xhr . responseText ) ;
32- } catch ( e ) { }
33-
34- var error = new ErrorModel ( ) ;
35- error . save ( {
36- "page" : window . location . href ,
37- "context" : req . type + ' ' + req . url ,
38- "code" : res . status ,
39- "error" : "Internal API error" ,
40- "payload" : {
41- sent : req . data ,
42- received : responseJSON
43- }
44- } , { } ) ;
45- }
46- } ) ;
27+ $ ( "body" ) . ajaxError ( function ( ev , res , req ) {
28+ if ( res . status >= 500 && res . status <= 600 ) {
29+ var responseJSON = xhr . responseText ;
30+ try {
31+ responseJSON = JSON . parse ( xhr . responseText ) ;
32+ } catch ( e ) { }
4733
34+ var error = new ErrorModel ( ) ;
35+ error . save ( {
36+ "page" : window . location . href ,
37+ "context" : req . type + ' ' + req . url ,
38+ "code" : res . status ,
39+ "error" : "Internal API error" ,
40+ "payload" : {
41+ sent : req . data ,
42+ received : responseJSON
43+ }
44+ } , { } ) ;
45+ }
46+ } ) ;
47+ } ;
48+ return {
49+ setup : setup
50+ }
4851} )
0 commit comments