Giter VIP home page Giter VIP logo

django-tracking-analyzer's Introduction

Django Tracking Analyzer

User actions tracking and analytics for Django sites

Requirements

Installation

  1. Install Django Tracking Analyzer from PyPI by using pip:

    pip install django-tracking-analyzer
  2. Add 'django_user_agents' and 'tracking_analyzer' entries to Django INSTALLED_APPS setting.
  3. Run the migrations to load the Tracker model in your database:

    python manage.py migrate tracking_analyzer
  4. Install the MaxMind® GeoIP2 datasets. You can do this in two ways:

    4.1. By running the provided management command for this:

    python manage.py install_geoip_dataset

    4.2. Or manually, by following the instructions in GeoIP2 Django documentation.

After following those steps, you should be ready to go.

Explanation - Quickstart

Django Tracking Analyzer is a Django pluggable application which helps you providing usage statistics and visitors data for your Django sites.

DTA does this by recording requests data in those places you want to by saving Tracker's. A Tracker is a Django database model which holds all the data related to a request, including geolocation via IP address and device or browser specifications.

When some data is collected, the Django admin interface for Tracker model implements some interactive widgets to help you visualize better the data.

Now let's see how can you start collecting users data. Imagine the most basic example: you have a web blog and you want to check the visits to your posts, having a resume of who accessed the posts, when and from where. In such a Django site, you might have a view PostDetailView, where a blog post will be served by passing its slug in the URL. Something like this:

class PostDetailView(DetailView):
    model = Post

Okay, so you can track the users who access blog posts by their instances with DTA, just like this:

class PostDetailView(DetailView):
    model = Post

    def get_object(self, queryset=None):
        # Retrieve the blog post just using `get_object` functionality.
        obj = super(PostDetailView, self).get_object(queryset)

        # Track the users access to the blog by post!
        Tracker.objects.create_from_request(self.request, obj)

        return obj

And you are now on your way to collect users data! Now give it a time (or better access the resource yourself several times) and go check your Django admin in the "Django Tracking Analyzer" - "Trackers" section. Enjoy!

Documentation

For extensive documentation and usage explanations, you can check Read the Docs.

Acknowledgements

Django Tracking Analyzer makes use of this technologies and apps, without which it wouldn't be possible:

django-tracking-analyzer's People

Contributors

jose-lpa avatar zackaryia avatar cr0hn avatar enriquesoria avatar tnory56 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.