Created
December 6, 2010 03:20
-
-
Save joemocha/729789 to your computer and use it in GitHub Desktop.
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
function(){ | |
if (!FCG.track){ | |
FCG.track = { | |
host: "http://localhost:6789", | |
events: ["load", "click", "submit", "unload"] | |
run: function(node, event, data){ | |
$(node).on(event, function(){ | |
/* | |
You might want to massage the data hash | |
i.e. in pseudo code | |
var new_data = data.inject({}) do |sum, (key, value)| | |
sum[key] = case value | |
when String | |
else | |
value | |
end | |
sum | |
end | |
*/ | |
$(document).trigger("activity:fire", { activity: data }); | |
}); | |
} | |
}; | |
} | |
return { | |
track: FCG.track.run | |
}; | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment