diff --git a/site/DonateForm.tsx b/site/DonateForm.tsx index 6028d4908ce..d6e910660fe 100644 --- a/site/DonateForm.tsx +++ b/site/DonateForm.tsx @@ -27,6 +27,7 @@ import { Checkbox } from "@ourworldindata/components" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faArrowRight, faInfoCircle } from "@fortawesome/free-solid-svg-icons" import Bugsnag from "@bugsnag/js" +import { SiteAnalytics } from "./SiteAnalytics.js" const ONETIME_DONATION_AMOUNTS = [20, 50, 100, 500, 1000] const MONTHLY_DONATION_AMOUNTS = [5, 10, 25, 50, 100] @@ -34,6 +35,8 @@ const MONTHLY_DONATION_AMOUNTS = [5, 10, 25, 50, 100] const ONETIME_DEFAULT_INDEX = 2 const MONTHLY_DEFAULT_INDEX = 2 +const analytics = new SiteAnalytics() + @observer export class DonateForm extends React.Component { @observable interval: DonationInterval = "once" @@ -163,6 +166,8 @@ export class DonateForm extends React.Component { ) } + analytics.logSiteFormSubmit("donate") + window.location.href = session.url } @@ -356,6 +361,7 @@ export class DonateForm extends React.Component { type="submit" className="donation-submit" disabled={this.isLoading || this.isSubmitting} + onClick={() => analytics.logSiteClick("donate-now")} > Donate now