Recommended way to send details to the client for a web analytics service
When creating a service like Google Analytics or StatCounter, I want to do it a little bit different in the data storage part:
- A user visits my client's website.
- JS code or 1 pixel image is downloaded from my server.
- Request sent to my server, where the data is processed.
- Things like country, returning customer, bounce rate, etc are calculated.
- Instead of storing this data in my server, I want to store it开发者_StackOverflow in the client's server.
The client is an individual or business who is using my "service" for web analytics of their website.
Assuming that they are prepared to create a db schema that I choose, what is the recommended way to send the data to them to store?
The only thing I can think of is, asking them to give me a URL in their server, to which I will POST a JSON string, which they can store or do whatever they want.
Apart from HTTP POST, are their any other choices I have to send the data to them?
You could store the data on your own server then provide a mechanism for the client to download it. This would save you the burden of entering and testing a different URL for each customer.
It would also mean that you would only need one SSL URL and authentication method for security. Otherwise you would need to make sure each customer has a working SSL and get your script to log onto each of them when it deposits the data.
精彩评论