|
38 | 38 | var userStats = {}; |
39 | 39 | var departmentStats = {}; |
40 | 40 | var timeStats = { morning: 0, afternoon: 0, evening: 0, night: 0 }; |
41 | | - var abandonmentReasons = {}; |
42 | 41 | var totalAbandoned = 0; |
43 | 42 | var totalCompleted = 0; |
44 | 43 |
|
45 | 44 | // Process each conversation |
46 | 45 | conversations.query(); |
47 | 46 | while (conversations.next()) { |
48 | | - var topicId = conversations.getValue('topic'); |
49 | 47 | var topicName = conversations.topic.getDisplayValue() || 'Unknown Topic'; |
50 | 48 | var userId = conversations.getValue('user'); |
51 | 49 | var state = conversations.getValue('state'); |
|
203 | 201 | gs.info('Abandoned: ' + totalAbandoned + ' (' + ((totalAbandoned / totalConversations) * 100).toFixed(1) + '%)'); |
204 | 202 | gs.info('Average Daily Conversations: ' + (totalConversations / config.daysToAnalyze).toFixed(1)); |
205 | 203 |
|
206 | | - // Recommendations |
207 | | - gs.info(''); |
208 | | - gs.info('=== Recommendations ==='); |
209 | | - gs.info(''); |
210 | | - |
211 | | - var highAbandonTopics = topicArray.filter(function(t) { |
212 | | - return parseFloat(t.abandonRate) > 30 && t.total >= config.minConversations; |
213 | | - }); |
214 | | - |
215 | | - if (highAbandonTopics.length > 0) { |
216 | | - gs.info('🔍 Review ' + highAbandonTopics.length + ' topic(s) with high abandonment rates'); |
217 | | - } |
218 | | - |
219 | | - if (timeStats.night > (totalConversations * 0.1)) { |
220 | | - gs.info('🌙 Significant night-time usage detected (' + timeStats.night + ' conversations) - consider 24/7 support topics'); |
221 | | - } |
222 | | - |
223 | | - if (totalUsers > 0 && (totalConversations / totalUsers) < 2) { |
224 | | - gs.info('📢 Low engagement (avg ' + (totalConversations / totalUsers).toFixed(1) + ' conversations/user) - consider promoting VA to increase awareness'); |
225 | | - } |
226 | | - |
227 | | - if ((totalCompleted / totalConversations) > 0.85) { |
228 | | - gs.info('✅ High completion rate (' + ((totalCompleted / totalConversations) * 100).toFixed(1) + '%) - VA is performing well!'); |
229 | | - } |
230 | 204 |
|
231 | 205 | gs.info(''); |
232 | 206 | gs.info('=== Analysis Complete ==='); |
|
0 commit comments