I'd like to build Pixel based event tracking URL for my app but both tracking endpoint URL and encoding function in MixpanelAPI class aren't available from outside.
I don't want to implement same function in my app and in this PR, I did
extract the encoding functionality from sendData method
make the method and endpoint URL properties protected
This enables to create subclass like this
public class MixpanelAPIExt extends MixpanelAPI{
public String pixcelTrackingURL(JSONObject message, boolean useIpAddress) {
String dataParam = encodeDataString(message.toString());
StringBuilder buf = new StringBuilder();
buf.append(this.mEventsEndpoint).append("/");
buf.append("?data=").append(dataParam);
buf.append("&ip=").append((useIpAddress) ? 1 : 0);
buf.append("&img=1");
return buf.toString();
}
It's just small refactoring and I think this does not affect existing client applications of this library.
I'd like to build Pixel based event tracking URL for my app but both tracking endpoint URL and encoding function in MixpanelAPI class aren't available from outside.
I don't want to implement same function in my app and in this PR, I did
protected
This enables to create subclass like this
It's just small refactoring and I think this does not affect existing client applications of this library.