Last active
January 13, 2018 16:46
-
-
Save error454/5272856 to your computer and use it in GitHub Desktop.
Greasemonkey script that plays a sound every time you get a new active user in google analytics realtime view.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Google Analytics Realtime Alerts | |
// @namespace http://mobilecoder.wordpress.com | |
// @version 1.0 | |
// @description Plays a sound when you get a new user, you can change the sound by hosting your own file on dropbox or other web location | |
// @match https://www.google.com/analytics/web/?hl=en#realtime* | |
// ==/UserScript== | |
// Your custom sound goes here | |
mCoinSound = new Audio("https://dl.dropbox.com/u/7079101/coin.mp3"); | |
// But don't touch this | |
mActiveUsers = 0; | |
setInterval(getActiveUsers, 1); | |
function getActiveUsers(){ | |
var count = parseInt(document.getElementById("ID-overviewCounterValue").innerText); | |
if(count > mActiveUsers){ | |
mCoinSound.play(); | |
} | |
mActiveUsers = count; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment