From 40fad7d8d37b155c2c1cd05fd4acd85505a1f73b Mon Sep 17 00:00:00 2001 From: Laurent Bossavit Date: Sun, 15 Oct 2017 12:30:12 +0200 Subject: [PATCH] :chart_with_upwards_trend: Ajouter les smileys au tracking Piwik --- source/components/Satisfaction.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/components/Satisfaction.js b/source/components/Satisfaction.js index 6ebcc26d7..4334c0071 100644 --- a/source/components/Satisfaction.js +++ b/source/components/Satisfaction.js @@ -5,6 +5,8 @@ import {connect} from 'react-redux' import './Satisfaction.css' import classNames from 'classnames' +import ReactPiwik from 'react-piwik'; + @connect( state => ({ sessionId: state.sessionId @@ -49,7 +51,11 @@ export default class Satisfaction extends Component { render() { let {answer, message, address, messageSent} = this.state, validMessage = (typeof message == 'string' && message.length > 4) || (typeof address == 'string' && address.length > 4), - onSmileyClick = s => this.sendSatisfaction(s) + onSmileyClick = s => { + // Pour l'instant on double le flux avec Piwik + ReactPiwik.push(['trackEvent', 'feedback', 'smiley', s]); + this.sendSatisfaction(s) + } if (!answer) return (