├── .dockerignore ├── .gitignore ├── CHANGELOG.md ├── Dockerfile ├── README.md ├── mixpanel ├── mixpanel-cli.js ├── package.json └── protocol.json /.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !package.json 3 | !protocol.json 4 | !mixpanel-cli.js 5 | !mixpanel 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | scripts 2 | .env 3 | npm-debug.log 4 | yarn.lock 5 | user_ids.txt 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ## 0.0.1 (2016-10-25) 3 | 4 | * docs(changelog): updated ([8c091ed](https://github.com/fgribreau/mixpanel-cli/commit/8c091ed)) 5 | * feat(🎩) ([b9012f9](https://github.com/fgribreau/mixpanel-cli/commit/b9012f9)) 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:6-onbuild 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### mixpanel-cli - A command-line tool to query Mixpanel API 2 | 3 |   [](https://hub.docker.com/r/fgribreau/mixpanel-cli/) [](http://bit.ly/2c7uFJq)  [](https://twitter.com/FGRibreau) [](https://www.codementor.io/francois-guillaume-ribreau?utm_source=github&utm_medium=button&utm_term=francois-guillaume-ribreau&utm_campaign=github) [](https://join.slack.com/t/fgribreau/shared_invite/zt-edpjwt2t-Zh39mDUMNQ0QOr9qOj~jrg) 4 | 5 | 6 | ## Shameless plug 7 | 8 | - [**Charts, simple as a URL**. No more server-side rendering pain, 1 url = 1 chart](https://image-charts.com?gh_mixpanel_cli) 9 | - [Looking for a free **Redis GUI**?](http://redsmin.com?gh_mixpanel_cli) [Or for **real-time alerting** & monitoring for Redis?](http://redsmin.com) 10 | 11 |
mixpanel.init('new token', { your: 'config' }, 'library_name');\n
and use it like so:mixpanel.library_name.track(...);\n
"
27 | },
28 | {
29 | "method": {
30 | "name": "mixpanel.push",
31 | "arguments": [
32 | {
33 | "name": "item",
34 | "type": "Array",
35 | "isRequired": true,
36 | "description": "A [function_name, args...] array to be executed"
37 | }
38 | ]
39 | },
40 | "description": "push() keeps the standard async-array-push behavior around after the lib is loaded. This is only useful for external integrations that do not wish to rely on our convenience methods (created in the snippet)."
41 | },
42 | {
43 | "method": {
44 | "name": "mixpanel.disable",
45 | "arguments": [
46 | {
47 | "name": "events",
48 | "type": "Array",
49 | "isRequired": false,
50 | "description": "An array of event names to disable"
51 | }
52 | ]
53 | },
54 | "description": "Disable events on the Mixpanel object. If passed no arguments, this function disables tracking of any event. If passed an array of event names, those events will be disabled, but other events will continue to be tracked.Note: this function does not stop other mixpanel functions from firing, such as register() or people.set()."
55 | },
56 | {
57 | "method": {
58 | "name": "mixpanel.track",
59 | "arguments": [
60 | {
61 | "name": "event_name",
62 | "type": "String",
63 | "isRequired": true,
64 | "description": "The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc."
65 | },
66 | {
67 | "name": "properties",
68 | "type": "Object",
69 | "isRequired": false,
70 | "description": "A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself."
71 | },
72 | {
73 | "name": "callback",
74 | "type": "Function",
75 | "isRequired": false,
76 | "description": "If provided, the callback function will be called after tracking the event."
77 | }
78 | ]
79 | },
80 | "description": "Track an event. This is the most important and frequently used Mixpanel function."
81 | },
82 | {
83 | "method": {
84 | "name": "mixpanel.track_links",
85 | "arguments": [
86 | {
87 | "name": "query",
88 | "type": "Object or String",
89 | "isRequired": true,
90 | "description": "A valid DOM query, element or jQuery-esque list"
91 | },
92 | {
93 | "name": "event_name",
94 | "type": "String",
95 | "isRequired": true,
96 | "description": "The name of the event to track"
97 | },
98 | {
99 | "name": "properties",
100 | "type": "Object or Function",
101 | "isRequired": false,
102 | "description": "A properties object or function that returns a dictionary of properties when passed a DOMElement"
103 | }
104 | ]
105 | },
106 | "description": "Track clicks on a set of document elements. Selector must be a valid query. Elements must exist on the page at the time track_links is called."
107 | },
108 | {
109 | "method": {
110 | "name": "mixpanel.track_forms",
111 | "arguments": [
112 | {
113 | "name": "query",
114 | "type": "Object or String",
115 | "isRequired": true,
116 | "description": "A valid DOM query, element or jQuery-esque list"
117 | },
118 | {
119 | "name": "event_name",
120 | "type": "String",
121 | "isRequired": true,
122 | "description": "The name of the event to track"
123 | },
124 | {
125 | "name": "properties",
126 | "type": "Object or Function",
127 | "isRequired": false,
128 | "description": "This can be a set of properties, or a function that returns a set of properties after being passed a DOMElement"
129 | }
130 | ]
131 | },
132 | "description": "Track form submissions. Selector must be a valid query."
133 | },
134 | {
135 | "method": {
136 | "name": "mixpanel.time_event",
137 | "arguments": [
138 | {
139 | "name": "event_name",
140 | "type": "String",
141 | "isRequired": true,
142 | "description": "The name of the event."
143 | }
144 | ]
145 | },
146 | "description": "Time an event by including the time between this call and a later 'track' call for the same event in the properties sent with the event."
147 | },
148 | {
149 | "method": {
150 | "name": "mixpanel.register",
151 | "arguments": [
152 | {
153 | "name": "properties",
154 | "type": "Object",
155 | "isRequired": true,
156 | "description": "An associative array of properties to store about the user"
157 | },
158 | {
159 | "name": "days",
160 | "type": "Number",
161 | "isRequired": false,
162 | "description": "How many days since the user's last visit to store the super properties"
163 | }
164 | ]
165 | },
166 | "description": "Register a set of super properties, which are included with all events. This will overwrite previous super property values."
167 | },
168 | {
169 | "method": {
170 | "name": "mixpanel.register_once",
171 | "arguments": [
172 | {
173 | "name": "properties",
174 | "type": "Object",
175 | "isRequired": true,
176 | "description": "An associative array of properties to store about the user"
177 | },
178 | {
179 | "name": "default_value",
180 | "type": "*",
181 | "isRequired": false,
182 | "description": "Value to override if already set in super properties (ex: 'False') Default: 'None'"
183 | },
184 | {
185 | "name": "days",
186 | "type": "Number",
187 | "isRequired": false,
188 | "description": "How many days since the users last visit to store the super properties"
189 | }
190 | ]
191 | },
192 | "description": "Register a set of super properties only once. This will not overwrite previous super property values, unlike register()."
193 | },
194 | {
195 | "method": {
196 | "name": "mixpanel.unregister",
197 | "arguments": [
198 | {
199 | "name": "property",
200 | "type": "String",
201 | "isRequired": true,
202 | "description": "The name of the super property to remove"
203 | }
204 | ]
205 | },
206 | "description": "Delete a super property stored with the current user."
207 | },
208 | {
209 | "method": {
210 | "name": "mixpanel.identify",
211 | "arguments": [
212 | {
213 | "name": "unique_id",
214 | "type": "String",
215 | "isRequired": false,
216 | "description": "A string that uniquely identifies a user. If not provided, the distinct_id currently in the persistent store (cookie or localStorage) will be used."
217 | }
218 | ]
219 | },
220 | "description": "Identify a user with a unique ID. All subsequent actions caused by this user will be tied to this unique ID. This property is used to track unique visitors. If the method is never called, then unique visitors will be identified by a UUID generated the first time they visit the site."
221 | },
222 | {
223 | "method": {
224 | "name": "mixpanel.reset",
225 | "arguments": []
226 | },
227 | "description": "Clears super properties and generates a new random distinct_id for this instance. Useful for clearing data when a user logs out."
228 | },
229 | {
230 | "method": {
231 | "name": "mixpanel.get_distinct_id",
232 | "arguments": []
233 | },
234 | "description": "Returns the current distinct id of the user. This is either the id automatically generated by the library or the id that has been passed by a call to identify()."
235 | },
236 | {
237 | "method": {
238 | "name": "mixpanel.alias",
239 | "arguments": [
240 | {
241 | "name": "alias",
242 | "type": "String",
243 | "isRequired": true,
244 | "description": "A unique identifier that you want to use for this user in the future."
245 | },
246 | {
247 | "name": "original",
248 | "type": "String",
249 | "isRequired": false,
250 | "description": "The current identifier being used for this user."
251 | }
252 | ]
253 | },
254 | "description": "Create an alias, which Mixpanel will use to link two distinct_ids going forward (not retroactively). Multiple aliases can map to the same original ID, but not vice-versa. Aliases can also be chained - the following is a valid scenario:mixpanel.alias('new_id', 'existing_id');\n...\nmixpanel.alias('newer_id', 'new_id');\n
If the original ID is not passed in, we will use the current distinct_id - probably the auto-generated GUID."
255 | },
256 | {
257 | "method": {
258 | "name": "mixpanel.set_config",
259 | "arguments": [
260 | {
261 | "name": "config",
262 | "type": "Object",
263 | "isRequired": true,
264 | "description": "A dictionary of new configuration values to update"
265 | }
266 | ]
267 | },
268 | "description": "Update the configuration of a mixpanel library instance.The default config is:{\n // super properties cookie expiration (in days)\n cookie_expiration: 365\n\n // super properties span subdomains\n cross_subdomain_cookie: true\n\n // if this is true, the mixpanel cookie or localStorage entry\n // will be deleted, and no user persistence will take place\n disable_persistence: false\n\n // type of persistent store for super properties (cookie/\n // localStorage) if set to 'localStorage', any existing\n // mixpanel cookie value with the same persistence_name\n // will be transferred to localStorage and deleted\n persistence: 'cookie'\n\n // name for super properties persistent store\n persistence_name: ''\n\n // names of properties/superproperties which should never\n // be sent with track() calls\n property_blacklist: []\n\n // if this is true, mixpanel cookies will be marked as\n // secure, meaning they will only be transmitted over https\n secure_cookie: false\n\n // the amount of time track_links will\n // wait for Mixpanel's servers to respond\n track_links_timeout: 300\n\n // should we track a page view on page load\n track_pageview: true\n\n // if you set upgrade to be true, the library will check for\n // a cookie from our old js library and import super\n // properties from it, then the old cookie is deleted\n // The upgrade config option only works in the initialization,\n // so make sure you set it when you create the library.\n upgrade: false\n}\n
"
269 | },
270 | {
271 | "method": {
272 | "name": "mixpanel.get_config",
273 | "arguments": []
274 | },
275 | "description": "returns the current config object for the library."
276 | },
277 | {
278 | "method": {
279 | "name": "mixpanel.get_property",
280 | "arguments": [
281 | {
282 | "name": "property_name",
283 | "type": "String",
284 | "isRequired": true,
285 | "description": "The name of the super property you want to retrieve"
286 | }
287 | ]
288 | },
289 | "description": "Returns the value of the super property named property_name. If no such property is set, get_property() will return the undefined value."
290 | },
291 | {
292 | "method": {
293 | "name": "mixpanel.people.set",
294 | "arguments": [
295 | {
296 | "name": "prop",
297 | "type": "Object or String",
298 | "isRequired": true,
299 | "description": "If a string, this is the name of the property. If an object, this is an associative array of names and values."
300 | },
301 | {
302 | "name": "to",
303 | "type": "*",
304 | "isRequired": false,
305 | "description": "A value to set on the given property name"
306 | },
307 | {
308 | "name": "callback",
309 | "type": "Function",
310 | "isRequired": false,
311 | "description": "If provided, the callback will be called after the tracking event"
312 | }
313 | ]
314 | },
315 | "description": "Set properties on a user record."
316 | },
317 | {
318 | "method": {
319 | "name": "mixpanel.people.set_once",
320 | "arguments": [
321 | {
322 | "name": "prop",
323 | "type": "Object or String",
324 | "isRequired": true,
325 | "description": "If a string, this is the name of the property. If an object, this is an associative array of names and values."
326 | },
327 | {
328 | "name": "to",
329 | "type": "*",
330 | "isRequired": false,
331 | "description": "A value to set on the given property name"
332 | },
333 | {
334 | "name": "callback",
335 | "type": "Function",
336 | "isRequired": false,
337 | "description": "If provided, the callback will be called after the tracking event"
338 | }
339 | ]
340 | },
341 | "description": "Set properties on a user record, only if they do not yet exist. This will not overwrite previous people property values, unlike people.set()."
342 | },
343 | {
344 | "method": {
345 | "name": "mixpanel.people.increment",
346 | "arguments": [
347 | {
348 | "name": "prop",
349 | "type": "Object or String",
350 | "isRequired": true,
351 | "description": "If a string, this is the name of the property. If an object, this is an associative array of names and numeric values."
352 | },
353 | {
354 | "name": "by",
355 | "type": "Number",
356 | "isRequired": false,
357 | "description": "An amount to increment the given property"
358 | },
359 | {
360 | "name": "callback",
361 | "type": "Function",
362 | "isRequired": false,
363 | "description": "If provided, the callback will be called after the tracking event"
364 | }
365 | ]
366 | },
367 | "description": "Increment/decrement numeric people analytics properties."
368 | },
369 | {
370 | "method": {
371 | "name": "mixpanel.people.append",
372 | "arguments": [
373 | {
374 | "name": "prop",
375 | "type": "Object or String",
376 | "isRequired": true,
377 | "description": "If a string, this is the name of the property. If an object, this is an associative array of names and values."
378 | },
379 | {
380 | "name": "value",
381 | "type": "*",
382 | "isRequired": false,
383 | "description": "An item to append to the list"
384 | },
385 | {
386 | "name": "callback",
387 | "type": "Function",
388 | "isRequired": false,
389 | "description": "If provided, the callback will be called after the tracking event"
390 | }
391 | ]
392 | },
393 | "description": "Append a value to a list-valued people analytics property."
394 | },
395 | {
396 | "method": {
397 | "name": "mixpanel.people.union",
398 | "arguments": [
399 | {
400 | "name": "prop",
401 | "type": "Object or String",
402 | "isRequired": true,
403 | "description": "If a string, this is the name of the property. If an object, this is an associative array of names and values."
404 | },
405 | {
406 | "name": "value",
407 | "type": "*",
408 | "isRequired": false,
409 | "description": "Value / values to merge with the given property"
410 | },
411 | {
412 | "name": "callback",
413 | "type": "Function",
414 | "isRequired": false,
415 | "description": "If provided, the callback will be called after the tracking event"
416 | }
417 | ]
418 | },
419 | "description": "Merge a given list with a list-valued people analytics property, excluding duplicate values."
420 | },
421 | {
422 | "method": {
423 | "name": "mixpanel.people.track_charge",
424 | "arguments": [
425 | {
426 | "name": "amount",
427 | "type": "Number",
428 | "isRequired": true,
429 | "description": "The amount of money charged to the current user"
430 | },
431 | {
432 | "name": "properties",
433 | "type": "Object",
434 | "isRequired": false,
435 | "description": "An associative array of properties associated with the charge"
436 | },
437 | {
438 | "name": "callback",
439 | "type": "Function",
440 | "isRequired": false,
441 | "description": "If provided, the callback will be called when the server responds"
442 | }
443 | ]
444 | },
445 | "description": "Record that you have charged the current user a certain amount of money. Charges recorded with track_charge() will appear in the Mixpanel revenue report."
446 | },
447 | {
448 | "method": {
449 | "name": "mixpanel.people.clear_charges",
450 | "arguments": [
451 | {
452 | "name": "callback",
453 | "type": "Function",
454 | "isRequired": false,
455 | "description": "If provided, the callback will be called after the tracking event"
456 | }
457 | ]
458 | },
459 | "description": "Permanently clear all revenue report transactions from the current user's people analytics profile."
460 | },
461 | {
462 | "method": {
463 | "name": "mixpanel.people.delete_user",
464 | "arguments": []
465 | },
466 | "description": "Permanently deletes the current people analytics profile from Mixpanel (using the current distinct_id)."
467 | }
468 | ]
469 |
--------------------------------------------------------------------------------