@@ -115,34 +115,14 @@ ClassMethod RemoveProjection(cls As %String, ByRef params, recompile As %Boolean
115115/// <!-- @echo package.printableName --> developer.
116116ClassMethod Stats () As %Status {
117117 if ($get (installLog ) = " " ) { return $$$OK }
118-
119- #define checkErr (%e ) if $$$ISERR (%e ) { do $SYSTEM .Status .DisplayError (%e ) return %e }
120-
121- set sid = $ZD ($H ,3 )
122- set key = " x8AlP" _$E (sid ,1 ,1 )_" tq"
123-
124- set body = {
125- " cacheVersion" : $ZVERSION ,
126- " version" : " <!-- @echo package.version -->" ,
127- " success" : 'errorOccurred ,
128- " sid" : sid
129- }
130- if (errorOccurred ) { set body .log = installLog }
131-
132118 set req = ##class (%Net.HttpRequest ).%New ()
133- set req .ContentType = " application/json"
134- set req .Server = " stats.zitros.tk"
135- set stream = ##class (%Stream.TmpCharacter ).%New ()
136- do body .$toJSON (stream )
137- set req .EntityBody = stream
138- $$$checkErr(req .Post (" /?key=" _key _" &sid=" _sid ))
139-
140- set obj = ##class (%AbstractObject ).$fromJSON (req .HttpResponse .Data )
141- if (obj .error '= " " ) {
142- $$$checkErr($$$ERROR($$$GeneralError, " Unable to collect statistics: " _ obj .error ))
143- }
144-
145- return $$$OK
119+ set req .Server = " www.google-analytics.com"
120+ do req .EntityBody .Write (" v=1&tid=<!-- @echo package.gaID -->&cid=" _##class (%SYS.System ).InstanceGUID ()
121+ _" &ds=web&an=WebTerminal&av=" _..#VERSION
122+ _" &t=event&aiid=" _$ZCONVERT ($zv , " O" , " URL" )_" &ec=" _$ZCONVERT (" install" , " O" , " URL" )_" &ea="
123+ _$case (errorOccurred =0 , 1 : " Success" , : " Failure" )_" &el="
124+ _$ZCONVERT ($case (errorOccurred =0 , 1 : " " , : installLog ), " O" , " URL" ))
125+ return req .Post (" /collect" )
146126}
147127
148128}
0 commit comments