Skip to content

Commit 197a055

Browse files
DilsonsPicklesLWinterberg
authored andcommitted
Update trackEvent function calls
1 parent bcd2bbb commit 197a055

File tree

6 files changed

+23
-38
lines changed

6 files changed

+23
-38
lines changed

src/components/banner/BetaBanner.jsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import React from "react";
22
import "../../styles/icons.css";
3+
import { trackEvent } from "../../utils/matomo";
34

45
function BetaBanner(url) {
56
//no beta at the moment
6-
return null;
7+
return null;
78

89
function handleButtonClick() {
9-
if (typeof _paq !== "undefined") {
10-
_paq.push([
11-
"trackEvent",
12-
"Beta CTA",
13-
"Beta CTA button",
14-
"Go to Beta site",
15-
]);
16-
}
10+
trackEvent("Beta CTA", "Beta CTA button", "Go to Beta site");
1711
}
1812

1913
if (url.url.endsWith("/beta/") || url.url.endsWith("/beta")) {
@@ -35,7 +29,9 @@ function BetaBanner(url) {
3529
<a
3630
href="/beta"
3731
id="join-button"
38-
onClick={() => {handleButtonClick();}}
32+
onClick={() => {
33+
handleButtonClick();
34+
}}
3935
className="flex text-xl h-12 my-4 justify-center items-center px-4 border-2 border-gray-900 rounded-md hover:bg-gray-900 hover:text-white"
4036
>
4137
Join the beta

src/components/banner/PromoBanner.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { museHubReleases } from "../../assets/js/releaseData";
22
import "../../styles/icons.css";
33
import useBrowserOS from "../../hooks/useDetectOS";
4+
import { trackEvent } from "../../utils/matomo";
45

56
function PromoBanner() {
67
// no promo atm
@@ -20,14 +21,7 @@ function PromoBanner() {
2021
const showBanner = browserOS === "OS X" || browserOS === "Windows";
2122

2223
function handleButtonClick() {
23-
if (typeof _paq !== "undefined") {
24-
_paq.push([
25-
"trackEvent",
26-
"Promo CTA",
27-
"Promo CTA button",
28-
"Ace Studio Muse Hub",
29-
]);
30-
}
24+
trackEvent("Promo CTA", "Promo CTA button", "Ace Studio Muse Hub");
3125
}
3226

3327
return (
@@ -39,7 +33,7 @@ function PromoBanner() {
3933
>
4034
<div className="lg:flex text-center gap-4">
4135
<p className="text-lg text-gray-900 font-bold">
42-
Ace Studio - The World's No.1 AI Singing Voice Generator
36+
Ace Studio - The World's No.1 AI Singing Voice Generator
4337
</p>
4438
</div>
4539

src/components/banner/SurveyBanner.jsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import React from "react";
22
import "../../styles/icons.css";
3+
import { trackEvent } from "../../utils/matomo";
34

45
function SurveyBanner(url) {
56
//no survey going on at the moment
67
return null;
78

89
function handleButtonClick() {
9-
if (typeof _paq !== "undefined") {
10-
_paq.push([
11-
"trackEvent",
12-
"Survey CTA",
13-
"Survey CTA button",
14-
"Go to Survey",
15-
]);
16-
}
10+
trackEvent("Survey CTA", "Survey CTA button", "Go to Survey");
1711
}
1812

1913
return (
@@ -22,17 +16,18 @@ function SurveyBanner(url) {
2216
className="flex items-center justify-center min-h-24 bg-orange-400 gap-4 flex-wrap"
2317
>
2418
<div className="flex gap-2 flex-wrap my-4 mx-2">
25-
<p className="text-lg font-bold text-gray-900">
26-
3 minute survey:
27-
</p>
19+
<p className="text-lg font-bold text-gray-900">3 minute survey:</p>
2820
<p className="text-lg text-gray-900">
29-
Help us understand what sort of plugins and features you'd be interested in next.
21+
Help us understand what sort of plugins and features you'd be
22+
interested in next.
3023
</p>
3124
</div>
3225
<a
3326
href="https://po415hli6k2.typeform.com/hub-audacity"
3427
id="survey-button"
35-
onClick={() => {handleButtonClick();}}
28+
onClick={() => {
29+
handleButtonClick();
30+
}}
3631
className="flex text-lg h-12 my-4 justify-center items-center px-4 border-2 border-gray-900 rounded-md hover:bg-gray-900 hover:text-white"
3732
>
3833
Take the survey

src/components/button/PlatformDownloadMuseHubButton.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ function PlatformDownloadMuseHubButton(props) {
77
const browserOS = useBrowserOS();
88

99
function onClickButtonHandler() {
10-
trackEvent([
10+
trackEvent(
1111
"Download Button",
1212
"Download Muse Hub",
1313
`Download Muse Hub button ${browserOS}`,
14-
]);
14+
);
1515

1616
setTimeout(() => {
1717
window.location.href = "/post-download";

src/components/card/DownloadCard.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ function DownloadCard(props) {
55
const { OS, title, downloadURL, downloadType, checksum } = props;
66

77
function handleDownloadButtonClick() {
8-
trackEvent([
8+
trackEvent(
99
"Download Button",
1010
"Download Audacity",
1111
`${OS + " " + title + " " + downloadType}`,
12-
]);
12+
);
1313

1414
setTimeout(() => {
1515
window.location.href = "/post-download";

src/components/video/FeaturedVideo.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ function FeaturedVideo(props) {
1616

1717
function handleVideoClick() {
1818
setIsClicked(true);
19-
trackEvent(["Video embed", "Watch release video", title]);
19+
trackEvent("Video embed", "Watch release video", title);
2020
}
2121
function handleCTAClick() {
22-
trackEvent(["Promo CTA", "Promo CTA video button", ctaText]);
22+
trackEvent("Promo CTA", "Promo CTA video button", ctaText);
2323
}
2424

2525
return (

0 commit comments

Comments
 (0)