Tracking pixels made easy
Project description
=============================
django-pixels
=============================
Tracking pixels made easy
Features
----------
* Built-in view to serve a pixel response
* Compose pixel tracking urls with different type IDs
* Route tracking requests to functions using type IDs
Implementation Notes with Short Examples
----------
Install django-pixels::
pip install django-pixels
Mount pixel tracking URL patterns:
.. code-block:: python
urlpatterns = [
...
url(r'^tracker/', include('django_pixels.urls', namespace="pixels")),
...
]
Get the general pixel tracking url (This serves a transparent pixel as the response):
.. code-block:: python
from django.core.urlresolvers import reverse
tracking_url = reverse('pixels:pixel') # given you have mounted django_pixels urls with namespace='pixels'
Get the tracking url with no-content(204) response (This serves an empty response with code 204):
.. code-block:: python
from django.core.urlresolvers import reverse
tracking_url = reverse('pixels:pixel-204') # given you have mounted django_pixels urls with namespace='pixels'
Generate a pixel tracking url with type 1:
.. code-block:: python
from django_pixels import utils
utils.compose_pixel_url(tracking_url, 1)
Write a function to handle tracking calls with type 1:
.. code-block:: python
def track_emails(request):
# handle tracking with the passed HttpRequest instance
Register the function to handle tracking calls with type 1:
.. code-block:: python
from django_pixels import handlers
handlers.register(1, track_emails)
Or mark a function to handle tracking calls with type 2:
.. code-block:: python
from django_pixels import handlers
@handlers.track(type_id=2)
def track_emails(request):
# handle tracking with the passed HttpRequest instance
Settings
----------
* PIXELS_TYPE_PARAMETER_NAME - Change the parameter name used for tracking type
Credits
-------
Tools used in rendering this package:
* Cookiecutter_
* `cookiecutter-djangopackage`_
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage
History
-------
0.1 (2016-12-10)
++++++++++++++++++
* First release on PyPI.
django-pixels
=============================
Tracking pixels made easy
Features
----------
* Built-in view to serve a pixel response
* Compose pixel tracking urls with different type IDs
* Route tracking requests to functions using type IDs
Implementation Notes with Short Examples
----------
Install django-pixels::
pip install django-pixels
Mount pixel tracking URL patterns:
.. code-block:: python
urlpatterns = [
...
url(r'^tracker/', include('django_pixels.urls', namespace="pixels")),
...
]
Get the general pixel tracking url (This serves a transparent pixel as the response):
.. code-block:: python
from django.core.urlresolvers import reverse
tracking_url = reverse('pixels:pixel') # given you have mounted django_pixels urls with namespace='pixels'
Get the tracking url with no-content(204) response (This serves an empty response with code 204):
.. code-block:: python
from django.core.urlresolvers import reverse
tracking_url = reverse('pixels:pixel-204') # given you have mounted django_pixels urls with namespace='pixels'
Generate a pixel tracking url with type 1:
.. code-block:: python
from django_pixels import utils
utils.compose_pixel_url(tracking_url, 1)
Write a function to handle tracking calls with type 1:
.. code-block:: python
def track_emails(request):
# handle tracking with the passed HttpRequest instance
Register the function to handle tracking calls with type 1:
.. code-block:: python
from django_pixels import handlers
handlers.register(1, track_emails)
Or mark a function to handle tracking calls with type 2:
.. code-block:: python
from django_pixels import handlers
@handlers.track(type_id=2)
def track_emails(request):
# handle tracking with the passed HttpRequest instance
Settings
----------
* PIXELS_TYPE_PARAMETER_NAME - Change the parameter name used for tracking type
Credits
-------
Tools used in rendering this package:
* Cookiecutter_
* `cookiecutter-djangopackage`_
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage
History
-------
0.1 (2016-12-10)
++++++++++++++++++
* First release on PyPI.
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 Distribution
django-pixels-0.2.tar.gz
(4.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-pixels-0.2.tar.gz.
File metadata
- Download URL: django-pixels-0.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
555f2948a3a40f890eb3b9218e2fce5cd7b51f9a7644f04d914589820c55d146
|
|
| MD5 |
dbd965015c1197faeac7f7196990c8b2
|
|
| BLAKE2b-256 |
efd5b82074473ad2b06e7015fe6b4c242f6af96414caa3a3e73140f33611deb6
|
File details
Details for the file django_pixels-0.2-py2.py3-none-any.whl.
File metadata
- Download URL: django_pixels-0.2-py2.py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb469d27351a996a17788944498e1f7e0b244f64699a8154acc718e71995f86a
|
|
| MD5 |
ca4d33e5f71dbc5587caf39daf40eaba
|
|
| BLAKE2b-256 |
cb045ecab13a5e08ef6a07293b31cd1d08df30f12632fa18bdb9526260e5ae92
|