Analytics Real-Time Alert - BEWARE CAN BE ADDICTIVE
- SEO |
I am not sure if this is the right place to post this, but I thought it may help people with Google Analytics, so I apologise in advance if this was posted in the wrong section of Warrior Forum.
Okie dokie, this is actually a script that I use and I find extremely helpful.
Have you ever wanted to know when a user hits your website? BUT you do not want to stare at Google Analytics Real-Time, which is about as exciting as watching paint dry. Me too!!!!
What you need is an alert of some sort right - like a sound alert?
Well this bookmarklet script is what I use for two of my websites:
CSS & JavaScript Toolbox and Teacher's Companion - see below:
javascript:function notifyMe(){var old=0;var beep=new Audio('http://wipeoutmedia.com/wp-content/uploads/2013/06/CJT.wav');check=function(old){var visitors=parseInt(document.getElementById('ID-layout-1371303416647-counterValue').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();
The reason why I went with a short audio abbreviation clip is for two reasons:
1) So I can have Google Analytics Real-Time for both websites minimised and then know which website has a new or returning visitor
2) So the short audio clip is not annoying to hear - although hearing mine, you may think otherwise
Anyway, you can add a bell sound or whatever you like. Next you upload using FTP, or just add it via your WordPress media uploader but take note of the URL because that needs to go in the Audio function (see script) between the single quotes. If it is WAV, which it should be, compress it using an online compressor such as this one: Convert audio to WAV
My 2 second CJT audio clip is 290KB @ 44,100 bitrate, a little heavy but it works for me, and anyway you can compress this much further if you prefer.
Converting to WAV assures it is cross-browser too.
Next thing to do, is create a new bookmark (it's actually a bookmarklet) and then call it something. I called my two bookmarks CJT Bell and TC Bell. In the address of the bookmark - copy and paste the script in.
That is pretty much it.
I find the script only works on Google Chrome, but that is cool.
To get it working, click into your Google Analytics account and go to Real-Time, then click on your bookmark, nothing will actually happen visually but the JavaScript will now run.
Then when you get a visitor, your audio clip will play.
The great thing with Chrome is that you can open a new Chrome browser window using the 'New Incognito Window' selection. This way, you can log into another Google Analytics account at the same time. When you minimise both browser windows, you can carry on working on whatever it is you do, and be alerted by your custom sounds that is associated with that particular account. In my case CJT for CSS & JavaScript Toolbox and TC for Teacher's Companion.
The way it works is very simple. The script listens for the Google Analytics Real-Time counter to increment, once it does, the sound is played.
If you are having issues with your sound playing, then make sure your audio file URL is correct. Also, Google may have changed the Real-Time counter Id element, so you will need to inspect this by double clicking the large counter, click until you see Inspect Element and take note of the value. E.g. Id="ID-layout-1371303416647-counterValue" The value in-between the double quotes is what goes in the script, you will see that in there.
Another great thing with Google Analytics Real-Time is that you can customise the widgets however you like. This can yield some cool information.
That pretty much sums everything up so, as mentioned in my post title, be careful - it can be addictive.
That said, it is a great tool to get the big picture of where your traffic is coming from, and what pages they are currently viewing, all LIVE!!!!
Good luck, have fun, and hope you enjoyed this tutorial.
Cheers,
Damian
http://www.indiavacationspots.com
Try My Free List Building 6-Pack - Click Here.
Learn How to Build a Big Targeted Email List - FAST!
www.ListBuilding6Pack.com