How tracker is calling the collector end point

Can we get a documentation of how the tracker(react native tracker for an instance) is internally sending the requests to the collector end point. I am looking for the method of communication, the headers, content sent and forma, response received if any
We need to document all these items as we are planning to keep the collector behind and api gateway.

Hi Shalini,

One useful reference of the content of the messages could be the Snowplow Tracker Protocol. There you can see the individual attributes in the GET or POST requests. For GET requests, they are added as query parameters in the request. For POST requests, the attributes are serialized in the JSON body of the requests.

In terms of the request path where the data is sent, there are two options:

  • If using POST requests (preferred) and not having a custom POST path, requests are made to the /com.snowplowanalytics.snowplow/tp2 (e.g., https://collector.com/com.snowplowanalytics.snowplow/tp2)
  • If using GET requests, the path is /i

If you have any other questions, please let us know. I’d also recommend two other ways that you can get more familiar with how events are sent to the collector:

  • Create a simple website (or app), implement Snowplow tracking and in the debug view (e.g., in developer tools in a browser), inspect the outgoing requests.
  • Take a look at the http clients in the Snowplow trackers (e.g., the NetworkConnection in the Android tracker) to inspect how the requests are built.
1 Like

@matus Thank you, I would also like to know about the responses that could come back from the collector side(if any)

Currently, the collector only responds with the text “ok” in the response body.

However, I do recommend you to try it out so that you can better observe the behaviour. You can go to Introduction | Snowplow Documentation and search for “tp2” among the network requests in the Chrome (or other browser) developer tools. There you can inspect all the requests to the collector.

2 Likes