Analytics Enhancements: IP Addresses, gRPC, and User Selection
What developments have taken place today?
The analytics data extraction process has been enhanced by implementing a more reliable method for capturing client IP addresses, moving from direct use of the web framework’s ClientIP()
function to a helper function (helper.GetRealAddr()
) that retrieves the IP address from the request object. This change improves accuracy and reliability in IP address identification.
The code now incorporates a type parameter into URLs constructed for analytics data transmission to the gRPC server. Functions such as BuildUrl
, BuildStatsUrl
, BuildUrlTableData
, prepareAnalyticsData
, getSearchConfig()
, and updateChartSelect
have been updated to include this parameter, derived from the searchObject
. A validation has also been added for the field. Additionally, a select box was introduced in analytics_form.html
to facilitate user selection between Javascript tracker and gRPC data transmission. The configuration file has been modified to include a gRPC token.
These changes collectively improve the application’s analytics capabilities by supporting diverse data formats and tracking methods through the gRPC server, while bolstering security with updated authentication protocols and connection details.