{
"info": {
"author": "Saxo Publish",
"author_email": "publish@saxo.com",
"bugtrack_url": null,
"classifiers": [
"Framework :: Django",
"Intended Audience :: Developers",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3"
],
"description": "==========================\ndjango-affiliate-tracking\n==========================\n\nA `Django `_ app to do affiliation tracking.\n\n.. image:: https://saxo.githost.io/publish/django-affiliate-tracking/badges/master/build.svg\n :alt: Build status\n :target: https://saxo.githost.io/publish/django-affiliate-tracking\n\n.. image:: https://saxo.githost.io/publish/django-affiliate-tracking/badges/master/coverage.svg\n :alt: Test coverage\n :target: https://saxo.githost.io/publish/django-affiliate-tracking\n\n\nAbout\n*****\n\nAnother similar app,\n`django-affiliate `_, also\nexists, which might suit your needs better.\n\nThe main difference between the two apps is that with ``django-affiliate`` you\nneed to mix your tracking logic into your regular business logic, while with\n``django-affiliate-tracking``, you can isolate your tracking logic into\nseparate modules and/or functions, thereby avoid polluting your regular\nbusiness logic with tracking logic. You can even create a separate app for all\nyour tracking, to do a full isolation and keep your existing apps reusable\nacross Django projects.\n\nThis is achieved by tying your tracking logic to Django signals via\nconfiguration. Thus, signals has to be emitted at the events that could\ntrigger the tracking. In most cases these signals already exist (e.g. on model\nsave). And otherwise, you could implement custom signals for these events in\nyour business logic that might also be useful outside a tracking scope (and\nthus not be as much of a pollution of your business logic).\n\nThis way, it's also easy to enable/disable triggers without having to rewrite\nyour apps or comment out tracking code each time you team up with a new partner\nor your deal with an existing partner expires. It's simply done by changing\nyour settings and/or updating partners, e.g. via the Django Admin.\n\nAs soon as all your triggers are configured, non-techical staff can even manage\npartners and trigger subscriptions via the Django Admin, reducing the need to\ninvolve developers and doing a new release of your project.\n\nWe prefer this approach, and thus saw the need for a new Django app. if\nyou don't care about separation, both apps will get your job done, and\n``django-affiliate`` might be the easier option for you.\n\n\nRequirements/support\n********************\n\n* Python (2.x, 3.x)\n* Django (1.9, 1.10, 1.11)\n\nAnd any combination of these.\n\n\nInstallation\n******************\n\nInstall the app from PyPi::\n\n $ pip install django-affiliate-tracking\n\nAdd the app to your Django project::\n\n INSTALLED_APPS = [\n ...\n 'affiliations',\n ...\n ]\n\nAnd add a couple of new middlewares::\n\n MIDDLEWARE_CLASSES = [\n ...\n 'tls.TLSRequestMiddleware',\n 'affiliations.middleware.AffiliateVisitorsRegistrationMiddleware',\n ]\n\nFinally migrate the app::\n\n $ ./manage.py migrate\n\n\nUsing the app\n************************\n\nThere is a ``dummy_project`` inside the app that should help you set up\na new project using the app, but we are giving more details about\nit below.\n\n\nSettings\n=============\n\nThe following new settings should be introduced in your settings file\nfor the project using the app:\n\n* ``AFFILIATE_QUERY_STRING_KEY`` \u2013 Optional name of the query string parameter\n that identifies which affiliate partner an incoming request is caused by. A\n default value of ``affiliate_id`` is assumed.\n* ``AFFILIATE_SESSION_KEY`` \u2013 Optional name of the session key that the visitor\n id is kept in. A default value of ``affiliate_visitor_id`` is assumed.\n* ``AFFILIATE_TRIGGERS`` \u2013 Mandatory list of 4 item tuples, defining which\n triggers should be enabled. The 4 items of each tuple should be:\n\n #. A \"pretty name\" for the trigger.\n #. A string defining a Python path to a signal that the trigger should be\n listening to.\n #. A string defining a Python path to the function that works as the signal\n reciever for the trigger.\n #. A valid value for the ``sender`` argument when connecting\n signal ``receivers``.\n\nAn example::\n\n [\n (\n 'User registered',\n 'django.db.models.signals.post_save',\n 'affiliations.triggers.object_created',\n 'django.contrib.auth.models.User',\n ),\n ]\n\n\nModels explanation\n******************\n\nA partner is someone you make an affiliate deal with. The partner will then\n(hopefully) generate traffic to your site. The initial referral should include\nthe partner ``uid`` in the query string (e.g.\n``https://www.yoursite.com/?affiliate_id=moox6esi``), to identify the traffic\nas originating from that particular partner::\n\n Partner\n * uid -- CharField, unique, 8 random alphanumeric characters.\n * name -- CharField, the name of the affiliate partner.\n * active -- BooleanField, whether there\u2019s an active affiliate deal with\n this partner.\n\n\nA subscription tells which triggers a partner subscribes to. The triggers in\nyour settings are not tied to specific partners (as you might have different\npartners sharing the same trigger), you need to tie a partner and a trigger\ntogether with a subscription. This also prevents you from accidentally paying\nPartner A for Trigger X without that being part of your agreement::\n\n Subscription\n * partner, ForeignKey\n * trigger, CharField -- the 'name' of one of the triggers defined in\n the settings.\n * callback_url -- UrlField, the partner callback URL for the given\n trigger event. Should have the placeholder ``{visitor_id}`` in it\n somewhere, e.g. as the value for a query string parameter. An\n example: https://www.yourpartner.com/track/?campaign_id=123&visitor_id={visitor_id}\n\n\nA visitor is someone who gets referred to your site by a partner. The\nmiddleware will detect that a request was caused by an affiliate partner and\nthen register a new visitor::\n\n Visitor\n * partner -- ForeignKey\n * user -- ForeignKey, nullable, references user model (remember to use\n ``get_user_model``).\n * referred_on -- datetime, auto_now_add=True.\n * entry_point -- UrlField, the URL at which the visitor entered\n your site.\n * successful_on -- datetime, nullable, tells the date the conditions of\n a \"success\" were met, if at all.\n\n\nTriggers\n*****************\n\n``django-affiliation-tracking`` comes with the two most basic triggers: ``object_created`` and ``object_saved``, located in the module ``affiliations.triggers``. They will probably serve 95% of your needs, if not all.\n\nThese can be used e.g. if you need to trigger when a new user registers or someone places an order in your shop.\n\nIf you need custom triggers, it's easy write your own. We'd recommend to take a look at or simply copy the built in triggers, to understand how triggers work, and built your own triggers with custom trigger logic on top of these.\n\nWhat they both basically do is to call ``affiliations.triggers.complete_trigger()`` (one of them wraps it in a simple ``if``), but you can wrap it in more complex logic if you need. E.g. to have a trigger that only triggers on Fridays for users between 25 and 50 years old. It all depends on your own needs.\n\nPlease note that ``affiliations.triggers.complete_trigger()`` takes care of verifying that the the there's actually an affiliation visitor for the request, that the partner of the visitor is active and that the partner is subscribed to the actual trigger being trigged. So you don't need to include these checks in your custom trigger logic. Only your own special needs, like day of week and age of the user.\n\n\nAuthors\n******************\n\n* Mikkel Munch Mortensen\n* S\u00f8ren Howe Gersager\n* Vladir Parrado Cruz\n\n\nMaintenance\n******************\n\nTo submit bugs, feature requests, submit patches, please use `the official repository `_.\n\n\nCopyright and licensing information\n***********************************\n\n\u00a9 Saxo.com A/S under a BSD License 2.0, 3-clause license.",
"description_content_type": null,
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://saxo.githost.io/publish/django-affiliate-tracking/",
"keywords": "django,affiliations",
"license": "BSD License 2.0",
"maintainer": "",
"maintainer_email": "",
"name": "django-affiliate-tracking",
"package_url": "https://pypi.org/project/django-affiliate-tracking/",
"platform": "",
"project_url": "https://pypi.org/project/django-affiliate-tracking/",
"project_urls": {
"Homepage": "https://saxo.githost.io/publish/django-affiliate-tracking/"
},
"release_url": "https://pypi.org/project/django-affiliate-tracking/0.12/",
"requires_dist": null,
"requires_python": "",
"summary": "A Django app providing mechanisms to track users and actions, to know when certain conditions are met.",
"version": "0.12"
},
"last_serial": 2999055,
"releases": {
"0.1": [
{
"comment_text": "",
"digests": {
"md5": "c18886c4397bd7a9e29a51896e169dd3",
"sha256": "2551690568324b123bba7021eab54a91d4dd443afc3312bf63387ed01a236961"
},
"downloads": -1,
"filename": "django-affiliate-tracking-0.1.tar.gz",
"has_sig": false,
"md5_digest": "c18886c4397bd7a9e29a51896e169dd3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 20929,
"upload_time": "2017-06-22T17:09:48",
"url": "https://files.pythonhosted.org/packages/a9/14/81ec17f5ae7d09442c3ecf8a0d3e511abedaff7f77459b67877dff07fddb/django-affiliate-tracking-0.1.tar.gz"
}
],
"0.11": [
{
"comment_text": "",
"digests": {
"md5": "dcc3f9ce3cfc0dc94f446c5a161d6973",
"sha256": "19199886acdf8b6b7e7f48084adadd7777a278a1302f4491239706a2a58023ad"
},
"downloads": -1,
"filename": "django-affiliate-tracking-0.11.tar.gz",
"has_sig": false,
"md5_digest": "dcc3f9ce3cfc0dc94f446c5a161d6973",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22127,
"upload_time": "2017-06-22T19:03:14",
"url": "https://files.pythonhosted.org/packages/95/a1/d65944f55c98297a65a754681efa48450650fc250e1dc44aeb435cf14253/django-affiliate-tracking-0.11.tar.gz"
}
],
"0.12": [
{
"comment_text": "",
"digests": {
"md5": "441e7e3e09bc70e178f389ab18b0a9a0",
"sha256": "4a9eebba3a4999479795c0a4aab511b56040729d5da11d1ea931a8c5a8204c3b"
},
"downloads": -1,
"filename": "django-affiliate-tracking-0.12.tar.gz",
"has_sig": false,
"md5_digest": "441e7e3e09bc70e178f389ab18b0a9a0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14422,
"upload_time": "2017-07-04T12:54:55",
"url": "https://files.pythonhosted.org/packages/3f/ed/fd63c4a553b8d086c9b7ce56c53c7187da1e175c3bc522cd0cd9b2c97b2c/django-affiliate-tracking-0.12.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "441e7e3e09bc70e178f389ab18b0a9a0",
"sha256": "4a9eebba3a4999479795c0a4aab511b56040729d5da11d1ea931a8c5a8204c3b"
},
"downloads": -1,
"filename": "django-affiliate-tracking-0.12.tar.gz",
"has_sig": false,
"md5_digest": "441e7e3e09bc70e178f389ab18b0a9a0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14422,
"upload_time": "2017-07-04T12:54:55",
"url": "https://files.pythonhosted.org/packages/3f/ed/fd63c4a553b8d086c9b7ce56c53c7187da1e175c3bc522cd0cd9b2c97b2c/django-affiliate-tracking-0.12.tar.gz"
}
]
}