From c489d89fca1b9094b624bf3ed7aed63c3cb21d36 Mon Sep 17 00:00:00 2001 From: Alex Porter Date: Wed, 29 Apr 2015 00:40:55 -0400 Subject: [PATCH 1/5] Adding in GA script and custom events for generator flow --- app/app.js | 4 ++++ app/components/download-archive.js | 2 ++ app/components/generator-step.js | 1 + app/index.html | 10 ++++++++++ app/templates/index.hbs | 2 +- app/templates/shared/header.hbs | 2 +- app/views/application.js | 8 +++++++- config/environment.js | 2 ++ 8 files changed, 28 insertions(+), 3 deletions(-) diff --git a/app/app.js b/app/app.js index 757df3899..040db72f5 100644 --- a/app/app.js +++ b/app/app.js @@ -11,6 +11,10 @@ var App = Ember.Application.extend({ Resolver: Resolver }); +Ember.LinkView.reopen({ + attributeBindings: ['data-eventname'] +}); + loadInitializers(App, config.modulePrefix); export default App; diff --git a/app/components/download-archive.js b/app/components/download-archive.js index e33740b0c..6532d0579 100644 --- a/app/components/download-archive.js +++ b/app/components/download-archive.js @@ -18,11 +18,13 @@ export default Ember.Component.extend({ return new Ember.Handlebars.SafeString(message); }.property('isBuilding'), triggerArchiveDownload: function() { + ga('send', 'event', 'item', 'click', 'generator-build-download'); window.location.href = this.archiveLink; }.observes('archiveLink'), actions: { handleClick: function(){ if(this.isEnabled && !this.isBuilding){ + ga('send', 'event', 'item', 'click', 'generator-build-trigger'); this.sendAction('action'); } } diff --git a/app/components/generator-step.js b/app/components/generator-step.js index 47b86c27c..1f40bbb2d 100644 --- a/app/components/generator-step.js +++ b/app/components/generator-step.js @@ -28,6 +28,7 @@ export default Ember.Component.extend({ } }, updateStep: function(currentStep, nextStep){ + ga('send', 'event', 'item', 'click', 'generator-step-'+this.step); this.toggleProperty('isShowingBody'); this.sendAction('action', currentStep, nextStep); return true; // keep bubbling diff --git a/app/index.html b/app/index.html index 99d091396..de8ce16b9 100644 --- a/app/index.html +++ b/app/index.html @@ -16,7 +16,17 @@ {{content-for 'body'}} + + diff --git a/app/templates/index.hbs b/app/templates/index.hbs index f60e51cf1..24ba7dbe3 100644 --- a/app/templates/index.hbs +++ b/app/templates/index.hbs @@ -6,7 +6,7 @@

The simplest way to create hosted apps across platforms and devices

- +
diff --git a/app/templates/shared/header.hbs b/app/templates/shared/header.hbs index 7d46da459..90bee12b4 100644 --- a/app/templates/shared/header.hbs +++ b/app/templates/shared/header.hbs @@ -3,7 +3,7 @@ {{#link-to 'index'}}{{/link-to}}