I was wondering if I can send google analytics tracking data to google by sending custom URL requests. I assumed I could build my own URLs and fire a request to get events t
In addition to @pavel-morshenyuk answer, if you want to correlate the event to the user who actioned on it, the code below will map the request to the google client id.
string clientId = Guid.NewGuid().ToString();
if (Request != null && Request.Cookies != null && Request.Cookies.Get("_ga") != null && Request.Cookies.Get("_ga").Value != null)
{
clientId = Request.Cookies.Get("_ga").Value;
clientId = clientId.Replace("GA1.2.", "");
clientId = clientId.Replace("GA1.1.", "");
}
note at some point, this may need to be tweaked if GA changes their internal cookie tracking.