Simple Heap analytics integration
Project description
Heap is a unique new service that automatically captures all user actions on your site including UI interaction.
This library helps developers integrate Heap analytics into their Django projects.
Installation
Install using pip:
pip install django-heap
Basic usage
Add heap to installed apps:
INSTALLED_APPS = ( ... 'heap', )
There is no need to run manage.py syncdb since django-heap has no database tables. Add the heap context processor:
TEMPLATE_CONTEXT_PROCESSORS = ( ... 'heap.context_processors.heap', )
Finally, configure the app ID in settings.py:
HEAP_APP_ID = '12345...'
To enable Heap tracking, you must include the script tag snippet in your template like so:
<head> .... {% include 'heap/script.html' %} </head>
Now you are ready to start tracking.
Tracking superusers
By default, django-heap tracks your site’s superusers as well. You can disable this by setting the HEAP_TRACK_SUPERUSER flag to False. This prevents the script tag template from rendering when user has is_superuser property set to True.
Automatic identification of users
django-heap can automatically call heap.identify with data from the authenticated user. To do that, you need to set the HEAP_AUTO_ID_USER setting to True (disabled by default). Only authenticated users will be identify. The User object’s get_full_name method will be used to derive the name parameter for the identify call, and if User object has an email field, the email parameter will also be passed. There is currently no handling for the cases where get_full_name returns the user’s email address.
Note This implementation is currently experimental, so please do it manually in the BODY tag as suggested by Heap documentation if you find it doesn’t work for you.
Customizing django-heap
You can customize django-heap by simply overriding the default template. There is currently no direct support for custom tracking calls, but it is planned for the next release.
Reporting bugs
Please report bugs to our BitBucket issue tracker.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
File details
Details for the file django-heap-0.0.2.zip
.
File metadata
- Download URL: django-heap-0.0.2.zip
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e64b079b51f7ada314b830e512887fcba4b49f3e2d090a06021424707d6cf760 |
|
MD5 | bc2be349b20c8de00890a530e2f2ff30 |
|
BLAKE2b-256 | a1b8fa54f5c66905ca4a2ad7f276457a10adf3280b6c15d8c4bf1a3d025f8283 |
File details
Details for the file django-heap-0.0.2.tar.gz
.
File metadata
- Download URL: django-heap-0.0.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c32832d9e0571569b9b3de69e00bc1af8c08ada5586e0c7c91e7e940d5aa2d6 |
|
MD5 | 013017dd2b104e4b2e3340c112eea86c |
|
BLAKE2b-256 | 15f86b6f8dd6f7ec2a10badfae0da2b825fcf6f1c32504b6ec3d7feabc696cbf |