Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Google Analytics email me if (crashes and) exceptions occur?

Google Analytics is correctly reporting exceptions thrown by my Android app. And I can use Scheduled Emails to send this report to me. However, receiving a daily email when there isn't anything to report (i.e., the report tells me that zero exceptions occurred) is tedious. Thus, I'd like to receive emails only when there is something to report (i.e., the report tells me that one or more exceptions occurred). It seems that Custom Alerts can be used for this purpose. However, Custom Alerts do not appear to be compatible with Exceptions. This leads me to my question.

Can Custom Alerts be configured to provide email notification on exceptions?

Or, more generally,

Can Google Analytics be configured to provide email notification on exceptions?

Also, does this work for crashes too?

UPDATE (22 Nov 2015, 1 Dec 2015)

(Partial) answer. I provide an answer that enables a server (not Google Analytics) to be configured to provide email notification on exceptions, which is probably a sufficient solution for many.

(Almost an) answer. jakub-kriz has provided a detailed answer, but it does not work as-is. Building upon the answer, I was able to configure Google Analytics to email when no exceptions occur. This is the exact opposite of what is required. Unfortunately, I have been unable to get emails when one or more exceptions occur.

Alternate direction. jakub-kriz has proposed an alternative solution, whereby normal events are used, rather than exception events. I haven't tried this direction.

A complete solution has not yet been proposed.

like image 996
user2768 Avatar asked Nov 03 '15 13:11

user2768


1 Answers

It is possible, but not in a direct way, you have to hookup you analytics quite dirty.

1) Configuration in Analytics Admin

Create two filters in Admin -> View -> Filters -> Custom -> Advanced

Create filter that listens on hitType exception and set Event Category - Exception

Filter hitType to Event Category

Create filter that replicates Exception description into Event Action

enter image description here

2) Create custom Goal

Create two filters in Admin -> View -> Goals -> Custom -> Event

Event Category equals Exception

Event Category equals Exception

3) Create Custom Alert

Custom alert by Goal containg exception

Custom alert by Goal containg exception

Do not forget your email

enter image description here

Try this and let me know!

like image 200
Jakub Kriz Avatar answered Oct 20 '22 17:10

Jakub Kriz