This is sample project to show how to do analytics on Ad Campaigns
- Python
- Druid
- Imply
- Django
- We need to setup Druid which is used for analytics, once Druid/Imply to setup, install requirements specified in
requirements.txt
in an virtualenv. - Once setup is complete, start Imply
bin/supervise -c conf/supervise/quickstart.conf
. You need to be in imply-2.2.3 folder - Start REST server
python manage.py runserver
. You need to be in analytics(src code) folder.
- You can use Pivot to do visual analysis on the data.
- You can also use Rest API to get similar data.
URL
- <api/v1/metrics/campaign/(campaign_id)>
-
Method:
<GET>
-
URL Params
<campaign_id>
Required:
campaign_id=[integer]
-
Success Response:
- Code: 200
Content:json [{"event": {"adId": "AdID","impressions": IMPRESSION,"interactions": INTERACTIONS,"swipes": SWIPES}, timestamp": "TIMESTAMP","version": "v1"}]
- Code: 200
-
Error Response:
- Code: 500
Content:{ error : "Internal server Error" }
- Code: 500
-
Sample Call:
<_http GET http://localhost:8000/api/v1/metrics/campaign/105._>
URL
- <api/v1/api/v1/metrics/last_week>
-
Method:
<GET>
-
Success Response:
- Code: 200
Content:json [ { "event": { "adId": "AdId", "impressions": IMPRESSIONS, "user": USER }, "timestamp": "TIMESTAMP", "version": "v1" }]
- Code: 200
-
Error Response:
- Code: 500
Content:{ error : "Internal server Error" }
- Code: 500
-
Sample Call: