We noticed that our Android tracker is sending application_error events to our pipeline occasionally. We manage our device & user identity properties in a context, but for this automatically sent event there is no context attached. Can we configure which contexts are sent with this event?
From the Android tracker v.1.2.1 you can take advantage of the Global Contexts feature in order to add custom contexts to the events, even those automatically generated.
ContextPrimitive customCtx = new SelfDescribingJson(<schema of your context>, <data of context>);
RuleSet ruleSet =
new RuleSet("iglu:com.snowplowanalytics.snowplow/application_error/jsonschema/1-0-*", null);
GlobalContext contextProvider = new RuleSetProvider("appErrorTag", ruleSet, customCtx);
Tracker.instance().addGlobalContext(contextProvider);
The snippet of code above has to be declared at the tracker setup.
When an application_error is automatically tracked, the tracker will check if the event schema match and will add automatically the context you have generated customCtx.
Sure, feel free to share any question and feedback. It can be helpful for other members of the community and it helps us to improve the trackers even more!