Skip to content

Instantly share code, notes, and snippets.

@nuno
Forked from rblalock/alloy.js
Last active August 29, 2015 14:22
Show Gist options
  • Save nuno/d9b77093e932242be15d to your computer and use it in GitHub Desktop.
Save nuno/d9b77093e932242be15d to your computer and use it in GitHub Desktop.
Alloy override for analytics
Alloy.createWidget = function(id, name, args) {
Ti.Analytics.featureEvent("widget." + id, args);
return new (require("alloy/widgets/" + id + "/controllers/" + (name || "widget")))(args);
};
Alloy.createController = function(name, args) {
Ti.Analytics.featureEvent("controller." + name, args);
return new (require("alloy/controllers/" + name))(args);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment