• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / fx-private-relay / 591bf83e-be4b-4cf9-a7dd-e943ab78346a

22 Oct 2025 07:28PM UTC coverage: 88.792% (-0.05%) from 88.843%
591bf83e-be4b-4cf9-a7dd-e943ab78346a

Pull #5989

circleci

vpremamozilla
MPP-4348: propagate UTM params from landing page to SubPlat and Accounts URLs
Pull Request #5989: MPP-4348: propagate UTM params from landing page to SubPlat and Accounts URLs

2913 of 3933 branches covered (74.07%)

Branch coverage included in aggregate %.

37 of 49 new or added lines in 10 files covered. (75.51%)

3 existing lines in 3 files now uncovered.

18105 of 19738 relevant lines covered (91.73%)

11.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

28.57
/frontend/src/components/layout/topmessage/HolidayPromoBanner.tsx
1
import Link from "next/link";
7✔
2
import { useRouter } from "next/router";
7✔
3
import { useL10n } from "../../../hooks/l10n";
7✔
4
import { Localized } from "../../Localized";
7✔
5
import styles from "./HolidayPromoBanner.module.scss";
7✔
6
import { RuntimeData } from "../../../hooks/api/types";
7
import {
8
  getPeriodicalPremiumSubscribeLink,
9
  isPeriodicalPremiumAvailableInCountry,
10
} from "../../../functions/getPlan";
7✔
11
import { ProfileData } from "../../../hooks/api/profile";
12
import { useGaEvent } from "../../../hooks/gaEvent";
7✔
13
import { useGaViewPing } from "../../../hooks/gaViewPing";
7✔
14
import { useUtmApplier } from "../../../hooks/utmApplier";
7✔
15

16
type Props = {
17
  isLoading: boolean;
18
  profile?: ProfileData;
19
  runtimeData?: RuntimeData;
20
};
21

22
export const HolidayPromoBanner = (props: Props) => {
7✔
23
  const l10n = useL10n();
×
24
  const gaEvent = useGaEvent();
×
25
  const router = useRouter();
×
26
  const coupon = "HOLIDAY20";
×
NEW
27
  const applyUtmParams = useUtmApplier();
×
UNCOV
28
  const subscribeLink = isPeriodicalPremiumAvailableInCountry(props.runtimeData)
×
29
    ? applyUtmParams(
30
        getPeriodicalPremiumSubscribeLink(props.runtimeData, "yearly"),
31
      )
32
    : null;
33
  const todaysDate = new Date();
×
34
  const expiryDate = new Date("December 31, 2023");
×
35
  const isPastExpiry = todaysDate > expiryDate;
×
36
  const gaHolidayBannerViewPing = useGaViewPing({
×
37
    category: "Holiday Promotion Banner 2023",
38
    label: "holiday-promo-banner-view",
39
  });
40
  const gaHolidayBannerBtnPing = () => {
×
41
    gaEvent({
×
42
      category: "Holiday Promotion Banner 2023",
43
      action: "Engage",
44
      label: "holiday-promo-banner-get-one-year-btn",
45
    });
46
  };
47

48
  if (
×
49
    props.isLoading ||
×
50
    !subscribeLink ||
51
    (props.profile && router.pathname !== "/premium") ||
52
    isPastExpiry
53
  ) {
54
    return null;
×
55
  }
56

57
  const utmParams =
58
    "&utm_source=fx-relay&utm_medium=banner&utm_content=holiday-promo-banner-cta&utm_campaign=relay-holiday-promo-2023";
×
59
  const subscriberLinkWithCoupon = `${subscribeLink}&coupon=${coupon}${utmParams}`;
×
60

61
  return (
62
    <aside className={styles.wrapper}>
63
      <div className={styles["left-promo-container"]}>
64
        <div className={styles["promo-container"]}>
65
          <p className={styles["promo-text"]}>
66
            {l10n.getString("holiday-promo-banner-protect-inbox")}
67
          </p>
68
          <p className={styles["promo-text-bolded"]}>
69
            {l10n.getString("holiday-promo-banner-code-desc")}
70
          </p>
71
        </div>
72
        <div className={styles["promo-container"]}>
73
          <Localized
74
            id="holiday-promo-banner-code-usage"
75
            vars={{ couponCode: coupon }}
76
            elems={{
77
              coupon: <span className={styles["promo-text-bolded"]} />,
78
            }}
79
          >
80
            <p className={styles["promo-text"]} />
81
          </Localized>
82
        </div>
83
      </div>
84
      <div className={styles["promo-container"]}>
85
        <Link
86
          ref={gaHolidayBannerViewPing}
87
          onClick={gaHolidayBannerBtnPing}
88
          href={subscriberLinkWithCoupon}
89
          className={styles["cta-button"]}
90
        >
91
          {l10n.getString("holiday-promo-banner-cta-button")}
92
        </Link>
93
        <small className={styles["promo-code-expiry"]}>
94
          {l10n.getString("holiday-promo-banner-promo-expiry")}
95
        </small>
96
      </div>
97
    </aside>
98
  );
99
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc