Skip to content

Commit

Permalink
Add the view event to Manage Banner in Jetpack dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
cleacos committed Feb 1, 2024
1 parent e3b86aa commit 90edbf9
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ import { getRedirectUrl, UpsellBanner } from '@automattic/jetpack-components';
import { __ } from '@wordpress/i18n';
import analytics from 'lib/analytics';
import PropTypes from 'prop-types';
import React, { useCallback } from 'react';
import React, { useCallback, useEffect } from 'react';
import jetpackManageIcon from './jetpack-manage.svg';

const JetpackManageBanner = props => {
useEffect( () => {
analytics.tracks.recordEvent( 'jetpack_manage_banner_view', {
feature: 'manage',
page: props.path,
} );
}, [ props.path ] );

// Handle click events
const trackEvent = useCallback(
target => {
analytics.tracks.recordJetpackClick( {
Expand Down

0 comments on commit 90edbf9

Please sign in to comment.