Add incentive ID to every track event

on the welcome incentive page.
This commit is contained in:
Ismael Martín Alabarce 2023-06-19 13:04:14 +02:00
parent 48670366b2
commit 4afd148e0e
2 changed files with 5 additions and 4 deletions

View File

@ -63,7 +63,8 @@ function ExitSurveyModal( {}: {
const exitSurvey = () => {
recordEvent( 'wcpay_exit_survey', {
just_remove: true /* eslint-disable-line camelcase */,
just_remove: true,
incentive_id: incentive.id,
} );
closeModal();
@ -71,14 +72,13 @@ function ExitSurveyModal( {}: {
const sendFeedback = () => {
recordEvent( 'wcpay_exit_survey', {
/* eslint-disable camelcase */
happy: isHappyChecked ? 'Yes' : 'No',
install: isInstallChecked ? 'Yes' : 'No',
more_info: isMoreInfoChecked ? 'Yes' : 'No',
another_time: isAnotherTimeChecked ? 'Yes' : 'No',
something_else: isSomethingElseChecked ? 'Yes' : 'No',
comments,
/* eslint-enable camelcase */
incentive_id: incentive.id,
} );
if ( isMoreInfoChecked ) {

View File

@ -90,8 +90,8 @@ const ConnectAccountPage = () => {
const handleSetup = async () => {
setSubmitted( true );
recordEvent( 'wcpay_connect_account_clicked', {
// eslint-disable-next-line camelcase
wpcom_connection: isJetpackConnected ? 'Yes' : 'No',
incentive_id: incentive.id,
} );
const pluginsToInstall = [ ...enabledApms ].map(
@ -107,6 +107,7 @@ const ConnectAccountPage = () => {
extensions: [ ...enabledApms ]
.map( ( apm ) => apm.id )
.join( ', ' ),
incentive_id: incentive.id,
} );
await activatePromo();
} else {