countly_drill.drill_events{ID}

Follow

Drill plugin required

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

There are multiple drill_events{ID} collections, one collection for each specific event

Collection name is formed using "drill_events" string and sha1 hash from event key with app ID.

So for example for event with key "Buy" and for app ID "542e95d747f0be510c000004" the collection name would be: "drill_events" + sha1("Buy542e95d747f0be510c000004") and could look like: "drill_events57c2b7d4eeae912495088c3754d0c6cfe9949f06"

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".

Special drill events

In Countly drill, there are also some special events saved, not related to custom events you are sending from SDKs and they are prefixed with "[CLY]_". Good example for these kind of events are sessions.

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

So to access data about each specific user's sessions, you need to access countly_drill collection with name "drill_events" + sha1("[CLY]_session"+appID), where appID is your app's _id in the apps table.

Here is the list of possible fields

Field Description Example
_id Unique ID of specific event for specific user generated by MongoDB 5444e404d618f69e2a000008
uid User id, documents in all countly_drill collections contain the same uid value for the same user. Can be used for data correlation among multiple events/sessions cb51c8d13bbe95444dde6f14e802d53046eed08e
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" }
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")
d Day of occurrence of event 2014:10:20
w Week of occurrence of event 2014:w43
m Month of occurrence of event 2014:m10
h Hour of occurrence of event 2014:10:20:h14
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


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 the example of both document types:

Example document Meta document Meta Big list
{
	"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"),
	"d" : "2014:6:20",
	"w" : "2014:w25",
	"m" : "2014:m6",
	"h" : "2014:6:20:h17",
	"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,
	"_id" : ObjectId("53a4cd246698af09366881fe")
}

Querying drill events by time spans

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

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 event was processed and inserted into DB.

Then there are event time attributes as d, w, m and h, which are the dates of occurrence of the event.

d being full date as 2015:1:27, which will help when querying by days

w being a week of the year as 2015:w5, which will help when querying by weeks

m being the month of the year as 2015:m1 which will help when querying by months

h being the date with hour of the as 2015:1:27:h13 which will help when querying by hours, usually for specific date

There is also a ts attribute which contains a timestamp in milliseconds and can be used for any arbitrary time queries.

Internal events

Additionally to custom events you define, also internal events (some none custom event actions, like session, that is converted to event format) are stored in drill, depending on enabled plugins and used functionality, they can be:

  • [CLY]_session for sessions
  • [CLY]_crash for crahses
  • [CLY]_view for views
  • [CLY]_action for actions like clicks, taps, etc
  • [CLY]_scroll for scrolling views
  • [CLY]_push_action for actions performed on push notifications
  • [CLY]_push_open for opened push notifications
  • [CLY]_push_sent for sent push notifications
Was this article helpful?
0 out of 0 found this helpful

Looking for help?