Not so long ago, an article
Monitoring a site using Google Docs appeared on the
website . The essence of which was that Google Docs created a document with a script that periodically polls the site for availability and sends a letter to the owner in case of a fall.
This is an interesting solution, but there are some problems in the field. My caching in nginx is configured so that it can issue pages from the cache for days when php is dropped. So, the survey of the main page of the site does not provide special interest, in contrast to the internal pages.
Event in Google Analytics
The first solution was to introduce Google Analytics code into the 50x error page and set up email notifications when a certain event was triggered.
')
After seconds, event is sent to Google Analytics and after a while you can view all the error information: url, input source, parameters, etc. The problem is only one, the event report is sent the next day. If the site really fell, then this waiting time is unacceptable.
Events right from the browser
I decided to dig in the direction of the fact that on the client side (in the browser) certain actions are performed, as a result of which I receive a quick notification by mail.
Having rummaged in Javascript and Flash found that you need to send a letter
- or provide server-side processing - which is impossible, based on the assumption about the fall of everything except nginx
- or ask the user to send a letter in handles - thus “firing” his and his mailing address
Google Forms
The solution came unexpectedly - to build in the questionnaire from Google.
- Create a new questionnaire with a minimum of questions. I have a mandatory tick "Report a problem" and an optional field with a comment
- Insert embed code into static error page.
- Go to the properties of the survey and set instant notification of any change.
User sees error message and tell button
After a couple of seconds, a notification comes
pros
+ Does not require server side processing
+ Anonymity for you and the user
Minuses
- One button the user will have to press