Google Analytics provides a mobile code to track server-side statistics. You can use this code to archive your purpose.
- google , . gif url :
string utmGifLocation = "http://www.google-analytics.com/__utm.gif";
string utmUrl = utmGifLocation + "?" +
"utmwv=" + Version +
"&utmn=" + RandomNumber +
"&utmhn=" + HttpUtility.UrlEncode(domainName) +
"&utmr=" + HttpUtility.UrlEncode(documentReferer) +
"&utmp=" + HttpUtility.UrlEncode(documentPath) +
"&utmac=" + account +
"&utmcc=__utma%3D999.999.999.999.999.1%3B" +
"&utmvid=" + visitorId +
"&utmip=" + GlobalContext.Request.ServerVariables["REMOTE_ADDR"];
SendRequestToGoogleAnalytics(utmUrl);
:
private void SendRequestToGoogleAnalytics(string utmUrl)
{
try
{
WebRequest connection = WebRequest.Create(utmUrl);
((HttpWebRequest)connection).UserAgent = GlobalContext.Request.UserAgent;
connection.Headers.Add("Accepts-Language",
GlobalContext.Request.Headers.Get("Accepts-Language"));
using (WebResponse resp = connection.GetResponse())
{
}
}
catch (Exception ex)
{
if (GlobalContext.Request.QueryString.Get("utmdebug") != null)
{
throw new Exception("Error contacting Google Analytics", ex);
}
}
}
google , .
https://developers.google.com/analytics/devguides/collection/?csw=1
, , : http://dl.google.com/gaformobileapps/googleanalyticsformobile.zip