Skip to content

Instantly share code, notes, and snippets.

@ahume
Created March 20, 2013 11:22
Show Gist options
  • Save ahume/5203948 to your computer and use it in GitHub Desktop.
Save ahume/5203948 to your computer and use it in GitHub Desktop.
<!-- Standard implementation, just before closing body tag -->
_ophan.loaded = function() {
Ophan.logPageView();
}
<script src="http://s.ophan.co.uk/js/ophan.min.js" async defer></script>
</body>
<!-- Or something more custom using require -->
require(["http://s.ophan.co.uk/js/ophan.min.js", adverts, id], function(ophan, adverts, id) {
ophan.additionalData({"isLoggedIn": id.isLoggedIn()});
ophan.logView();
window.addEventListener('load', function() {
ophan.logEvent("pageLoad", {
"adverts": adverts.getTrackingData(),
"performance": ophan.getPerformanceData()
});
}, false);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment