I don't personally know of any libraries/services but I would say first search Google. A search for "game analytics" gave http://gameanalytics.com/ as a promising first result. That being said, my thought would be to register for a free server account. Then put a small script on it to accept calls to a page that would save whatever data is given to it. So, you could have a page that would accept
- Client version
- Level number
- Array of locations died at
- If level completed
- Time taken to finish
- Security key to prevent falsified reports (such as a MD5 of a combination of the dynamic numerical data)
- Any other needed data
You could also save each report locally then send them in batches when the user wants to. That way they can see that it accesses the internet only when sending those reports. Given that this would be purely opt-in, I doubt many would try to reverse engineer and send false reports. Then the server script could store the reports in a MySQL database that you could sort, search, and create analytics reports from. Or, you could just pay for a more robust and secure service specifically designed for this. Again, I suggest searching Google.