Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apps/dashboard/src/@/analytics/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,3 +687,18 @@ export function reportBridgePageLinkClick(params: {
}) {
posthog.capture("bridge page link clicked", params);
}

/**
* ### Why do we need to report this event?
* - To track which tokens are users are clicking on in the token list page
*
* ### Who is responsible for this event?
* @MananTank
*
*/
export function reportTokenRowClicked(params: {
chainId: number;
tokenAddress: string;
}) {
posthog.capture("token row clicked", params);
}
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,10 @@ function GeneericTxDetails(props: {
label="Burnt fees"
tooltip="The amount of fees that were burnt by the transaction."
>
<p>{toEther(block.baseFeePerGas || 0n * receipt.gasUsed)}</p>
<p>
{toEther((block.baseFeePerGas || 0n) * receipt.gasUsed)}{" "}
{chain.nativeCurrency?.symbol}
</p>
</GridItem>
</section>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";
import Link from "next/link";
import { type Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
import { reportTokenRowClicked } from "@/analytics/report";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Button } from "@/components/ui/button";
import { Skeleton } from "@/components/ui/skeleton";
Expand Down Expand Up @@ -122,6 +123,12 @@ export function TokensTable(props: {
className="gap-2 rounded-full bg-card hover:border-foreground/50 text-muted-foreground hover:bg-inverted hover:text-inverted-foreground"
>
<Link
onClick={() =>
reportTokenRowClicked({
chainId: token.chainId,
tokenAddress: token.address,
})
}
aria-label={`Buy ${token.symbol}`}
href={
token.address.toLowerCase() ===
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { useQuery } from "@tanstack/react-query";
import { useState } from "react";
import { trackPayEvent } from "../../../../../analytics/track/pay.js";
import { defineChain } from "../../../../../chains/utils.js";
import type { ThirdwebClient } from "../../../../../client/client.js";
import type { SupportedFiatCurrency } from "../../../../../pay/convert/type.js";
Expand Down Expand Up @@ -242,6 +244,17 @@ export type BridgeWidgetProps = {
export function BridgeWidget(props: BridgeWidgetProps) {
const [tab, setTab] = useState<"swap" | "buy">("swap");

useQuery({
queryFn: () => {
trackPayEvent({
client: props.client,
event: "ub:ui:bridge_widget:render",
});
return true;
},
queryKey: ["bridge_widget:render"],
});

return (
<CustomThemeProvider theme={props.theme}>
<EmbedContainer
Expand Down
Loading