-
Notifications
You must be signed in to change notification settings - Fork 804
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Admin bar: Track clicks on the launch button (#41425)
- Loading branch information
1 parent
6d324b4
commit 4d871c7
Showing
4 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/packages/jetpack-mu-wpcom/changelog/add-track-launch-button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Tracking clicks on the admin bar launch button |
11 changes: 11 additions & 0 deletions
11
projects/packages/jetpack-mu-wpcom/src/features/launch-button/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { wpcomTrackEvent } from '../../common/tracks'; | ||
|
||
document.addEventListener( 'DOMContentLoaded', () => { | ||
const launchButton = document.querySelector( '#wpadminbar .launch-site' ); | ||
if ( ! launchButton ) { | ||
return; | ||
} | ||
launchButton.addEventListener( 'click', () => { | ||
wpcomTrackEvent( 'wpcom_adminbar_launch_site' ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters