{"id":108,"date":"2012-06-04T14:11:45","date_gmt":"2012-06-04T13:11:45","guid":{"rendered":"http:\/\/tempdetheux.food.blog\/2012\/06\/04\/zendesk-enterprise-global-satisfaction-score\/"},"modified":"2019-07-19T17:02:05","modified_gmt":"2019-07-19T15:02:05","slug":"zendesk-enterprise-global-satisfaction-score","status":"publish","type":"post","link":"https:\/\/arnaud.detheux.org\/blog\/zendesk-enterprise-global-satisfaction-score\/","title":{"rendered":"Zendesk Enterprise: global satisfaction score"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p>One of my biggest grief about the <a href=\"http:\/\/www.zendesk.com\/product\/enterprise\" target=\"_blank\" rel=\"noopener noreferrer\">Enterprise plan of Zendesk<\/a> is its lack of support for the satisfaction score. I mean, all accounts have their own satisfaction score like on a regular plan but we lack a way to have the global score of all branded spokes added to the one of the main hub.<\/p>\n<p>I needed this. So I fixored this&nbsp;\ud83d\ude42&nbsp;. Plus, the following Python script will calculate your satisfaction score even if you have less than 100 satisfaction feedback on your account. And finally, I push the score to <a href=\"http:\/\/www.ducksboard.com\" target=\"_blank\" rel=\"noopener noreferrer\">Ducksboard<\/a>, a very cool real time dashboard in which you can see all your business metrics.<\/p>\n<p>So basically, a simple Python scripts reads the account.zendesk.com\/satisfaction.json file, counts the number of 0 (bad) and 1 (good) feedbacks. It does this for each of your accounts so you can add more than the 3 I have below. Then some simple maths are applied to make a sum of all good and back feedbacks and give you a result in percent.<\/p>\n<p>You need to trigger this script via a cron tab, for example, so that every x hour the latest data from your Zendesk accounts will be read. And at that moment it will also shoot the results to the Ducksboard API (I just left the code there, simply delete this if you don\u2019t need it).<\/p>\n<p>My second grief about the Enterprise plan is that it lacks the support of placeholders throughout the spokes (for automated emails, like <em>hello {{ticket_requester_name}} <\/em>), but that\u2019s for another post&nbsp;\ud83d\ude09<\/p>\n<p>The script<\/p>\n<pre>#!\/usr\/bin\/env python<\/pre>\n<pre>\"\"\"Fetches the satisfaction score of Zendesk spokes and gathers it in one spot. You will need to call this script with a CRON so that it is launched every day, for example.\nAs a bonus, I left the code about Ducksboard. It's a cool system to display BI and monitoring stuff regarding your service. Simply replace the API_KEY and END_POINT values.\"\"\"<\/pre>\n<pre>__author__ = \"Arnaud de Theux\"\n__web__ = \"http:\/\/arnaud.detheux.org\"\n__twitter__ = \"@AdeTheux\"<\/pre>\n<pre>from urllib import urlopen\nimport urllib\nimport sys\nimport os<\/pre>\n<pre>###Below the 3 spokes we have at the moment, simply put your Zendesk account name\n#spoke 1\ngood = 0\nbad = 0\ndata = urlopen(\"http:\/\/SPOKE1.zendesk.com\/satisfaction.json\").readlines()[0]\ngood = data.count('1')\nbad = data.count('0')<\/pre>\n<pre>#spoke 2\ngood1 = 0\nbad1 = 0\ndata = urlopen(\"http:\/\/SPOKE2.zendesk.com\/satisfaction.json\").readlines()[0]\ngood1 = data.count('1')\nbad1 = data.count('0')<\/pre>\n<pre>#spoke 3\ngood2 = 0\nbad2 = 0\ndata = urlopen(\"http:\/\/SPOKE3.zendesk.com\/satisfaction.json\").readlines()[0]\ngood2 = data.count('1')\nbad2 = data.count('0')<\/pre>\n<pre>###Makes a simple addition\nsum_good = good + good1 + good2\nsum_bad = bad + bad1 + bad2<\/pre>\n<pre>###You can now simply call sum_good and sum_bad to display it all over the interwebs.<\/pre>\n<pre>###This is the code to push the values in bubbles in your Ducksboard account\ncommand = \"curl -u API_KEY:ignored -d '{\"value\": %d}' https:\/\/push.ducksboard.com\/values\/END_POINT\/\" % sum_good\ncommand2 = \"curl -u API_KEY:ignored -d '{\"value\": %d}' https:\/\/push.ducksboard.com\/values\/END_POINT\/\" % sum_bad<\/pre>\n<pre>print command\nos.system(command)\nprint command2\nos.system(command2)<\/pre>\n<pre>Demo\nWell in this case there is not much to show :) Either you just run the script and return the results wherever you want, or you push them to Ducksboard and it can look like this:<\/pre>\n<figure><img decoding=\"async\" data-width=\"321\" data-height=\"160\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/0*na8J3T5dbTsnLPcb.png\"><\/figure>\n<pre>Code\nThe source code is available <a href=\"https:\/\/github.com\/AdeTheux\/Zendesk-widgets\/blob\/master\/zendesk_enterprise_satisfaction.py\" title=\"GitHub\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>One of my biggest grief about the Enterprise plan of Zendesk is its lack of support for the satisfaction score. I mean, all accounts have their own satisfaction score like on a regular plan but we lack a way to have the global score of all branded spokes added to the one of the main&hellip;<\/p>\n<p class=\"read-more\"><a class=\"readmore-btn\" href=\"https:\/\/arnaud.detheux.org\/blog\/zendesk-enterprise-global-satisfaction-score\/\">Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_post_was_ever_published":false},"categories":[7],"tags":[63,20,22,24,30,51,57],"class_list":["post-108","post","type-post","status-publish","format-standard","hentry","category-customer-experience","tag-archive","tag-customer-support","tag-ducksboard","tag-enterprise","tag-hack","tag-satisfaction","tag-zendesk"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/arnaud.detheux.org\/blog\/wp-json\/wp\/v2\/posts\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arnaud.detheux.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arnaud.detheux.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arnaud.detheux.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arnaud.detheux.org\/blog\/wp-json\/wp\/v2\/comments?post=108"}],"version-history":[{"count":2,"href":"https:\/\/arnaud.detheux.org\/blog\/wp-json\/wp\/v2\/posts\/108\/revisions"}],"predecessor-version":[{"id":452,"href":"https:\/\/arnaud.detheux.org\/blog\/wp-json\/wp\/v2\/posts\/108\/revisions\/452"}],"wp:attachment":[{"href":"https:\/\/arnaud.detheux.org\/blog\/wp-json\/wp\/v2\/media?parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arnaud.detheux.org\/blog\/wp-json\/wp\/v2\/categories?post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arnaud.detheux.org\/blog\/wp-json\/wp\/v2\/tags?post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}