Custom Tracks
There few options of how you can add your own track types, here two examples:
-
Using
utils
functionselftracking_add_track_to_redis
, which acceptsdict
like this:This will store your custom track at Redis and will be stored in DB oncedata = { "path": PATH, "user": USER_ID, "type": TRACK_TYPE, "track_time": datetime.utcnow().timestamp(), } selftracking_add_track_to_redis(data)
selftracking_store_tracks
action is called. -
Using javascript that will file on item click (e.g. links like Resource Download):
<a class="" href="{{ PATH }}" data-module="selftracking-track-click" data-module-activity="{{ TRACK_TYPE }}" data-module-path="{{ PATH }}"> <i class="fas fa-scroll" aria-hidden="true"></i> </a>
user
andtrack_time
will added in the action automatically.It will send an ajax call to CKAN that will store you custom track.