Skip to content

Instantly share code, notes, and snippets.

@sampel
sampel / getUrlParamete.js
Created December 11, 2012 08:23
Piece of javascript code: gets the service parameter rom the url (GET) and check if contains something
/*********************************/
/* by Sampel */
/* */
/* When users come to my portal */
/* if they come to login, then */
/* show the login. The only way */
/* know if the user comes to log */
/* in is with the get parameter */
/* service */
/*********************************/
@sampel
sampel / outboundLinks2GA.js
Created December 11, 2012 09:09
Adding Google Analytics event tracking to outbound links
$(function() {
unction recordOutboundLink(link, category, action) {
try {
_gaq.push(['_trackEvent', category , action, 'visiting things']);
setTimeout('window.open("' + link.href + '")', 100);
} catch(err) {
console.error('Error recording outbound link.');
}