8000 GitHub - junckritter/gadjango: Django app for Performance Monitoring with Google Analytics
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

junckritter/gadjango

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Django app for Performance Monitoring with Google Analytics

Send perfomance data to Google Analytics, you can view it in Content > Site Speed > User Timings.
Heavily inspired by Garelic Rails gem by Jan Suchal.

Installation.

  1. Download

     pip install git+https://github.com/junckritter/gadjango
    
  2. Add middleware to your settings

     MIDDLEWARE_CLASSES = (
         'gadjango.middleware.TimingMiddleware',
         ...
         ...
     )
    
  3. Add GADjango to INSTALLED_APPS

     INSTALLED_APPS = (
         ...,
         gadjango,
         ...,
     )
    
  4. Include timing.html template into Google Analytics JavaScript element

     <script type="text/javascript">
         var _gaq = _gaq || [];
         _gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
         _gaq.push(['_setSiteSpeedSampleRate', 100]);
         _gaq.push(['_trackPageview']);
    
         {% include "gadjango/timing.html" %}
    
         (function() {
             var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
             ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
             var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
         })();
     </script>
    

About

Django app for Performance Monitoring with Google Analytics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0