The article describes the following SDKs.
With these SDKs, you can import data on your application into Treasure Data. In that case, you don’t need to build servers.
For example, change //cdn.treasuredata.com/sdk/2.5/td.min.js to //cdn.treasuredata.com/sdk/3.0.0-beta/td.min.js.
Mobile SDKs Features
The SDK has the following functions:
Add the event that occurs in the application (buffering at the client side)(addEvent/addEventWithCallback)
Encrypt/Decrypt the buffered data with arbitrary common key automatically (initializeEncryptionKey, default:disable)
Upload the buffered events to TD (To avoid the data loss, the buffered data is cleared only when the upload is success.)(uploadEvents/uploadEventsWithCallback)
Retry the upload a certain number of times in the case of an upload failure(Exponential backoff) (enableRetryUploading/disableRetryUploading, default:enable)
The uploaded data is automatically compressed to one eighth of its original size(enableEventCompression/diableEventCompression, default:enable)
Register which of the Callbacks to call, depending on the success or failure of the operation(Event adding or Uploading)(addEventWithCallback/uploadEventsWithCallback)
The SDK generates a unique ID for each device. Since this ID is added to each event automatically, it makes aggregating each device’s data easy.(enableAutoAppendUniqId/disableAutoAppendUniqId, default:disable)
Add OS version or device model information to each event automatically.(enableAutoAppendModelInformation/disableAutoAppendModelInformation, default:disable)
The SDK generates a session id for each session initiation/termination. Since the session id is added to each event automatically, you can aggregate per a sequence of events that occurred in application.(startSession/endSession)
Detect the first running of applications, since SDK monitors whether applications were running or not.(isFirstRun/clearFirstRun)
Prevent data duplication even if you update multiple times by executing de-duplication at server side. (Currently, executing de-duplication every day)
The string which is described at the end of each function is the SDK API name (TreasureData class' method name in concrete terms.). You need to configure the database and the table for registering events in the SDKs. They work with the destination database and the destination table in Treasure Data.
For example, the following picture shows a part of sample data on Treasure Data when using startSession and endSession with activating enableAutoAppendUniqId and enableAutoAppendModelInformation.
Account Management for Mobile SDKs
Create a database on Treasure Data for importing from SDKs.
Associate a user who is granted access to the above database, with a Treasure Data user.
You can associate the user with the Treasure Data user by using “Add Team Member” from.
Generate ‘Write-only’ API keys for the above user.
Use generated “Write-only" API keys on SDKs.
Selecting the “My Profile” in the TD Console.
Insert your password under the “API Keys” panel.
Generate “Write-only” API keys.