Skip to content

Commit

Permalink
Merge pull request #306 from cfpb/fix_for_event_firing
Browse files Browse the repository at this point in the history
Modified answer events to always fire irregardless of settlement status
  • Loading branch information
sebworks committed Jun 1, 2017
2 parents fc9958a + 905bc44 commit 37e2c2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
All notable changes to this project will be documented in this file.
We follow the [Semantic Versioning 2.0.0](http://semver.org/) format.

## 2.3.6
- Modified Google Analytics question event to fire independent of settlement status

## 2.3.5
- Fixed Google Analytics events on "Yes" and "Not sure" buttons

Expand Down
6 changes: 4 additions & 2 deletions src/disclosures/js/views/question-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ var questionView = {
} else if ( $( this ).attr( 'id' ) === 'question_answer-yes' ) {
questionView.$followupYes.show();
questionView.$followupNoNotSure.hide();
Analytics.sendEvent( getDataLayerOptions( 'Step Completed', 'Yes' ) );
} else {
questionView.$followupNoNotSure.show();
questionView.$followupYes.hide();
Analytics.sendEvent( getDataLayerOptions( 'Step Completed', 'Not sure' ) );
}
// Show the rest of the page
questionView.$getOptions.show();
Expand All @@ -95,6 +93,10 @@ var questionView = {
}, 900, 'swing', function() {
// Noop function.
} );

Analytics.sendEvent( getDataLayerOptions( 'Step Completed',
$( this ).text().trim() )
);
} );
}

Expand Down

0 comments on commit 37e2c2b

Please sign in to comment.