Skip to content

What Does a Goal Sound Like?

Many’s the time I’ve been asked if its possible to play a sound when a Goal happens in Google Analytics. Wouldn’t that be nice we all think, but I’ve never thought it feasible. Until now. And it’s really quite simple (credit for the best solution goes to this post). Note that this solution work only in Chrome. In essence, we will play a sound file when, in an Analytics Real Time report, the counter changes.

  1. Decide on the Goal
  2. Decide on the sound you want to play – a ‘ker-ching’ noise works nicely for a sales-related Goal.
  3. Upload the WAV file to a suitable location using FTP
  4. Open Google Analytics in a new tab or window, and go to Real-time -> Conversions  report
  5. Drill down to the specific goal you want the sound to play for, and Inspect (right-click, inspect) the element you want to play the sound when it changes. This is usually going to be the big counter: in this case the ID is ID-overviewCounterValue.
  6. goal-sound2
  7. Open Notepad or similar text editor and edit this javascript; specifically, change the URL of the sound file, and the element ID:
    javascript:function notifyMe(){var old=0;var beep=new Audio(‘http://yoursitename.com/cashregister.wav’);check=function(old){var visitors=parseInt(document.getElementById(‘ID-overviewCounterValue’).innerHTML);if(old||old===0){var dif=visitors-old;if(dif>0){while(dif–){setTimeout(function(){beep.play();},500);};};};setTimeout(function(){check(visitors);},2000);};check();};notifyMe();
  8. Open  new tab or window (and keep it open for as long as you want to hear the sound)
  9. Create a Bookmarklet:
    sound-goal-bookmarklet
  10. Finally, click the status bar , click Show Bookmarks bar, click Other Bookmarks on the right, and click your newly created Bookmarklet
  11. Turn the volume up!
    It is a good feedback tool, so long as the frequency of the sound isn’t overwhelming!

Leave a Reply