Skip to content

Commit

Permalink
Add GA events
Browse files Browse the repository at this point in the history
  • Loading branch information
sho-87 committed Mar 4, 2020
1 parent e45293d commit 7e015a5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rok-talents",
"title": "RoK Talents",
"version": "1.1.1",
"version": "1.2.0",
"dataVersion": 1,
"description": "Rise of Kingdoms talent builder",
"homepage": "http://www.roktalents.com",
Expand Down
19 changes: 19 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class App extends Component {
this.state = this.getEmptyState();
treeData = loadTreeData(dataVersion);
this.updateURL('clear');
ReactGA.event({
category: 'Load',
action: 'New'
});
break;
case 5: // complete url
let [urlDataVersion, comID, red, yellow, blue] = urlParams;
Expand Down Expand Up @@ -155,8 +159,18 @@ class App extends Component {
this.state = this.getEmptyState();
treeData = loadTreeData(dataVersion);
this.updateURL('clear');
ReactGA.event({
category: 'Load',
action: 'Error',
label: this.props.url
});
} else {
this.updateURL('update');
ReactGA.event({
category: 'Load',
action: 'Existing',
label: this.props.url
});
}
break;
default:
Expand All @@ -166,6 +180,11 @@ class App extends Component {
this.state = this.getEmptyState();
treeData = loadTreeData(dataVersion);
this.updateURL('clear');
ReactGA.event({
category: 'Load',
action: 'Error',
label: this.props.url
});
}
}

Expand Down

0 comments on commit 7e015a5

Please sign in to comment.