Analytics: Fix event logs being cut off in POST requests

The PHP setting max_input_vars limits the number of variables in a POST
request (default value is 1000). As a result, longer event logs were being cut
off after 1000 attributes were stored (timestamps, actions, etc).

To solve the problem, the event log is now encoded as a JSON string (i.e: a
single variable) before sending it in a POST request to the server. The server
decodes it, parses the needed information, and saves it in a file.