countly_dril.drill_events

New data model collection

This collection is from the new data model, which combines all events from all apps in a single collection.

Drill plugin required

This collection might not appear if you don't have the drill plugin enabled.

These collections contain information about events that occurred to specific users, which you can match with countly.app_users{appID} collections documents using UserID property "uid".

Note: A new server will only contain the countly_drill.drill_events collection. However, if you upgrade an existing server, it will retain all previous countly_drill.drill_events{ID}, which includes data collected before the upgrade.

Special drill events

In Countly drill, there are also some special events saved that are not related to events you are sending from SDKs. They are prefixed with "[CLY]_." A good example of these kinds of events is sessions.

Sessions are handled the same way as events that occur at a specific time. A special key was reserved especially for session drill handling: "[CLY]_session."

Here is the list of possible fields

Field Description Example
_id Unique ID of the specific event for a specific user generated by MongoDB d9477ba1a1ac4bea629a28ca9c3d4ed42cdde5391632013840_aK_1632009840000_1
a App ID as a string to show to which app event belongs to 62e0f9e3ac58e3dfbca6466c
e Event key, to show which event the document describes Login
uid User id. To uniquely identify a user within this collection. Can be used for data correlation among multiple events/sessions a1
did Unique deviceID de2e786f-a4b9-848c-f6af-0d0ac60ccc0d
up User properties in time of event. fs - First seen timestamp fs - Last seen timestamp tsd - Total session duration sc - Total session count d - Device name cty - City cc - Country code p - Platform pv - Platform version av - Application version r - Resolution { "fs": 1413800814, "ls": 1413800814, "tsd": 120, "sc": 1, "d": "One Touch Idol X", "cty": "Unknown", "cc": "JP", "p": "WP8", "pv": "w2:2", "av": "1:1", "c": "Sprint", "r": "360x640" }
up.dow One of the properties that does not come from user, but rather from event time is day of the week in user time zone, where 1 is Monday and 7 is Sunday 5
up.hour One of the properties that does not come from user, but rather from event time is hour of the day in user time zone from 0 to 23 11
ts Timestamp in miliseconds when event ocured 1413800964000
cd Creation date of the document. Used for internal TTL (Time to live) indexes of MongoDB. ISODate("2014-10-20T11:56:42.989Z")
sg Segments provided with event { "level": 6, "mode": "arcade", "difficulty": "hard" }
custom Custom user properties { "test": "yes" }
cmp Campaign information { "b": "Chrome", "c": "social5ab0c3ef92938d0e61cf77f4", "cnty": "NO", "l": "en-US", "m": "false", "pl": "Windows", "n": "Social Campaign" }
s Sum. Each event has an optional sum property attached to it. 1.99
c Count. Each event has a count property attached to it. 1
dur Duration. Can display how long did even run 300
id Event ID generated by SDK to reference in other documents as previous event/view d3a8c5971728556515163
peid Previous Event ID referencing id field of event that happened before 39c77a011728556567818
cvid Current View ID, referencing id field of the view, which is currently displayed while event was reported 88d5bbe51728480520815
pvid Previous View ID, referencing id field of the view that was before this 6b4b8f2a1728483435546
vid Internal view ID, for internal referencing 64a4372c2a345826332ec6d9
maxd Maximal session duration update sent from SDK (for debug purposes) 60
dc Amount of duration updates received per session 10


We also have a special collection drill_meta containing docs that describe each drill collection. Documents in this collection show all value types (and unique values for lists) for properties that are stored in a specific drill collection.

Here is an example of both document types:

Example document Meta document Meta Big list
{
	"_id" : "d9477ba1a1ac4bea629a28ca9c3d4ed42cdde5391632013840_aK_1632009840000_1",
"a" : "58650a47cc2ed563c5ad964c",
"e" : "[CLY]_view",
"uid" : "TqY", "did" : "8897529E-B7E1-4B6E-BA00-3D8487DE2B19", "up" : { "fs" : 1403307938, "ls" : 1403307938, "tsd" : 90, "sc" : 1, "d" : "iPhone6,1", "cty" : "Unknown", "cc" : "US", "p" : "iOS", "pv" : "iiPhone OS 7:0:6", "av" : "1:9:1", "r" : "1136x640" }, "ts" : 1403309348000, "cd" : ISODate("2014-06-21T00:09:08.100Z"), "sg" : { "Experiment_GameCenter" : 2, "Experiment_RateMyApp" : 1, "Experiment_RefreshNotifs" : 1, "Experiment_DON" : 1, "Experiment_ExpSpeed" : 0, "Experiment_E2" : 0, "Experiment_OfferWall" : 1, "Experiment_WatchToEarn" : 0, "Experiment_Ads" : 0, "Experiment_Sales" : 1, "totalCredits" : 5000495, "totalCreditsBucket" : "5000000+", "level" : 1, "levelBucket" : "1-3", "payerStatus" : "True", "sessionStartTotalCredits" : 500, "sessionStartTotalCreditsBucket" : "251-1000", "sessionStartLevel" : 1, "UserID" : "5ce86cdd-b93b-467e-958f-6b257ca62f28", "sessionStartLevelBucket" : "1-3", "installWeek" : "06/16/2014", "sessionStartPayerStatus" : "False", "playerTenure" : 0, "platform" : "iOS" }, "s" : 1.99, "c" : 1,
"dur": 120 }

Querying drill events by periods

At some point, you may need to query drill events by specific time spans.

Drill events provide multiple properties based on the time spans you want to query.

First, there is a cd attribute, which is the moment when the event was processed and inserted into DB.

There is also a ts attribute, which contains a timestamp in milliseconds of when the event occurred on the device and can be used for any arbitrary time queries.

Internal events

In addition to the Events that you define, some Interval Events are also stored in Drill, depending on the enabled plugin features and functionality used.

For more information on Internal Events, see this document.

Looking for help?