mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 13:53:19 -07:00
Small bit of analytics
This commit is contained in:
parent
121cf90ba7
commit
ad796a47bd
5 changed files with 27 additions and 11 deletions
|
@ -54,7 +54,7 @@ namespace PlexRequests.Helpers.Analytics
|
|||
Track(HitType.@event, username, cat, act, label, clientId, value);
|
||||
}
|
||||
|
||||
public async Task TrackEventAsync(Category category, Action action, string label, string username, string clientId, int? value = null)
|
||||
public async void TrackEventAsync(Category category, Action action, string label, string username, string clientId, int? value = null)
|
||||
{
|
||||
var cat = category.ToString();
|
||||
var act = action.ToString();
|
||||
|
@ -146,7 +146,7 @@ namespace PlexRequests.Helpers.Analytics
|
|||
request.Method = RequestMethod;
|
||||
// set the Content-Length header to the correct value
|
||||
request.ContentLength = Encoding.UTF8.GetByteCount(postDataString);
|
||||
|
||||
#if !DEBUG
|
||||
// write the request body to the request
|
||||
using (var writer = new StreamWriter(request.GetRequestStream()))
|
||||
{
|
||||
|
@ -165,6 +165,7 @@ namespace PlexRequests.Helpers.Analytics
|
|||
{
|
||||
Log.Error(ex, "Analytics tracking failed");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
private async Task SendRequestAsync(string postDataString)
|
||||
{
|
||||
|
@ -173,6 +174,7 @@ namespace PlexRequests.Helpers.Analytics
|
|||
// set the Content-Length header to the correct value
|
||||
request.ContentLength = Encoding.UTF8.GetByteCount(postDataString);
|
||||
|
||||
#if !DEBUG
|
||||
// write the request body to the request
|
||||
using (var writer = new StreamWriter(await request.GetRequestStreamAsync()))
|
||||
{
|
||||
|
@ -191,6 +193,7 @@ namespace PlexRequests.Helpers.Analytics
|
|||
{
|
||||
Log.Error(ex, "Analytics tracking failed");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private Dictionary<string, string> BuildRequestData(HitType type, string username, string category, string action, string clientId, string label, int? value, string exceptionDescription, int? fatal)
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace PlexRequests.Helpers.Analytics
|
|||
Issues,
|
||||
UserLogin,
|
||||
Services,
|
||||
Navbar
|
||||
Navbar,
|
||||
UserManagement
|
||||
}
|
||||
}
|
|
@ -51,7 +51,7 @@ namespace PlexRequests.Helpers.Analytics
|
|||
/// <param name="clientId">The client identifier.</param>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns></returns>
|
||||
Task TrackEventAsync(Category category, Action action, string label, string username, string clientId, int? value = null);
|
||||
void TrackEventAsync(Category category, Action action, string label, string username, string clientId, int? value = null);
|
||||
|
||||
/// <summary>
|
||||
/// Tracks the page view.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue