Skip to content

Commit

Permalink
adding tracking to share button - closes #1066
Browse files Browse the repository at this point in the history
  • Loading branch information
gvn committed Feb 26, 2018
1 parent 5c21d15 commit 7d3fc77
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/js/components/petition/petition.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ export default class Petition extends React.Component {
});
}

onShareBtnClick() {
ReactGA.event({
category: `petition`,
action: `share tap`,
label: `${document.title} - share tap`
});
}

// helper function for auto-generating checkboxes off of the passed props.
generateCheckboxes(disabled) {
return [`checkbox1`, `checkbox2`].map(name => {
Expand Down Expand Up @@ -295,7 +303,7 @@ export default class Petition extends React.Component {
return (
<div>
<p>{this.props.thankYou}</p>
<a href={this.props.shareLink} className="btn btn-info">{this.props.shareText}</a>
<a onClick={this.onShareBtnClick} href={this.props.shareLink} className="btn btn-info">{this.props.shareText}</a>
</div>
);
}
Expand Down

0 comments on commit 7d3fc77

Please sign in to comment.