Hi. We recently noticed that the munchkin code on one of our sites was hitting an error and so we weren't collecting any activity on that site.
Is there a way to set up a trigger (or anything) that would notify me if there hasn't been any activity on a site for a day?
Not really...but you could try something like
Not Was Visited Web Page IS X
in Past 24 hours
At least X times (or some other constraint)
Send Alert
the problem is that this will trigger for ALL of the records that didn't get a Visit Web Page activity. Not ideal. Perhaps your CMS or GA can check your code for you.
What was the source of the error?
We monitor our Munchkin endpoint itself for uptime, same as we do with our SFDC instance, etc.
If you're talking about a JavaScript parsing error within your codebase (like someone forgot a closing bracket, so JS was broken) the only way to actually stem that is to do QA testing. Even if you were to try to have another piece of JS that logged errors, you can't be sure that script will run! You can use something like GA to log exceptions (as opposed to hard errors) like Josh Hill suggested, but Munchkin doesn't emit catchable exceptions so nothing would ever fire.
EDIT: You could set an API call that looks for Visited Web Page activities during the past N minutes. That'd be a direct indicator of failure, assuming you always get some activity on your site, such as a website health check.
Hi, Sanford. It turns out this particular case was an error in reporting on my part; the munchkin was actually working. But previously it had been turned off on a different site when a developer had commented out the code for the js. Our QA team wouldn't know how to catch that, as they can't check every marketing script for every code release on each site. So it would be nice to just have something to monitor that the munchkin is still collecting data.
I was thinking of setting up a robot to visit each site once a day. Associate the robot with a Marketo record, then have a trigger run on that record not visiting a site in over a day. Sounds workable in theory; though I don't know offhand what to use for such a robot.
Well, by "QA" I was thinking about a process that includes verifying Munchkin is logging hits (which we do because we've been bitten by problems before, such as a developer leaving a typo in our Munchkin ID).
You can write the robot that you refer to using Selenium. But if you go through the exercise of building it, then your "robot" is something that could be part of the QA process, assuming all code rollouts go through QA. Rather than looking for "not visited" the QA team gets alerted on "yes, visited" or else code hasn't passed QA.
When you use a full-page monitoring service (Pingdom, Monitis, etc.) those hits always load Munchkin. To a degree, this is a pre-built "robot" you can already use. However, getting those hits to always pass a cookie that's associated with your special alerting lead... that's its own not-so-fun exercise.