Android tracker data size issue

45 views
Skip to first unread message

imran ali

unread,
Mar 31, 2016, 10:18:21 AM3/31/16
to Snowplow
Hi
I have implemented snowplow in my android project.
When we try to find how much mobile data it has been consuming.
We found it has been sending around 2KB data for each event.

1. Is there any way to reduce size of analytic data that has to travel on network ? any  zip or compression option?

2. Also we observed it is sending lot of data in 'cx'.  What is the data being sent in this 'cx'? Is there a way to not to send this data?
"cx": "eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvd1wvY29udGV4dHNc\nL2pzb25zY2hlbWFcLzEtMC0xIiwiZGF0YSI6W3sic2NoZW1hIjoiaWdsdTpjb20uc25vd3Bsb3dh\nbmFseXRpY3Muc25vd3Bsb3dcL21vYmlsZV9jb250ZXh0XC9qc29uc2NoZW1hXC8xLTAtMCIsImRh\ndGEiOnsib3NWZXJzaW9uIjoiNi4wIiwiZGV2aWNlTW9kZWwiOiJQaXhlbFYxIiwiYW5kcm9pZElk\nZmEiOiI1OTZjMTc1Ni03YmU0LTRkODUtOWU5My05YTE1Zjk5Y2ZlMzAiLCJkZXZpY2VNYW51ZmFj\ndHVyZXIiOiJMQVZBIiwib3NUeXBlIjoiYW5kcm9pZCJ9fV19\n",



Hoping some good solutions from your side.


Thanks
Imran Ali

jo...@snowplowanalytics.com

unread,
Mar 31, 2016, 12:41:11 PM3/31/16
to Snowplow
Hi Imran,

Unfortunately no there is no zipping or compression available to make the payloads smaller here.  The "cx" field is the contextual events attached to each event sent from the Tracker.  
This can be things like the session_context, mobile_context or geolocation_context as well as your own contexts that you can attach.  

If you wish to stop sending context data you will need to:

* Turn of client sessionization
* Do not pass your application context to your Subject constructor
  - In fact do not make a Subject at all if you would like to cut down on the payload size


Hope that helps!

Josh

imran ali

unread,
Apr 1, 2016, 2:00:03 AM4/1/16
to Snowplow
Thank you very much Josh.

Regards
Imran Ali

imran ali

unread,
Apr 2, 2016, 1:47:12 AM4/2/16
to Snowplow
Hi josh
I remove a "subject" & remove session and also .base64(false), but still I found this request.

{
"schema": "iglu:com.snowplowanalytics.snowplow\/payload_data\/jsonschema\/1-0-3",
"data": [{
"dtm": "1459574899739",
"se_ca": "Setup",
"p": "mob",
"eid": "8cfbc652-3ace-46b0-a6ce-4f0f6502c338",
"e": "se",
"stm": "1459574900415",
"tna": "tonaton.com",
"se_ac": "TapAndroid6Grant",
"co": "{\"schema\":\"iglu:com.snowplowanalytics.snowplow\\\/contexts\\\/jsonschema\\\/1-0-1\",\"data\":[]}",
"aid": "TONATON_AND",
"tv": "andr-0.5.1"
}]
}

Why "co" is going with more number of characters? as well as observing repetitive same data "iglu:com.snowplowanalytics.snowplow", is there any way to ignore these redundant data in request? so that we can minimise request size.


Regards
Imran Ali

jo...@snowplowanalytics.com

unread,
Apr 4, 2016, 3:21:43 AM4/4/16
to Snowplow
Hi Imran,

It looks like there is a bug with the contexts whereby it does not remove the "co" field if there are no contexts to send; I have raised a ticket for the next release here: https://github.com/snowplow/snowplow-android-tracker/issues/194

Unfortunately no you cannot remove the `iglu:com.snowplowanalytics.snowplow\xxx\xxx\xxx` strings; these tell us how to validate the information that is being passed through the pipeline.  Without these we have no way of knowing how to validate and store the events being sent to us.

However if you wish to get rid of the wrapping schema + data fields in the above request you can switch to using GET requests as opposed to POST requests.  The former builds a querystring for sending the event and as it can only send 1 event at a time does not require any wrapping of the payload.


Hope that helps,
Josh

imran ali

unread,
Apr 5, 2016, 12:58:43 AM4/5/16
to Snowplow
Thanks josh,

Regards
Imran Ali
Reply all
Reply to author
Forward
0 new messages