Skip to content

Instantly share code, notes, and snippets.

@rblalock
Last active December 13, 2015 21:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rblalock/4980212 to your computer and use it in GitHub Desktop.
Save rblalock/4980212 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