Keeps track of requests made on a website like affiliate links, banners or visits. Groups unique sessions together for better reporting. This is based more on following the users behavior on the site
sidSID is the unique session ID to map multiple tracking records to a single session to better track user behavior.actionAction is either view or clicknameA name(campaign, page, product or link name),domainDomain / website (with no http:// or www)pathPath of the url requestedrefererWhere its coming frompageidID of the page (Incase the name or url ever changes)item_typeAn item type (link, banner, product, page, redirect, etc)item_idID of the item being tracked (banner, product, link, page, etc)item_ctypeContent Type namecounterCurrent count (will increment for duplicate requests)ipaddressIP Address of the useradminAdmin boolean to filter out admin / testing requests from actual viewsuaHTTP User Agent stringcreatedThe datetime createdredirect_toIf redirect_to has a url, we are redirecting to that url after tracking.
Add a TRACK_IT bool to your settings.py file. Use the following import statement to flick TRACK_IT to False if any issues occur.
try:
from sciweb_tracker import *
except ImportError:
TRACK_IT = False- Adding a new site visit / entrance (unique IP is not found, entrance if SID is not found)
if TRACK_IT:
t = Tracking.objects.trackit(sid='xxxxxx', action='view', name='campaign1',
domain='mysite.com', path='page2.html',
pageid=123, ipaddress='x.x.x.x', ua='USER_AGENT')- Adding an additional pageview
(If action=view && session/ip/path are same within 5 min, append counter instead of creating a new object)
if TRACK_IT:
t = Tracking.objects.trackit(sid='xxxxxx', action='view', name='campaign1',
domain='mysite.com', path='page5.html',
pageid=123, ipaddress='x.x.x.x', ua='USER_AGENT')- Record a click event on item & redirect
(If the item, item_id, and domain are same, it will increment the counter. )
if TRACK_IT:
t = Tracking.objects.trackit(sid='abc123', action='click', name='campaign1',
domain='mysite.com', path='page10.html',
item_type='banner', item_ctype='banners',
item_id=123, ipaddress='x.x.x.x', ua='USER_AGENT')