📈 Ajouter les smileys au tracking Piwik

pull/102/head
Laurent Bossavit 2017-10-15 12:30:12 +02:00
parent 7ddc0c9d80
commit 40fad7d8d3
1 changed files with 7 additions and 1 deletions

View File

@ -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 (