Skip to content
Woopra SDK for Python
Branch: master
Clone or download
philosoralphter Merge pull request #8 from a-olszewski/master
build / setting ip address fix
Latest commit f75ab49 Nov 15, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
build/lib setting ip address fix Nov 15, 2017
woopra Fixed ip_address typo Mar 18, 2017
.gitignore Updates .gitignore to ignore egg info and dist/ directory. Jan 20, 2016
CHANGES.txt Add some python package files Jan 20, 2014
LICENSE.txt renamed package to Woopra Dec 22, 2016
setup.cfg Fixes README and setup.cfg so we can use .md format. Jan 20, 2016

Track customers directly in Python using Woopra's Python SDK

The purpose of this SDK is to allow our customers who have servers running Python to track their users by writing only Python code. Tracking directly in Python will allow you to track your users through the back-end without having to handle http requests manually.


 pip install woopra


 pip install git+


The first step is to setup the tracker SDK. To do so, configure the tracker instance as follows (replace with your website as registered on Woopra):

#import the SDK
from woopra import WoopraTracker

woopra = WoopraTracker("")

You can configure the cookie value - To Woopra, this is equivalent to the browser cookie or anonymous user ID - required only if the user is not identified with an email or an id property


You can also configure the timeout (in milliseconds, defaults to 30000 - equivalent to 30 seconds) after which the event will expire and the visit will be marked as offline:

# set the timeout to 15 seconds:

You can also configure the source ip address:


You can also configure the user agent:


You can also configure the secure (https) tracking:


To identify a user, you should use the identify() function. You can choose to identify the visitor with his EMAIL, or with a UNIQUE_ID of your choice (in this case, make sure to re-use the same ID for a given visitor accross different visits).

		'email' : '',
		'name' : 'Tigi Brombo',
		'admin' : False

And you're ready to start tracking events:

woopra.track("play", {
	"artist" : "Dave Brubeck",
	"song" : "Take Five",
	"genre" : "Jazz"

Or just push the user information (without event tracking) by doing:

You can’t perform that action at this time.