From f90ff2160a6224faa67750be75da12977c665904 Mon Sep 17 00:00:00 2001 From: Amadej Date: Tue, 12 Feb 2019 12:26:33 +0100 Subject: [PATCH 1/5] Analytics - track Help, News, Home clicks --- .../NewHeader/components/DesktopHeader.tsx | 35 +++++++++++++++++-- .../NewHeader/components/MobileHeader.tsx | 23 +++++++++++- 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/common/components/Header/NewHeader/components/DesktopHeader.tsx b/common/components/Header/NewHeader/components/DesktopHeader.tsx index aa06984c0d1..bd459880924 100644 --- a/common/components/Header/NewHeader/components/DesktopHeader.tsx +++ b/common/components/Header/NewHeader/components/DesktopHeader.tsx @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; +import { AnalyticsService } from 'v2/services'; import { languages } from 'config'; import { translateRaw } from 'translations'; import { AppState } from 'features/reducers'; @@ -69,19 +70,35 @@ class DesktopHeader extends Component {
- setAccessMessage('')}> + { + setAccessMessage(''); + this.trackHomeIconClick(); + }} + > Our logo
@@ -183,6 +200,18 @@ class DesktopHeader extends Component { changeNodeRequestedOneTime(networkParam!); } }; + + private trackHelpSupportClick = (): void => { + AnalyticsService.instance.track('Legacy_Help & Support clicked'); + }; + + private trackLatestNewsClick = (): void => { + AnalyticsService.instance.track('Legacy_Latest News clicked'); + }; + + private trackHomeIconClick = (): void => { + AnalyticsService.instance.track('Legacy_Home Icon clicked'); + }; } const mapStateToProps = (state: AppState, { networkParam }: any) => ({ diff --git a/common/components/Header/NewHeader/components/MobileHeader.tsx b/common/components/Header/NewHeader/components/MobileHeader.tsx index b3dcc0d5cd3..dadd208aea4 100644 --- a/common/components/Header/NewHeader/components/MobileHeader.tsx +++ b/common/components/Header/NewHeader/components/MobileHeader.tsx @@ -3,6 +3,7 @@ import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; import { Transition } from 'react-spring'; +import { AnalyticsService } from 'v2/services'; import { languages } from 'config'; import { translateRaw } from 'translations'; import { AppState } from 'features/reducers'; @@ -73,7 +74,13 @@ class MobileHeader extends Component {
- setAccessMessage('')}> + { + setAccessMessage(''); + this.trackHomeIconClick(); + }} + > Our logo
@@ -155,6 +162,7 @@ class MobileHeader extends Component {