diff --git a/client/my-sites/upgrades/checkout-thank-you/google-voucher/index.jsx b/client/my-sites/upgrades/checkout-thank-you/google-voucher/index.jsx index a69797aaa85c8e..7ab0b87d7ef01d 100644 --- a/client/my-sites/upgrades/checkout-thank-you/google-voucher/index.jsx +++ b/client/my-sites/upgrades/checkout-thank-you/google-voucher/index.jsx @@ -14,6 +14,7 @@ import PurchaseDetails from 'components/purchase-detail'; import PurchaseButton from 'components/purchase-detail/purchase-button'; import TipInfo from 'components/purchase-detail/tip-info'; import Dialog from 'components/dialog'; +import analytics from 'lib/analytics'; import termsAndConditions from './terms-and-conditions'; import QuerySiteVouchers from 'components/data/query-site-vouchers'; import { @@ -40,12 +41,13 @@ class GoogleVoucherDetails extends Component { super(); // bounds - this.onButtonClick = this.onButtonClick.bind( this ); + this.onGenerateCode = this.onGenerateCode.bind( this ); this.onDialogCancel = this.onDialogCancel.bind( this ); - this.onAgreeButton = this.onAgreeButton.bind( this ); + this.onAcceptTermsAndConditions = this.onAcceptTermsAndConditions.bind( this ); + this.onSetupGoogleAdWordsLink = this.onSetupGoogleAdWordsLink.bind( this ); // debounced - this.incrementStep = debounce( this.incrementStep, 300 ); + this.changeStep = debounce( this.changeStep, 300 ); this.state = { step: INITIAL_STEP @@ -73,21 +75,28 @@ class GoogleVoucherDetails extends Component { } } - onButtonClick() { - this.incrementStep(); + onGenerateCode() { + analytics.ga.recordEvent( 'calypso_plans_google_voucher_generate_click', 'Cliked Generate Code Button' ); + + this.changeStep(); } onDialogCancel() { this.setState( { step: INITIAL_STEP } ); } - onAgreeButton() { - this.props.assignVoucher( this.props.selectedSite.ID, GOOGLE_CREDITS ); + onAcceptTermsAndConditions() { + analytics.ga.recordEvent( 'calypso_plans_google_voucher_toc_accept_click', 'Cliked Agree Button' ); + this.props.assignVoucher( this.props.selectedSite.ID, GOOGLE_CREDITS ); this.setState( { step: CODE_REDEEMED } ); } - incrementStep() { + onSetupGoogleAdWordsLink() { + analytics.ga.recordEvent( 'calypso_plans_google_voucher_setup_clic', 'Cliked Setup Goole AdWords Button' ); + } + + changeStep() { const newStep = ( this.state.step === INITIAL_STEP ) ? TERMS_AND_CONDITIONS : CODE_REDEEMED; this.setState( { step: newStep } ); } @@ -101,7 +110,7 @@ class GoogleVoucherDetails extends Component { return (