Skip to content

Commit

Permalink
feat: add ga to deeplink
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Feb 21, 2024
1 parent d70cce1 commit 6c74f3f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/(deeplink)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import '../globals.css'
import "../layout.css"
import {ArticleJsonLd} from "next-seo";
import React from "react";
import GoogleAnalytics from "@/components/GoogleAnalytics";
export const metadata: Metadata = {
title: '삐삐',
description: '가족 일상공유 어플리케이션',
Expand Down Expand Up @@ -46,6 +47,7 @@ export default function RootLayout({
]
}
/>
<GoogleAnalytics/>
</head>

<body suppressHydrationWarning={true}>
Expand Down
2 changes: 2 additions & 0 deletions app/(website)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {ArticleJsonLd} from "next-seo";
import NavigationBar from "@/components/layout/NavigationBar";
import React from "react";
import FooterBar from "@/components/layout/FooterBar";
import GoogleAnalytics from "@/components/GoogleAnalytics";
export const metadata: Metadata = {
title: '삐삐',
description: '가족 일상공유 어플리케이션',
Expand Down Expand Up @@ -48,6 +49,7 @@ export default function RootLayout({
]
}
/>
<GoogleAnalytics/>
</head>

<body suppressHydrationWarning={true}>
Expand Down
10 changes: 10 additions & 0 deletions components/GoogleAnalytics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"use client"
import {useEffect} from "react";
import {analytics} from "@/firebase/firebase";

export default function GoogleAnalytics() {
useEffect(() => {
analytics;
});
return <></>
}
3 changes: 1 addition & 2 deletions components/layout/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import {motion, LayoutGroup} from "framer-motion"
import Link from "next/link";
import {useEffect, useState} from "react";
import {detectPlatform} from "@/src/util";
import {analytics} from "@/firebase/firebase";

export default function NavigationBar({isFull}: {isFull: boolean}) {
const [appDownloadUrl, setAppDownloadUrl] = useState("/");
useEffect(() => {
analytics;
const platform = detectPlatform();
if (platform === "ios") {
setAppDownloadUrl("https://itunes.apple.com/kr/app/id6475082088");
Expand Down

0 comments on commit 6c74f3f

Please sign in to comment.