Last active
October 30, 2017 18:40
-
-
Save kbshl/274cb0f4090ea9281ebb to your computer and use it in GitHub Desktop.
Titanium Mobile: Fire Google Analytics Screen View
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
// fire tracking event | |
require('/helpers/analytics/ga').screen(SCREENNAME); |
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
// add postlayout event listener to fire analytics screen view | |
this.viewProxy.addEventListener('postlayout', function(layoutEvent) { | |
// remove event listener | |
this.removeEventListener(layoutEvent.type, arguments.callee); | |
// fire tracking event | |
require('/helpers/analytics/ga').screen(SCREENNAME); | |
return; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment