2014-09-05 10:50:56 +02:00
|
|
|
---
|
2017-10-28 18:09:18 +02:00
|
|
|
title: Analytics libraries
|
2018-12-06 23:15:40 +01:00
|
|
|
category: Analytics
|
2014-09-05 10:50:56 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
### Mixpanel
|
|
|
|
|
2017-10-28 18:09:18 +02:00
|
|
|
```js
|
|
|
|
mixpanel.identify('284');
|
|
|
|
mixpanel.people.set({ $email: 'hi@gmail.com' });
|
|
|
|
mixpanel.register({ age: 28, gender: 'male' }); /* set common properties */
|
|
|
|
```
|
2014-09-05 10:50:56 +02:00
|
|
|
|
2017-10-28 18:09:18 +02:00
|
|
|
[mixpanel](./mixpanel)
|
|
|
|
{: .-crosslink}
|
2014-09-05 10:50:56 +02:00
|
|
|
|
2017-10-28 18:09:18 +02:00
|
|
|
### Google Analytics's analytics.js
|
2014-09-05 10:50:56 +02:00
|
|
|
|
2017-10-28 18:09:18 +02:00
|
|
|
```js
|
|
|
|
ga('create', 'UA-XXXX-Y', 'auto');
|
|
|
|
ga('create', 'UA-XXXX-Y', { userId: 'USER_ID' });
|
|
|
|
```
|
2014-09-05 10:50:56 +02:00
|
|
|
|
2017-10-28 18:09:18 +02:00
|
|
|
```js
|
|
|
|
ga('send', 'pageview');
|
|
|
|
ga('send', 'pageview', { 'dimension15': 'My custom dimension' });
|
|
|
|
```
|
2014-09-05 10:50:56 +02:00
|
|
|
|
2017-10-28 18:09:18 +02:00
|
|
|
[analytics.js](./analytics.js)
|
|
|
|
{: .-crosslink}
|