Skip to main content

Django app used to pull daily Google Analytics data into your django database.

Project description


Django app used to pull daily Google Analytics data into your django database. It provides abstract models which you should
inherit from in your app.

To Use

Add the app to your file:


In your app,

Create models that inherit from the abstract classes provided. Here is a sample of a basic implementation:

from ga_puller.models import AnalyticsPage, DailyEventTrackingBase, DailyPageTrackingBase

class Page(AnalyticsPage):

def __unicode__(self):
return "%s" % self.page_path

class DailyEventData(DailyEventTrackingBase):

page = models.ForeignKey('Page')

def get_page_class(cls):
return Page

class DailyPageTrackingData(DailyPageTrackingBase):

page = models.ForeignKey('Page')

def get_page_class(cls):
return Page

Add a list named analytics_import_models defining the data models to the of your app module:

from models import DailyPageTrackingData, DailyEventData
analytics_import_models = [DailyPageTrackingData, DailyEventData]

Create a 'private' python package at the root level of your django project (at the same level as the file).

The application requires a service account for authentication with Google. These can be configured by logging into your account at

Copy your Google API private key file to the private directory (name it privatekey.pem).

Create a python file named '' in the private directory with the following code (update with your account data):

service_account = ''
view_ids = {'app_name': '#########', ...}

This package uses [Google APIs Client Library for Python]( which should automatically be installed through setup.

Release Notes:

0.1.0: Initial Release
0.1.1: Updated to support importing from separate views in google analytics.
0.1.2: Increased the size of the label and page_path fields.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-ga-puller, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size django-ga-puller-0.1.4.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page