iamsteadman/bambu-analytics — pull request #2 by imposeren (2014-11-20 17:54:01+00:00)
Title: Track userID

This changes make it possible to track UserID.

Just use request.user.pk as UserID:
```python
ANALYTICS_SETTINGS = {
'UniversalAnalyticsProvider': {
'ID': 'UA-XXXXX-XX',
'TRACK_USER_ID': True,
}
}
```

It's possible to use anything available from request as UserID. For example if developer defines some middleware that sets `request.analytics_id` even for anonymous users than developer can use it as UserID:

```python
ANALYTICS_SETTINGS = {
'UniversalAnalyticsProvider': {
'ID': 'UA-XXXXX-XX',
'TRACK_USER_ID': True,
'GET_USER_ID_FUNC': getattr(getattr(request, 'analytics_id', None), 'pk', None),
}
}
```