Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>

WEEK'S BEST

  • BackTrack 5 R1
  • Wine 1.2.3 / 1.4 RC4
  • Mozilla Firefox 10...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.2.7
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.1
  • Home > Linux > Internet > HTTP (WWW)

    pylons_gaq 0.0.4

    Download button

    No screenshots available
    Downloads: 40  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Jonathan Vanasco | More programs
    MIT/X Consortium Lic... / FREE
    February 9th, 2012, 14:21 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    pylons_gaq description

    Pylons framework support for simple Google Analytics implementations

    pyramid_gaq is a Python module that gives lightweight support for Google Analytics under pyramid

    It creates and manages a _gaq namespace under request.tmpl_context, which can be updated in handlers and templates, and printed out -- in the correct order -- via a helper function

    If you're just using _trackPageview, this package is likely overkill.

    But if you're using any of this functionality, then its for you:
    - custom variables for performance analytics
    - event tracking for backend interaction / operations
    - ecommerce tracking
    - rolling up multiple domains into 1 reporting suite

    This package lets you set GA code wherever needed, and renders everything in the 'correct' order.

    Every command has extensive docstrings, which also include, credit, and link to the relevant sections of the official GoogleAnalytics API docs.

    Supported Concepts & Commands

    * Core
    ** Choice of using a single , queued, "push" style command - or repeated ga.js API calls
    ** _setAccount
    * Multiple Domain Tracking
    ** _setDomainName
    ** _setAllowLinker
    * Custom Variables
    * _setCustomVar
    * eCommerce
    ** _addTrans
    ** _addItem
    ** _trackTrans
    * Event Tracking
    * _trackEvent

    Pylons and Pyramid

    if you're using pylons, there is also a pylons_gaq distribution that does the exact same thing.

        https://github.com/jvanasco/pylons_gaq

    if you're using pyramid, there is also a pyramid_gaq distribution that does the exact same thing.

        https://github.com/jvanasco/pyramid_gaq

    QuickStart

    import this into your helpers

    Dropping it into your helpers namespace makes it easier to use in templates like mako.

    lib/helpers.py


        from pyramid_gaq import *
       
    configure your BaseController to call gaq_setup on __init__

    This example is from my "pylons style hander".

    There are only two vars to submit:

    1. Your Google Analytics Account ID
    2. Whether or not your want to use the "Single Push" method, or a bunch of separate events.

    handlers/base.py

        class Handler(object):
            def __init__(self, request):
            self.request = request
            h.gaq_setup(request,'GA_ACCOUNT_ID',single_push=False)

    When you want to set a custom variable , or anything similar...

        h.gaq_setCustomVar(1,'TemplateVersion','A',3)
      
    To print this out..

    In my mako templates, I just have this...

        < head >
        ...
        ${h.gaq_print()|n}
        ...
        < /head >


    Notice that you have to escape under Mako. For more information on mako escape options - http://www.makotemplates.org/docs/filtering.html


    Product's homepage

    Requirements:

    · Python
    · pyramid

      


    TAGS:

    Pylons framework | Google Analytics | Google | Analytics | Pylons



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM