Add Google Analytics

This commit is contained in:
2021-09-05 21:00:02 +01:00
parent fccea836d3
commit bd355599c7
15 changed files with 117 additions and 27 deletions

View File

@@ -76,6 +76,11 @@ export default withRouter(class UserGroups extends Component {
this.setState(newState);
});
this.props.logEvent("select_content", {
content_type: "main_page",
item_id: "groups",
});
}
componentWillUnmount() {
@@ -112,6 +117,9 @@ export default withRouter(class UserGroups extends Component {
this.state.functions.createGroup(this.state.groupName)
.then((result) => {
this.props.logEvent("join_group", {
group_id: result.data,
});
this.props.history.push(`/groups/${result.data}`);
this.stopCreateGroupLoading();
}).catch((error) => {
@@ -136,6 +144,9 @@ export default withRouter(class UserGroups extends Component {
.set({
role: "member",
}).then(() => {
this.props.logEvent("join_group", {
group_id: joinCodeDoc.data().group,
});
this.props.history.push(`/groups/${joinCodeDoc.data().group}`);
this.stopJoinGroupLoading();
});