Mobile SDK

The Mobile SDKs are small code libraries that you include in your mobile apps in order to track reader activity in mobile devices. There are currently libraries for Android (Java) and iOS (Objective-C). You can find the toolkits and installation instructions on Github:

You can also read detailed documentation of the toolkits here:

Proxy Server Protocol

The pixel server accepts GET requests containing the information for single actions. For mobile devices, sending one request per action wastes battery.

The SDK sends batches of events to a proxy server, which then splits the batches into individual requests for consumption by the pixel server. The SDK creates this batched request for you, but there are some cases where you might want to construct this batched request yourself.

Elements of the Proxy Request

All POST requests sent to must have a single argument rqs. All other aruments are ignored.

The value of the rqs (requests) parameter is a URL-encoded JSON document that must have the following structure:

        "os":"iPhone OS",

The data variable is a document containing invariant data about the pixel requests -- that is, data that is constant for all of the events being transmitted.

The events variable is a list of documents containing data that differs per request.

Variable Container Description Required Example
idsite data The site ID where data should be stored (API key) yes "idsite":""
parsely_site_uuid data The UUID for the current user or device yes "parsely_site_uuid":"76e4c..."
appname data The name of the current app (for mobile devices) no "appname":"MyCoolApp"
manufacturer data The device manufacturer (for mobile devices) no "manufacturer":"Apple"
os data The name of the operating system (mobile only) no "os":"iPhone OS"
os_version data Operating system major and minor version no "os_version":"6.1"
url events The canonical URL of the tracked post yes "url":""
ts events The UNIX timestamp (seconds since epoch) yes "ts":1363796913.220884

A real request to the proxy server might look like this one, which contains two separate pageview events in the URL-encoded JSON document:

POST /mobileproxy HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 213

Generating a UUID

On desktop browsers, you can avoid generating a UUID by using the network UUID.

Mobile apps that use the toolkit don't have to create their own UUIDs, as the SDK handles that. However, if you'd like to create your own, it must be guaranteed to be unique per device.

The easiest way to guarantee uniqueness is to generate a UUID using the device MAC address. On iOS, see the CFUUIDCreate() function for a description of how to do this. Another good UUID might be an internal userid which might be used for tracking logged-in users.

If your UUID is not looked up in a remote database, you should save it in persistent storage (for example, iOS' NSUserDefaults key-value store).