This script loops over 10 campaigns (no order specified) and sends those stats for each of them for “LAST_7_DAYS”. If you want those stats for any other window, change it in line 2 by changing the value against LOOKUP_WINDOW. The options are available here.
You have to provide the API url of the hipchat room that receives the messages. Login to hipchat.com web interface as an Admin. Go to Integrations of the room, click “New”. Click the Create button under the “Build Your Own!”, and name the integration to something you remember. Click Configure on the integration, and note the field “Send messages to this room by posting to this URL”. The url will look like: https://api.hipchat.com/v2/room/(room-id)/notification?auth_token=(token). That’s the API url. Please paste in line 1 against ROOM_API_ENDPOINT.
Let me know if you face any issues. If you want different stats or pick campaigns in some order or something else, let me know and I’ll change it.
For Account level KPI
I wrote another variant of this script that just provides the KPI for the account.
Impressions,
Clicks,
CTR,
Avg CPC,
Cost,
Average Position,
Converted Clicks,
Cost Per Converted Click,
Click Conversion Rate
You can change the LOOKUP_WINDOW like above in line 2. The options are available here.
You also have to provide the API url of the hipchat room that receives the messages. Please paste in line 1 against ROOM_API_ENDPOINT.