Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 2.08 KB

File metadata and controls

39 lines (28 loc) · 2.08 KB

ANALYTICS IN HDX

Useful information about HDX and Mixpanel

There will be 3 mixpanel projects:

  1. For the production server
  2. For the testing/feature servers
  3. For local servers running on dev's computers

Setup steps for sending events to the mixpanel servers

  1. The mixpanel token needs to be setup in prod.ini under hdx.analytics.mixpanel.token

  2. The url to the enqueuing service needs to be setup in prod.ini as in hdx.analytics.enqueue_url = http://[gislayer_host]:[gislayer_port]/api/send-analytics

  3. The gislayer needs to be setup with the latest code. It's dependencies were updated as well ( requirements.txt )

    • there is a new queue for processing analytics requests called analytics_q. So we need a rq worker listening on it. We can either use a separate worker for each queue or workers that listen on both queues.
    • Information about how to run the rqworker can be found in Running the redis queue worker for analytics

Setup steps for seeing mixpanel stats in HDX

  1. The latest schema.xml needs to be used in solr

  2. The mixpanel secret must be set in prod.ini under hdx.analytics.mixpanel.secret = OVERWRITE_WITH_SECRET_FROM_MP_PROJECT

  3. By default (as set in common-config-ini.txt) the time for cache expiration is 1h. The setting responsible for this is hdx.analytics.hours_for_results_in_cache. We should set this to 12 hours.

  4. There is a new paster command that updates solr with the latest information from mixpanel. Please note that the information is actually taken from the same cache:

    /srv/ckan/ckanext-hdx_theme
    paster analytics-changes-reindex -c /srv/configs/prod.ini
    

    This should be run every 24 hours