Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ const NavbarStickyBanner = ({
true
);

const onClose = () => {
const onReadMore = (event: React.MouseEvent) => {
event.stopPropagation();
gtmEvent("Navbar_banner_read_more");
};

const onClose = (event: React.MouseEvent) => {
event.stopPropagation();
gtmEvent("Navbar_banner_close");
setIsOpenStorage(false);
};

const onReadMore = () => gtmEvent("Navbar_banner_read_more");

return (
<ClientOnly>
<Center
Expand All @@ -60,8 +64,8 @@ const NavbarStickyBanner = ({
{text}
</Text>
<Button
onClick={onReadMore}
href={buttonLink}
onClick={onReadMore}
px={4}
py={1}
borderRadius={8}
Expand Down
5 changes: 4 additions & 1 deletion workspaces/website/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ export function loadScript(url: string) {
head.appendChild(script);
});
}
export const gtmEvent = (target: string) =>
export const gtmEvent = (target: string) => {
console.log(target);

window.gtag?.("event", target, { event_category: "engagement" });
};